Autor Beitrag
joelrodrigues
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 20



BeitragVerfasst: Sa 30.12.06 14:31 
(entschuldigen, aber meine deutshe ist nicht sehr gut).

Hi fols,

I am developing an application that captures Keyboard keys pressed and mouse actions and display them on the screen ... For this, i have two hooks (WM_KEYBOARD and WM_MOUSE), each one in its own DLL.

When i click on a button, it activates both HOOKS in this way:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.btStartClick(Sender: TObject);
begin
MouseHook.Start_MouseHook;
KeyHook.Start_KeyHook;
end;


The problem is that the BOTH hooks don´t work simultaneously... I mean, as the MouseHook is the 1st to begin, the KeyHook doesn´t start (in other words, just the MouseHook works, the other remains inactive).

I need both works simultaneously so, if i use the mouse, the MouseHook works; if i press a key, the KeyHook works (both displaying their results at the same time on the screen).

What´s wrong here?

Any help will be appreciated!

JOEL SILVA

Moderiert von user profile iconAXMD: Delphi-Tags hinzugefügt
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 30.12.06 15:48 
How do the implementations of MouseHook and KeyHook look like? Without knowing anything about the code describing them it is not possible for us to help you with your problem ;)

AXMD
joelrodrigues Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 20



BeitragVerfasst: Sa 30.12.06 16:06 
Hi AXMD,

I just solved the problem...
I didn´t set up different message WindowHandle (just 1) and the application didn´t know if a user pressed a key or a mouse button (for example). After i create another WindowHandle just for the key (the other just for the mouse), the appication is working fine.

Thanks for your attention.