System Services
Updated Monday December 26, 2011
   
Category
Topic
Application
vb6
vb5
vb4-32
RemoveMenu: Killing the Form's Close Menu and 'X' Button 
Prevent users from attempting to close an application by disabling the system menu options. Jul 8.1998

RemoveMenu: Killing Any Form's Close Menu and 'X' Button - SDI, MDIParent or MDIChild
One routine to handle removal/disabling of any form's system menu Close command and form 'X' button. August 15.1999



Clipboard
vb6
vb5
vb4-32
EnumClipboardFormats: Identify Clipboard Data Available
Determine all the formats for data on the clipboard.  Jan 15.2006

DragQueryFile: Identify Files Copied to the Clipboard
How to determine the names of the files a user has selected to copy or cut in Explorer.  Jan 15.2006



Colours
vb6
vb5
vb4-32
OleTranslateColor: Inverting RGB and System Colors
How to invert a RGB or system colour.  Jul 26.2002

OleTranslateColor: Translate System/RGB Colours into R, G and B Components
How to call OleTranslateColor to retrieve constituent R, G and B components from RGB and System colours.  Jul 6.2002



COM Ports
vb6
vb5
vb4-32
CreateFile: Determine Available COM Ports
Wrapper functions returning all installed COM ports and the first available port. Jun 2.2004

ConfigurePort: Determine Available COM Ports with the MSCOMM Control
Wrapper functions returning all installed COM ports and the first available port. Jun 2.2004



Date & Time
vb6
vb5
SetLocaleInfo: Change System Long and Short Date Formats
Now assure that systems always have the desired short and long date formats set. Aug 8.1999

WM_TIMECHANGE: Detect System Changes to the Date/Time
Subclass a form to receive date/time change notifications, or notify other windows that it has changed. vb5/vb6 only June 8.1999

GetTimeZoneInformation: Determine when Daylight Saving Time Occurs
Two wrapper functions returning the current time zone info. April 8, 2001

GetTimeZoneInformation: Current, Standard and Daylight Bias
Five functions dealing with the bias (offset from GMT) for the system. April 8, 2001

GetTimeZoneInformation: Locale Standard and Daylight Time Zone Names
Two functions to return the names for the local daylight and standard zones. April 8, 2001

GetTimeZoneInformation: Obtain Dates for Daylight and Standard Time Changes
Four functions returning various date and time information concerning the transition from Standard to Daylight Savings Time. April 8, 2001

EnumDateFormats: Regional Locale Date Settings
Code to enumerate, via callbacks, the available locale time strings. May 16.1999

EnumTimeFormats: Regional Locale Time Settings
Code to enumerate, via callbacks, the available locale time strings. May 16.1999

GetLocaleInfo: System Calendar Information
Use Enumeration callbacks to retrieve the month and days specific to the users locale. Aug 8.1999

GetLocaleInfo: Regional Locale Date Settings
Obtain the national language locale settings for the user to retrieve strings representing times, dates, and other information. May 15.1999



Display & Screen
vb6
vb5
vb4-32

 

ChangeDisplaySettings: Change Display Resolution
Use this routine to change the current screen resolution or depth. Sep 1.1998 vb6, vb5 only

SendMessage: Change the Display Power State
Turn power saving-enabled monitors off/on. Mar 28.2004

EnumDisplaySettings: Enumerate Available Display Resolutions
Method to determine which resolutions a system supports. Modified from original code to support multiple-frequencies returned by NT4. Jun 4.1999 vb6, vb5 only

GetDeviceCaps: Determine the Current System Screen Font
A small API routine to determine which system font (Small or Large) installed on the target system.

SystemParametersInfo: Determine Available Screen Real Estate
Using the SystemParametersInfo API to return the co-ordinates of the screen not covered by taskbars.

SHAppBarMessage: Determine TaskBar Position
API code indicating the current screen docking positions of taskbars, and their state (on-top, hidden etc.).

How to Determine Windows Start-up Mode
API to determine if Windows is currently running in Normal Mode, Safe Mode, or Safe Mode with Network Support. Feb 16.1998

GetDeviceCaps: Display Resolution, Refresh Rate and Colour Depth
Code to obtain the myriad of GetDeviceCaps settings for displays April 18.1999

SystemParametersInfo: Non-Client Window Font Info
Get the font data for popular Display Properties / Appearance members.  Dec 7.1999

OleTranslateColor: Translate System/RGB Colours into R, G and B Components
How to call OleTranslateColor to retrieve constituent R, G and B components from RGB and System colours.  Jul 6.2002



