   Global mouse hook debug problem...
  Hi, i used hooks before and know how to use them, but i have a problem debuging my new one, it's a normal mouse hook, and i call it just like this:hMouseHook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC)MouseProc, hInstance, 0);So, it's a global hook, but it seem i cant debug the hook code when the message dosen't belong to the application calling the dll, but i know the code is executed because, for example, i call Message beep if the mouse message is a button down message, and it work on every window, but it dosent hit the breakpoint, exept like i said if it's the windows of my application... Any idea?   
  Global hooks are in a DLL so the OS can call them from the context of any process. If you want to debug them in another process, you'll need to use Visual Studio to debug the target process.Alternatively, make liberal use of logging to a file to debug.   ;  Thx for ur reply, but i am debugging the dll into visual studio, remotely executing the .exe, that's why i dont understand why it's only working on the windows of the remote program i have written in Delphi, but anyway, i might just use another kind of hook, WH_JOURNALRECORD.   ;  It sounds to me like you've got an incorrect picture of how DLL hooks work.The DLL gets attached to a process when the hook becomes active. This means that there is effectively a copy of the DLL in memory that the process uses. This copy is distinct from all the other instances of the DLL in other processes. The real situation is fairly complex but that's an effective way to think about it.You cannot actually directly debug a DLL, because DLLs can't run themselves the way EXEs can (strictly speaking). Instead, you debug a process started from an EXE, assuming that the process uses the DLL you want to debug. Therefore, when you debug a process, you will see information only from that process's copy of the DLL. In other words, if you do something like set a breakpoint in the DLL code, that breakpoint will only fire for the process you are debugging.This is why you see the behavior you see. The DLL is running for all processes (because that's what hook DLLs do) - this explains why your MessageBeep works. However, your debugger is only looking at one particular process at a time, which is why only one program seems to trigger your breakpoints etc.   ;  Thx a lot, now i understand why it was doing that...