Results 1 to 4 of 4

Thread: getting Hwnd from an exe name

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    499

    getting Hwnd from an exe name

    if i knew the exe name and it was running, how would i get the Hwnd from it ?

    thanks.

  2. #2
    Junior Member
    Join Date
    Mar 2005
    Location
    Calgary Alberta
    Posts
    17

    Re: getting Hwnd from an exe name

    I need this too. You should check my post periodically too, you might get an answer. If I get an answer I'll post it here for you

  3. #3
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: getting Hwnd from an exe name

    You use the FindWindow and GetWindow API's

    FindWindow
    GetWindow

  4. #4
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: getting Hwnd from an exe name

    I think what you have to do is enumerate all top level windows using
    EnumWindows
    This will give you a handle to each window.
    Now, for each handle you get, call
    GetWindowModuleFilename
    which should return the file name associated with the hWnd.
    take the one that matches your exe name.

Posting Permissions

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



Click Here to Expand Forum to Full Width