CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2004
    Posts
    391

    Handle to an application

    CreateWindow function requires an application handle in it's hWndParent paramter. How can i opbtain this handle using some API call?

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Handle to an application

    What kind of application?

    Take a look at AfxGetInstanceHandle().
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Aug 2004
    Posts
    391

    Re: Handle to an application

    It's not an MFC app, it's a borland app.

  4. #4
    Join Date
    Feb 2005
    Posts
    58

    Re: Handle to an application

    The hWndParent parameter should be the handle to the Parent window of the window. If the window has no parent you can enter HWND_DESKTOP.

  5. #5
    Join Date
    Aug 2004
    Posts
    391

    Re: Handle to an application

    thanks, but I will still like to know if their is a way to get a handle to you application for whatever purpose.

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Handle to an application

    Do you mean the HINSTANCE of your program?
    It is a parameter of you winmain function. Just save it to a global variable or somewhere else.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

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

Featured