Results 1 to 5 of 5

Thread: Get Hwnd by filename?

  1. #1

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391

    Get Hwnd by filename?

    Is there a set of API's I can use where I can specify the name of the executable (say "C:\Program Files\MyApp.exe"), and retrieve handles to a window of that app?
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  2. #2

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391
    Maybe I should better explain what I'm looking for.

    The program C:\MyApp.exe is going to be running, but hidden with a icon in the systray.

    I want my other program to be able to signal to the running instance of MyApp.exe that it should show itself.

    Is there a way to do this when I only know the path to the file?

    I know FindExecutable returns a handle to a file but I don't know if that's useful..
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  3. #3
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  4. #4

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391
    Right, but what can I do with that handle that's returned?
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  5. #5
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    Try this:

    VB Code:
    1. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    2.  
    3. Private Const SW_SHOWNORMAL = 1
    4.  
    5. 'usage
    6. ShowWindow HandleOfFile&, SW_SHOWNORMAL
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

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