FindWindow() issue - Page 3
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 3 of 3 FirstFirst 123
Results 31 to 33 of 33

Thread: FindWindow() issue

  1. #31
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,197

    Re: FindWindow() issue

    Use CreateProcess instead of spawn. Then use hProcess and GetExitCodeProcess api to detect if the process is still running. Check the exit code against STILL_ACTIVE to find out if the process is still running. Another way to check if the process is still running is to call:

    Code:
     
    BOOL bRunning = ( WaitForSingleObject( hProcess, 0 ) == WAIT_TIMEOUT );

  2. #32
    Join Date
    Oct 2009
    Location
    Holland
    Posts
    198

    Re: FindWindow() issue

    To Arjay,

    works fine now !!
    but
    just to be curious;
    why createprocess iso spwan?

    regards,

    ger

  3. #33
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,197

    Re: FindWindow() issue

    CreateProcess has more startup features and returns the process id, the thread and process handles, and much more. CreateProcess also works for ANSI and UNICODE.

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center