Microsoft のサイトで
「Windows 95 でパフォーマンス レジストリにアクセスする方法」というページを見つけたので、
AB でやってみることにしたのですが、
コード: 全て選択
void main (void)
}
ここは「sub main()」とするのか、
それとも他のところに書くのかがわかりません。
とれはどちらにすれば良いのでしょうか?
コード: 全て選択
void main (void)
}
コード: 全て選択
'#include <windows.h>
'#include <stdio.h>
#console
Const DIFFFLAGLEN = 6
Const PERFENUMKEY = "System\\CurrentControlSet\\Control\\PerfStats\\Enum"
Dim szCounter [MAX_PATH] As Char
Dim szObject [MAX_PATH] As Char
Dim szName [MAX_PATH] As Char
Dim lpszDescBuff = NULL As LPSTR
Dim szDiffFlag [DIFFFLAGLEN] As Char ' "TRUE" または "FALSE" が入ります。
Sub main ()
Dim rc As DWord
Dim dwIndex1 As DWord, dwIndex2 As DWord
Dim dwType As DWord
Dim dwBufSize As DWord
Dim hKey As HKEY
Dim hObject As HKEY
Dim hCounter As HKEY
rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE,PERFENUMKEY, 0, KEY_READ,VarPtr(hKey))
if rc = ERROR_SUCCESS then
dwBufSize = MAX_PATH
dwIndex1 = 0
' オブジェクトを列挙します。
while RegEnumKeyEx(hKey, dwIndex1, szObject,VarPtr(dwBufSize), NULL, NULL, NULL, NULL) = ERROR_SUCCESS
dwIndex1++
if ((rc=RegOpenKeyEx(hKey, szObject, 0, KEY_READ, VarPtr(hObject)))= ERROR_SUCCESS) then
' hObject を使ってオープン キーの情報を処理します。
End If
RegCloseKey(hObject)
dwBufSize = MAX_PATH
Wend
RegCloseKey (hKey)
else
Print "Error ";MakeStr(rc);" opening ";MakeStr(PERFENUMKEY)
End If
End Sub