Hardware
vb6
vb5
vb4-32
DeviceIoControl: Check Media Availability
Determines whether the drive specified contains media on NT/2000 systems.  Mar 9.2000

DeviceIoControl: Lock/Unlock Removable Media Devices
How to lock and unlock removable media on NT/2000 systems.  Mar 9.2000

DeviceIoControl: Load/Eject Removable Media
How to eject and load any removable media on NT/2000 systems.  Mar 9.2000

DeviceIoControl: Obtain Physical Drive Information
Retrieve low-level physical disk information on NT/2000.  Jan 8.2000

Win32_Processor: WMI Processor Information
The Win32_Processor WMI class returns processor status and information for both single and multiprocessor machines.  Mar 4.2002



Files
vb6
vb5
vb4-32
SfcGetFiles: Obtain a Listing of Protected System Files
Find out which system files are protected from replacement or deletion. Apr 18.2004


Keyboard
vb6
vb5
vb4-32

 

SetKeyboardState: Activating CapsLock and NumLock on Win9x
Turn CapsLock or NumLock on or off on Windows 9x using keybd_event. Win9x only  Dec 26.1996

keybd_event: Activating CapsLock, NumLock, ScrollLock and PrintScreen (NT or later)
Changing the keyboard state using the keybd_event API on Windows NT/2000/XP. Jul 10.1998

GetLastInputInfo: Determining System Idle Time
Code showing how to determine how long the system has been idle. Dec 9.2005

keybd_event: Manipulating the Desktop 
Launch Explorer, Find Files, and the Run Dialog, open the Start Menu, Minimize all windows, and launch Windows Help, all using three lines of code and the keybd_event API. Oct 27.1998

GetKeyboardLayout: Obtain the Keyboard Locale Identifier
Code to return the LCID and keyboard layout language information.  May 21.2000

SetWindowsHookEx: Trapping Special Key Events using Low Level Hooks
Preventing ctrl+esc, ctrl+tab and alt+tab across all Windows versions. Jul 30.2002



Locales
vb6
vb5
EnumSystemLocales: Enumerate Installed and Supported System Locales
Retrieve the codepage language names and abbreviations using the EnumSystemLocales callback. Nov 9.1999

EnumDateFormats: Regional Locale Date Settings
Code to enumerate, via callbacks, the available locale time strings. May 16.1999

EnumTimeFormats: Regional Locale Time Settings
Code to enumerate, via callbacks, the available locale time strings. May 16.1999

GetLocaleInfo: Regional Locale Country Settings
Obtaining system-specific settings for country information to assure international compliance. Mar 20.2000

GetLocaleInfo: Regional Locale Currency Settings
Obtaining system-specific settings for currency settings to assure international compliance. Mar 20.2000

GetLocaleInfo: Regional Locale Date Settings
Obtaining system-specific settings for date information to assure international compliance. May 15.1999

GetLocaleInfo: Regional Locale Numeric Settings
Obtaining system-specific settings for numeric values to assure international compliance. Mar 20.2000



Media
vb6
vb5
vb4-32

 

SetErrorMode: Determine if a Floppy Drive is Ready
Four wrapper routines that each determine if a removable drive is ready. Sep 12.1999

mciSendString: Ejecting Media from a CD-ROM
Using winmm.dll's mciSendString API, a one-liner to open or close a CD.  June 29.1998

DeviceIoControl: Lock/Unlock Removable Media Devices
How to lock and unlock removable media on NT/2000 systems.  Mar 9.2000

DeviceIoControl: Load/Eject Removable Media
How to eject and load any removable media on NT/2000 systems.  Mar 9.2000

DeviceIoControl: Check Media Availability
Determines whether the drive specified contains media on NT/2000 systems.  Mar 9.2000



Memory,
Resources and Windows Version
vb6
vb5
GlobalMemoryStatus: System Memory Information
The method to obtain system memory information for 32-bit Windows.

GetSystemInfo: System Processor Information
API code to retrieve processor version, type and speed.  Nov 28.1999

Win32_Processor: WMI Processor Information
The Win32_Processor WMI class returns processor status and information for both single and multiprocessor machines.  Mar 4.2002

GetVersionEx: Windows Version, Service Pack and Platform Info
Retrieve operating system info with GetVersionEx. Aug 14.1999

GetWindowsDirectory: Obtain Windows' System Folders
Wrapper functions for returning the Windows, Windows\System, and Windows temporary directories on the target machine.  Feb 3.1997



