Tip Bank

DevX - Software Development Resource

GetServicesInfo – Enumerate Windows NT services

Option ExplicitPrivate Type SERVICE_STATUS ‘ 28 bytes dwServiceType As Long dwCurrentState As Long dwControlsAccepted As Long dwWin32ExitCode As Long dwServiceSpecificExitCode As Long dwCheckPoint As Long dwWaitHint As LongEnd TypePrivate Type

DevX - Software Development Resource

KillProcess – Terminate any application

Private Type LUID lowpart As Long highpart As LongEnd TypePrivate Type TOKEN_PRIVILEGES PrivilegeCount As Long LuidUDT As LUID Attributes As LongEnd TypeConst TOKEN_ADJUST_PRIVILEGES = &H20Const TOKEN_QUERY = &H8Const SE_PRIVILEGE_ENABLED =

DevX - Software Development Resource

LogOffUser – Shut down the current user session

Const EWX_LOGOFF = 0Const EWX_FORCE = 4Private Declare Function ExitWindowsEx Lib “user32” (ByVal dwOptions As Long, _ ByVal dwReserved As Long) As Long’ close all applications and log off the

DevX - Software Development Resource

Make a phone call using TAPI

If TAPI libraries are installed on your machine, you can easily dial a number from a VB application using a single API call. Here’s a function that encapsulates the call

DevX - Software Development Resource

Avoiding Crashes Due to Multiple Deletes

Many times, a program crashes due to multiple deletes on the same pointer. In some cases, this is due to a programming error that can be removed. There are situations,

DevX - Software Development Resource

Using Memset On Class Objects

It’s common practice in C, to do a memset on structures, in order to initialize all member variables to some default value, usually NULL. Similarly, you can use memset to