Click here to Skip to main content
15,914,014 members
Home / Discussions / C#
   

C#

 
QuestionApplication path Pin
jzb22-Feb-06 14:33
jzb22-Feb-06 14:33 
AnswerRe: Application path Pin
Christian Graus22-Feb-06 15:39
protectorChristian Graus22-Feb-06 15:39 
QuestionUTC Time from a C program Pin
mcljava22-Feb-06 14:21
mcljava22-Feb-06 14:21 
AnswerRe: UTC Time from a C program Pin
Jon Sagara22-Feb-06 15:00
Jon Sagara22-Feb-06 15:00 
GeneralRe: UTC Time from a C program Pin
mcljava22-Feb-06 15:43
mcljava22-Feb-06 15:43 
AnswerRe: UTC Time from a C program Pin
George L. Jackson22-Feb-06 17:32
George L. Jackson22-Feb-06 17:32 
GeneralRe: UTC Time from a C program Pin
mcljava23-Feb-06 7:44
mcljava23-Feb-06 7:44 
QuestionClick Click Pin
IceWater4222-Feb-06 13:42
IceWater4222-Feb-06 13:42 
I have succeeded in getting my code to successfully do mouse clicks on a commercial program, running at a specific screen location, using this code:

SetForegroundWindow(targetWindowHandle);

input.type = INPUT_MOUSE;
input.mi.dx = 900;
input.mi.dy = 50;
input.mi.mouseData = 0;
input.mi.time = 0;
input.mi.dwFlags = 0;
input.mi.dwExtraInfo = 0;

SetCursorPos(input.mi.dx, input.mi.dy);

input.mi.dwFlags = (MOUSEEVENTF_ABSOLUTE+MOUSEEVENTF_LEFTDOWN);
resSendInput = SendInput(1, ref input, Marshal.SizeOf(input));
input.mi.dwFlags = (MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_LEFTUP);
resSendInput = SendInput(1, ref input, Marshal.SizeOf(input));

The problem is, of course, if the window is moved, the clicks miss. I would love to be able to do the clicks relative to position 0,0 of the window pointed at by targetWindowHandle instead of relative to position 0,0 of the screen.

(I hope that statement makes sense to you guys.)

Any suggestions?

Roll eyes | :rolleyes: Thanks. Roll eyes | :rolleyes:



-- modified at 20:11 Wednesday 22nd February, 2006
AnswerRe: Click Click Pin
IceWater4223-Feb-06 9:32
IceWater4223-Feb-06 9:32 
Questionmaking calculator Pin
jessica gelina22-Feb-06 12:22
jessica gelina22-Feb-06 12:22 
AnswerRe: making calculator Pin
Colin Angus Mackay22-Feb-06 12:33
Colin Angus Mackay22-Feb-06 12:33 
General[Message Deleted] Pin
jessica gelina22-Feb-06 13:01
jessica gelina22-Feb-06 13:01 
GeneralRe: making calculator Pin
Colin Angus Mackay22-Feb-06 13:07
Colin Angus Mackay22-Feb-06 13:07 
GeneralRe: making calculator Pin
jessica gelina22-Feb-06 13:11
jessica gelina22-Feb-06 13:11 
GeneralRe: making calculator Pin
Sean8922-Feb-06 14:01
Sean8922-Feb-06 14:01 
GeneralRe: making calculator Pin
jessica gelina22-Feb-06 14:10
jessica gelina22-Feb-06 14:10 
GeneralRe: making calculator Pin
Nish Nishant22-Feb-06 14:36
sitebuilderNish Nishant22-Feb-06 14:36 
GeneralRe: making calculator Pin
jessica gelina22-Feb-06 14:36
jessica gelina22-Feb-06 14:36 
GeneralRe: making calculator Pin
Colin Angus Mackay22-Feb-06 20:46
Colin Angus Mackay22-Feb-06 20:46 
GeneralRe: making calculator Pin
Colin Angus Mackay22-Feb-06 20:43
Colin Angus Mackay22-Feb-06 20:43 
GeneralRe: making calculator Pin
Sean8922-Feb-06 14:58
Sean8922-Feb-06 14:58 
GeneralRe: making calculator Pin
Christian Graus22-Feb-06 15:42
protectorChristian Graus22-Feb-06 15:42 
GeneralRe: making calculator Pin
Sean8923-Feb-06 1:20
Sean8923-Feb-06 1:20 
GeneralRe: making calculator Pin
taediman@naver.com22-Feb-06 18:18
taediman@naver.com22-Feb-06 18:18 
AnswerRe: making calculator Pin
IceWater4222-Feb-06 13:20
IceWater4222-Feb-06 13:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.