Back to 10/96 How To: Power Windows
Up to Table of Contents
Ahead to 10/96 How To: Programming Windows

10/96 How To: Power Windows

Inside Swap Monitor

Constant declarations and Declare statements used by the Swap Monitor.



Global Const HKEY_DYN_DATA = &H80000006
Global Const KEY_QUERY_VALUE = &H1
Global Const ERROR_SUCCESS = 0&
Declare Function RegOpenKeyEx Lib "advapi32.dll"
Alias "RegOpenKeyExA" (ByVal hkey As Long, ByVal
lpSubKey As String, ByVal ulOptions As Long, ByVal
samDesired As Long, phkResult As Long) As Long
Declare Function RegQueryValueEx Lib "advapi32.dll"
Alias "RegQueryValueExA" (ByVal hkey As Long, ByVallpValueName As String, ByVal lpReserved As Long, lp-Type As Long, lpData As Any, lpcbData As Long) As Long
Declare Function RegCloseKey Lib "advapi32.dll" (By Val hkey As Long) As Long

The number of swap file reads (Page-Ins) since Windows loaded


Dim hkey As Long
Dim lData As Long
Dim lType As Long
Dim lResult As Long
lResult = RegOpenKeyEx(HKEY_DYN_DATA,
"PerfStats\StatData", 0, KEY_QUERY_VALUE, hkey)
If lResult = ERROR_SUCCESS Then
lResult = RegQueryValueEx(hkey, "VMM\cPageIns", 0&,
lType, lData, 4&)
End If
lResult = RegCloseKey(hkey)

Back to 10/96 How To: Power Windows
Up to Table of Contents
Ahead to 10/96 How To: Programming Windows