Retrieving the handle of shellexecute

This is a discussion on Retrieving the handle of shellexecute within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, Is there a simple way that I can retrieve the handle of a newly executed application that was ...

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    100

    Retrieving the handle of shellexecute

    Hi all,

    Is there a simple way that I can retrieve the handle of a newly executed application that was launched with ShellExecute. Although ShellExecute returns a HINSTANCE it isnt a real HINSTANCE just an int value.

    Thanks

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Moved to windows.

    In future, please post your windows specific questions to the Window Programming board.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Do you mean a process handle? With shellexecute, you could do it in a very hackish way looking for the window name to retrieve an hwnd and then enumerate windows until you find an hwnd that matches, and with shellexecuteex, you can do it in a little less hackish way by enumerating windows and comparing with the process id filled in the SHELLEXECUTEINFO structure. This thread has some example code.

    Close IE programmatically

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting other processes class names
    By Hawkin in forum Windows Programming
    Replies: 3
    Last Post: 03-20-2008, 04:02 PM
  2. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 03:36 AM
  3. retrieving filename from handle
    By Lionel in forum Windows Programming
    Replies: 12
    Last Post: 09-08-2005, 01:36 PM
  4. Retrieving handle to child scrollbar
    By rottinglich in forum Windows Programming
    Replies: 5
    Last Post: 11-03-2004, 10:22 PM
  5. retrieving a parent HWND handle
    By bennyandthejets in forum Windows Programming
    Replies: 2
    Last Post: 11-22-2002, 06:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21