Processes
vb6
vb5
vb4-32
Win32_Process: WMI Enables Process Monitoring
Executing a WMI SQL statement to create a local machine or remote machine process monitor to track the opening and closing of a specific exe. April 25.2005


Printers & Ports
vb6
vb5
vb4-32
AddPort: Adding and Deleting Application-Defined Ports
Using AddPort and AddPortEx APIs. Oct 3.1999

AddPrinter: Add/Delete Local/Remote Printers using Existing Drivers
Simple code to add and delete a local or remote printer. Jun 22.2004

WriteProfileString: Changing Windows' Default Printer
The title just about says it all!  Mar 20.2000

SetDefaultPrinter: Changing Windows' Default Printer
For Windows 2000 or later, a one-line API call to change the default printer.  Jan 5.2005

EnumPrinters: Enumerating Local and Network Printers
Determine the available printers. print servers, domains, or print providers using EnumPrinters for Win9x and NT. Sep 20.1999

EnumPorts: Identify Windows' Available Ports
Find the installed ports on the specified machine. Sep 17.1999

GetPrinterDriverDirectory: Obtain Windows' Printer Driver Directory
The name says it all.  Aug 6.2005

CreateFile: Determine Available COM Ports
Wrapper functions returning all installed COM ports and the first available port. Jun 2.2004

ConfigurePort: Determine Available COM Ports with the MSCOMM Control
Wrapper functions returning all installed COM ports and the first available port. Jun 2.2004

SetPrinter: Rename Local and Remote Printers
Using PRINTER_LEVEL4 (or PRINTER_LEVEL2) to rename either local or remote printers.  Aug 6.2005

SetPrinter: Rename Local and Remote Printers /2
An alternate method to the above, this uses a different declaration of the PRINTER_LEVEL4 structure to rename either local or remote printers. Although not shown the change should echo to a PRINTER_INFO_2 structure without too much difficulty.  Jan 13.2006



Recycle Bin
vb6
vb5
vb4-32
SHChangeNotifyRegister: Receive Shell Change Notifications
Track additions, deletions and changes to the physical and virtual file system. (VB5/6 only) Sep 13.1998

SHQueryRecycleBin: Recycle Bin Management
API methods to display, count and empty the recycle bin in code. Jan 13.1998

SHFileOperation: Add Recycle Bin Functionality
Using the SHFileOperation API, add the capability of regular file deletion or Recycle Bin storage to your applications easily.

SHFileOperation: Copy, Move or Delete Files
Build on the SHFileOperation Recycle Bin routine to include multiple file deletions, file moving and file copying, all with the same routine.



Remote Desktop
vb6
vb5
vb4-32
WTSQuerySessionInformation: Obtaining the Name of a Computer running a Remote Desktop Session
Retrieve low-level physical disk information on NT/2000.  Sept 10.2008


Shutdown
vb6
vb5
vb4-32
ExitWindowsEx: Shut Down, Reboot, Log Off or Power Off 
How to call ExitWindowsEx on 9x as well as on NT, 2000 and XP. August 22.2002

InitiateSystemShutdown: Terminating Remote Windows Sessions
How to call shut down remote computers (and cancel the shutdown if needed).  Dec 08.2004



System
vb6
vb5
vb4-32
Rundll32: The Rundll and Rundll32 Interface
A discussion on rundll and rundll32 in Windows 95, Windows 98 and NT4, including considerations when writing dll's to interface with rundll. From the MS Knowledge Base.
Jul 3.1997

Rundll32: Control Panel Functions A-C
Rundll32: Control Panel Functions D-F
Rundll32: Control Panel Functions G-J
Rundll32: Control Panel Functions K-N
Rundll32: Control Panel Functions O-R
Rundll32: Control Panel Functions S-Z
Adding Even More Control Panel and Shell32 Functions to a VB Application - rundll32 statements to invoke a myriad of control panel and Windows shell features from your VB app. (104k) Jun 19.1999

FindExecutable: Find Exe Associated with a Registered Extension
Use FindExecutable to retrieve the file associated with a particular file extension. Sep 12.1999

RegQueryValueEx: Determine Windows Last Shutdown Date and Time
Retrieve the date and time of the local machine's last shutdown. Dec 17.2004

GetLastInputInfo: Determining System Idle Time
Code showing how to determine how long the system has been idle. Dec 9.2005

ExitWindowsEx: Shut Down, Reboot, Log Off or Power Off 
How to call ExitWindowsEx on 9x as well as on NT, 2000 and XP. August 22.2002

