T
Trollpower
Dear NG,
ive got a small C# Application which needs to send a mousedown event,
followed by a mouseup event to a foreign window (eg. browser window).
I managed to get the appropriate windowhandle and also putting it into
the foreground. But sending a message with "buttondown" allways shows
no effect. I dont get any error-messages, since i put the whole code
into a try-catch-clause.
I use the following code to send a mousedown-message to the window:
uint WM_LBUTTONDOWN = 0x0201;
SetForegroundWindow((int)windowHandle);
SendMessage(windowHandle, WM_LBUTTONDOWN, 0, 0);
The "windowHandle"-variable is valid and "SetForegroundWindow" show
effect. i also tried PostMessage instead of Sendmessage, but the
effect stays the same: nothing happens.
Background:
The target window shows a small game, which needs a mouseclick to be
started. The window shows up but the sendmessage wont let the game
start.
Any ideas on how to bring the sendmessage to work?
Thanks in advance
Jens
ive got a small C# Application which needs to send a mousedown event,
followed by a mouseup event to a foreign window (eg. browser window).
I managed to get the appropriate windowhandle and also putting it into
the foreground. But sending a message with "buttondown" allways shows
no effect. I dont get any error-messages, since i put the whole code
into a try-catch-clause.
I use the following code to send a mousedown-message to the window:
uint WM_LBUTTONDOWN = 0x0201;
SetForegroundWindow((int)windowHandle);
SendMessage(windowHandle, WM_LBUTTONDOWN, 0, 0);
The "windowHandle"-variable is valid and "SetForegroundWindow" show
effect. i also tried PostMessage instead of Sendmessage, but the
effect stays the same: nothing happens.
Background:
The target window shows a small game, which needs a mouseclick to be
started. The window shows up but the sendmessage wont let the game
start.
Any ideas on how to bring the sendmessage to work?
Thanks in advance
Jens