Thread: Retrieving the handle of shellexecute

  1. #1
    Registered User
    Join Date
    Oct 2004

    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.


  2. #2
    Join Date
    Jan 2002
    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
    New York
    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.

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, 11:22 PM
  5. retrieving a parent HWND handle
    By bennyandthejets in forum Windows Programming
    Replies: 2
    Last Post: 11-22-2002, 07:33 AM