MapDebugInformation: Obtain Debugging Info for an Image
Tap into a DLL to view the exported functions  Jan 15.2000

GetWindowThreadProcessId: Obtain the hWnd of an App Started with Shell()
Use GetWindowThreadProcessId to obtain the handle to an application started with Shell. May 12.1999

FindExecutable: Obtain Exe of the Default Browser
Using FindExecutable and a temporary file to determine the application associated with html files. Oct 13.1999

GetFileVersionInfo: Retrieve MS ODBC Driver Information
Using GetPrivateProfileString and GetFileVersionInfo to retrieve Microsoft-installed ODBC drivers. Oct 19.1999

SQLDataSources: Retrieve ODBC DSN User and System Connections
Using the ODBC API to retrieve User and System DSN Connections on the local machine.  May 1.2001

FormatMessage: How to Translate System Error Code Messages
Using FormatMessage to provide the system and error message strings defined in Windows. Jun 20.1998

InitiateSystemShutdown: Terminating Remote Windows Sessions
How to call shut down remote computers (and cancel the shutdown if needed).  Dec 08.2004

DeviceIoControl: Obtain Physical Drive Information
Retrieve low-level physical disk information on NT/2000.  Jan 8.2000

Win32_Process: WMI Enables Process Monitoring
Executing a WMI SQL statement to create a local machine or remote machine process monitor to track the opening and closing of a specific exe. April 25.2005



Terminal Services
vb6
vb5
vb4-32
WTSQuerySessionInformation: Obtaining the Name of a Computer running a Remote Desktop Session
Retrieve low-level physical disk information on NT/2000.  Sept 10.2008


Toolhelp
vb6
vb5
vb4-32
CreateToolhelp32Snapshot: List Running Processes
Using the Toolhelp APIs of Win95, this code creates a list box of the currently running processes. Mar 3.1997

CreateToolhelp32Snapshot: Enumerate to Determine an App's Parent Process
Enumerating a CreateToolhelp32Snapshot process list to determine the name of the application responsible for starting the current app. Nov 4.2002



Version Info
vb6
vb5
vb4-32
DllGetVersion: Basic Internet Explorer Version Info
API code to retrieve the current version of Internet Explorer. Nov 27.1999

DllGetVersion: Detailed Internet Explorer Version Info
Update to the original DllGetVersion: Basic Internet Explorer Version Info covering IE versions 3.x through 6.x. Apr 16.2002

GetFileVersionInfo: Retrieve MS ODBC Driver Information
Using GetPrivateProfileString and GetFileVersionInfo to retrieve Microsoft-installed ODBC drivers. Oct 19.1999



Windows
vb6
vb5
EnumWindows: Enumerate Windows via a Callback
Another Enum API, this one enumerating system windows using AddressOf. Jun 17.1998

EnumChildWindows: Enumeration of Parent and Child Windows via Callbacks
Using EnumWindows and EnumChildWindows. Jan 26.2000

GetLastInputInfo: Determining System Idle Time
Code showing how to determine how long the system has been idle. Dec 9.2005

GetVersionEx: Windows Version, Service Pack and Platform Info
Retrieve operating system info with GetVersionEx. Aug 14.1999

GetVersionEx: Windows Version Info (Wrapper Routines) FREQUENTLY UPDATED!
A set of version wrapper functions that return True if the OS matches the desired type. Now identifies Win95-Win2003 Server, Longhorn Server, and Vista, as well as various Vista versions and software suites (e.g. BackOffice, Small Business Server etc.). Posted Aug 14.1999  Last updated Apr 15.2008

GetGuiThreadInfo: Active Application GUI Information
How to retrieve GUI status information for the current thread (active window). Jan 5.2003

IsOs: Windows OS and OS Features Info
Determining specific Windows OS versions and OS features without using GetVersionEx Aug 20.2008



Window Class & Title
vb6
vb5
vb4-32
GetWindow: Find Applications of a Specific Class or Window Title
Code to list all active windows containing either the Class name or Window title specified, including only partial names.  Jun 22.1998

FindWindow: Window Title and Class Name Demo
Application to list all windows containing either the Class name or Window title specified, including only partial names. Includes code to activate windows, adjust the list box display, and uses the FindWindowLike routine with a window handle array. Jun 22.1998



 

 
 

PayPal Link
Make payments with PayPal - it's fast, free and secure!

 
 
 
 

Copyright 1996-2011 VBnet and Randy Birch. All Rights Reserved.
Terms of Use  |  Your Privacy

 

Hit Counter