January 20, 2001

GetDisplaySettings – Retrieve information about available display modes

Const DM_BITSPERPEL As Long = &H40000Const DM_PELSWIDTH As Long = &H80000Const DM_PELSHEIGHT As Long = &H100000Const CCDEVICENAME As Long = 32Const CCFORMNAME As Long = 32Private Type DEVMODE dmDeviceName As String * CCDEVICENAME dmSpecVersion As Integer dmDriverVersion As Integer dmSize As Integer dmDriverExtra As Integer dmFields As Long dmOrientation As

GetPowerInfo – Retrieve current settings for Power-off and Low-Power features

Private Declare Function SystemParametersInfo Lib “user32” Alias _ “SystemParametersInfoA” (ByVal uAction As Long, ByVal uParam As Long, _ ByRef lpvParam As Any, ByVal fuWinIni As Long) As LongConst SPI_GETLOWPOWERTIMEOUT = 79Const SPI_GETPOWEROFFTIMEOUT = 80Const SPI_GETLOWPOWERACTIVE = 83Const SPI_GETPOWEROFFACTIVE = 84′ retreive current settings of Power-off and low-power features’ for the

SetPowerInfo – Change settings for Power-off and Low-Power features

Private Declare Function SystemParametersInfo Lib “user32” Alias _ “SystemParametersInfoA” (ByVal uAction As Long, ByVal uParam As Long, _ ByRef lpvParam As Any, ByVal fuWinIni As Long) As LongConst SPI_SETLOWPOWERTIMEOUT = 81Const SPI_SETPOWEROFFTIMEOUT = 82Const SPI_SETLOWPOWERACTIVE = 85Const SPI_SETPOWEROFFACTIVE = 86′ set new settings of Power-off and low-power features’ for the

NetworkUserName – The user name used to establish a network connection

Private Declare Function WNetGetUser Lib “mpr.dll” Alias “WNetGetUserA” (ByVal _ lpszLocalName As String, ByVal lpszUserName As String, _ lpcchBuffer As Long) As Long’ return the current default user name or’ the user name used to establish a connectionFunction NetworkUserName() As String Dim buffer As String buffer = Space$(256) ‘ if

ChangeScreenResolution – Change the current screen resolution

Option ExplicitConst DM_BITSPERPEL As Long = &H40000Const DM_PELSWIDTH As Long = &H80000Const DM_PELSHEIGHT As Long = &H100000Const CDS_FORCE As Long = &H80000000Const CCDEVICENAME As Long = 32Const CCFORMNAME As Long = 32Private Type DEVMODE dmDeviceName As String * CCDEVICENAME dmSpecVersion As Integer dmDriverVersion As Integer dmSize As Integer dmDriverExtra As

GetPDCName – The name of the Primary Domain Controller

Private Declare Function NetGetDCName Lib “netapi32.dll” (strServerName As Any, _ strDomainName As Any, pBuffer As Long) As LongPrivate Declare Function NetApiBufferFree Lib “netapi32.dll” (buffer As Any) As _ LongPrivate Declare Sub CopyMemory Lib “kernel32” Alias “RtlMoveMemory” (dest As _ Any, source As Any, ByVal bytes As Long)’ Return the name