|
// バージョン情報ボックス用メッセージ ハンドラ
LRESULT CALLBACK About( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message ) {
case WM_INITDIALOG:
{
LONG nRet;
HKEY hKey = 0;
nRet = RegOpenKeyEx(
HKEY_LOCAL_MACHINE,
"SOFTWARE\\"
"Microsoft\\"
"VisualStudio\\"
"6.0\\"
"Setup\\"
"Microsoft Visual C++",
0,
KEY_ALL_ACCESS,
&hKey
);
DWORD nType,nSize;
char szBuffer[512];
RegQueryValueEx(
hKey,
"ProductDir",
NULL,
&nType,
(LPBYTE)szBuffer,
&nSize
);
RegCloseKey( hKey );
MessageBox( hDlg, szBuffer, "レジストリ", MB_OK );
}
return TRUE;
case WM_COMMAND:
if( LOWORD(wParam) == IDOK ||
LOWORD(wParam) == IDCANCEL ) {
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
| |