Click here to Skip to main content
15,888,984 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ask one question in VC .NET Pin
Pierre,Hsieh7-Jan-06 14:14
Pierre,Hsieh7-Jan-06 14:14 
GeneralRe: ask one question in VC .NET Pin
PJ Arends7-Jan-06 14:44
professionalPJ Arends7-Jan-06 14:44 
GeneralRe: ask one question in VC .NET Pin
Pierre,Hsieh7-Jan-06 15:03
Pierre,Hsieh7-Jan-06 15:03 
QuestionRe: ask one question in VC .NET Pin
David Crow7-Jan-06 17:15
David Crow7-Jan-06 17:15 
QuestionSimulating mouse clicks Pin
Still learning how to code7-Jan-06 11:46
Still learning how to code7-Jan-06 11:46 
AnswerRe: Simulating mouse clicks Pin
vipinasda7-Jan-06 12:04
vipinasda7-Jan-06 12:04 
GeneralRe: Simulating mouse clicks Pin
Still learning how to code7-Jan-06 21:15
Still learning how to code7-Jan-06 21:15 
AnswerRe: Simulating mouse clicks Pin
#realJSOP8-Jan-06 3:00
mve#realJSOP8-Jan-06 3:00 
Assuming you can get the process handle (if your app launched the other app with ::CreateProcess(), for instance), after posting the mouseclick message, try using ::WaitForInputIdle(processHandle, timetowait) like so:

bool bIdle = false;
DWORD dwWaitResult;
// wait for five seconds
dwWaitResult = ::WaitForInputIdle(hProcess, 5000);

switch (dwWaitResult)
{
    case 0 :
        {
            // success!
            bIdle = true;
        }
        break;
    case WAIT_TIMEOUT :
        {
            AfxMessageBox("Timed out waiting for idle state.");
        }
        break;
    case WAIT_FAILED :
        {
            // use ::GetLastError() to find error
        }
        break;
}


------- sig starts

"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt

"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001



-- modified at 9:00 Sunday 8th January, 2006
GeneralRe: Simulating mouse clicks Pin
Still learning how to code8-Jan-06 5:41
Still learning how to code8-Jan-06 5:41 
AnswerRe: Simulating mouse clicks Pin
Stephen Hewitt9-Jan-06 11:47
Stephen Hewitt9-Jan-06 11:47 
Question[Message Deleted] Pin
S.C.Wong7-Jan-06 6:08
S.C.Wong7-Jan-06 6:08 
AnswerRe: How to add an ActiveX control in another ActiveX control? Pin
Prakash Nadar7-Jan-06 18:05
Prakash Nadar7-Jan-06 18:05 
Questionhow to pass a class ,object to a function by using pointers? Pin
neodeaths7-Jan-06 4:32
neodeaths7-Jan-06 4:32 
AnswerRe: how to pass a class ,object to a function by using pointers? Pin
Prakash Nadar7-Jan-06 4:46
Prakash Nadar7-Jan-06 4:46 
GeneralRe: how to pass a class ,object to a function by using pointers? Pin
neodeaths7-Jan-06 4:56
neodeaths7-Jan-06 4:56 
GeneralRe: how to pass a class ,object to a function by using pointers? Pin
Prakash Nadar7-Jan-06 5:09
Prakash Nadar7-Jan-06 5:09 
GeneralRe: how to pass a class ,object to a function by using pointers? Pin
neodeaths7-Jan-06 5:14
neodeaths7-Jan-06 5:14 
GeneralRe: how to pass a class ,object to a function by using pointers? Pin
Kevin McFarlane7-Jan-06 5:14
Kevin McFarlane7-Jan-06 5:14 
GeneralRe: how to pass a class ,object to a function by using pointers? Pin
Prakash Nadar7-Jan-06 5:17
Prakash Nadar7-Jan-06 5:17 
GeneralAny One Care To Explain Why My Messages are Voted Down? Pin
Prakash Nadar7-Jan-06 21:17
Prakash Nadar7-Jan-06 21:17 
GeneralRe: Any One Care To Explain Why My Messages are Voted Down? Pin
#realJSOP8-Jan-06 3:05
mve#realJSOP8-Jan-06 3:05 
GeneralRe: Any One Care To Explain Why My Messages are Voted Down? Pin
Trollslayer8-Jan-06 3:50
mentorTrollslayer8-Jan-06 3:50 
GeneralRe: Any One Care To Explain Why My Messages are Voted Down? Pin
Prakash Nadar8-Jan-06 4:15
Prakash Nadar8-Jan-06 4:15 
GeneralRe: Any One Care To Explain Why My Messages are Voted Down? Pin
#realJSOP8-Jan-06 7:13
mve#realJSOP8-Jan-06 7:13 
GeneralRe: Any One Care To Explain Why My Messages are Voted Down? Pin
ThatsAlok9-Jan-06 17:30
ThatsAlok9-Jan-06 17:30 

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.