API WaitForSingleObject

A program to detect changes in the current registry, making reference to a basic example of msdn.
 
This really sounds like a simple problem solving designed in the long lines raises questions be brought.
 
if (WaitForSingleObject (hEvent, INFINITE) == WAIT_FAILED)
{
_tprintf (TEXT ( ". Error in WaitForSingleObject (% d) \ n"), GetLastError ());
return;
}
 
else _tprintf (TEXT ( ". \ nChange detected \ n")); // I want to make a part of the event takes over the values ​​from the mains.
It laid _tprintf to express the actual main part of trying to take over the MessageBox output value else.
 
//winmain.cpp
// This part is trying to pass a value.
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND hWndButton;
switch (message) {/ * handle all Windows messages * /
case WM_COMMAND: {
if (((HWND) lParam) && (HIWORD (wParam) == BN_CLICKED)) {
int iMID;
iMID = LOWORD (wParam);
switch (iMID) {
 
case ID_40002: {
MessageBox (hWnd, TEXT ( "Options"), TEXT ( ""), MB_OK | MB_ICONEXCLAMATION);
break;
}
case ID_40003: {
MessageBox (hWnd, TEXT ( "information"), TEXT ( ""), MB_OK | MB_ICONEXCLAMATION);
break;
}
case IDBUTTON: {
RegNotifyChange ();
 
break;
}
case ID_40001: {
PostQuitMessage (0);
break;
}
default:
break;
}
}
break;
 
}
 
Come to consult other sources declare the structure seems to take over the value at the address
I do not know any way to know the very lack of skills ...
 
Topic archived. No new replies allowed.