   I need help understanding WH_JOURNALPLAYBACK
  Hi everyone, i'll do my best to explain the problem. So far i've been able to implement some code using the WH_JOURNALRECORD hook, so i started coding the WH_JOURNALPLAYBACK one, but there is something i don't understand, and the code here is a good example but dont explain my problem. What i dont get is how the hook know when it's start to stop, do i have to call UnhookWindowEx() inside the case HC_SKIP statement if im done with it?Also, this hook take control over the keyboard and mouse while it is running, so i guess i can't really use a button in the application to stop it... The problem is, my code will try to find back the windows handle that the user clicked/pressed a key on, but what if he cant find it again? How do i "bail out"???To help you understand better, here's my code (in pseudo-code):LRESULT CALLBACK JournalPlaybackProc(int nCode, WPARAM wParam, LPARAM lParam){switch(nCode){case HC_GETNEXT: // Playback the current next messageEVENTMSG *pEventMsg = (EVENTMSG*)lParam;Write the saved data back in the EventMsg struct  exept for the pEventMsg->hWnd one...// Since the playback will be played when the user want, // the windows handle of the EVENTMSG is not longer valid,// so i need to find them again using some code that   // look like this:Start looping    if we find the window    Exit the loopelse    Sleep 100 ms    Try finding it again by starting the loop again Loop End Save the windows handle and process the message // That 2 lines of code above in bold are nice, but what if i   // never can find the window, how do i stop the loop  // then if i don't have any way to tell this code i want  // it to stop... Should i simply unhook the hook instead and  // warn the user that the operation have failed??? case HC_SKIP:   Prepare for the next msg to duplicate  // Not sure if this is good thing to do...  If we processed all of the messages, stop the hook default:return CallNextHookEx(hPlaybackHook, nCode, wParam, lParam);}// System ignores this. Just to satisfy the compiler.return 0;}