Global Settings OCX C# Sample

Description:

Demonstrates how to change the printer settings programmatically for every user on the computer or just the current user running the sample using the BlackIceDEVMODE.OCX. The sample needs administrative privileges to change the settings for every user. This sample was created and compiled using Visual Studio 2005.

 

global_settings_c#.png

 

Sample Source Code Folder Location:

<RTK Installation Folder>\<RTK 32/64 bit>\Samples\Sample Source Codes\C#\Global Settings OCX C# Sample

 

Solution files

Compilers

Target .NET Framework

Global Settings OCX CS Sample_VS2015.sln

Visual Studio 2015

.NET Framework 4.0

Global Settings OCX CS Sample_VS2017.sln

Visual Studio 2017

.NET Framework 4.0

Global Settings OCX CS Sample_VS2019.sln

Visual Studio 2019

.NET Framework 4.0

Global Settings OCX CS Sample_VS2022.sln

Visual Studio 2022

.NET Framework 4.8

 

Files needed for redistribution:

 

Global Settings OCX C# Sample

-  Global Settings OCX C# Sample.exe

-  BlackIceDEVMODE.dll

-  BlackIceDEVMODE.ocx (Needs to be registered into the OS)

-  Interop.BLACKICEDEVMODELib.dll

-  SampleSettings.ini (optionally change the printer name in the ini file)

 

NOTE: To be able to run the sample, please place every component into the same directory as the executable. Also, the ActiveX controls must be reregistered in the directory where the developed executable file will run.

 

Warning: You must copy the appropriate dll files to the project folder.

 

Note: Please make sure that you use the appropriate Resource ToolKit, there are two different RTKs.

- API/RTK for 32/64 bit Windows 11, 10, 8.1, 7

- API/RTK for 32/64 bit Windows Server 2025/2022/2019/2016/2012