Results 1 to 4 of 4

Thread: Does a VB class have a window handle?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Jefferson State
    Posts
    3

    Question Does a VB class have a window handle?

    Is a VB class a Window? The first parameter of the API function SHGetFolderPath() is:
    hwndOwner
    (A handle to the window calling the function, which will own any dialog boxes the function may create. )

    Issue 1: I don't see what dialog boxes this call could create.
    Issue 2: I don't know what to use as the hwndOwner when calling this function from a module or class.

    It seems to work if I send the Long '1'. Is this safe?
    Last edited by andwise; Jun 26th, 2001 at 03:53 PM.

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    As hwndowner use
    frmName.hWnd
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Jefferson State
    Posts
    3
    I know how to get the hWnd from a Form. But what do I do if I'm not using any Forms? Is there a window handle associated with class or standard modules?

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    A class does not have a hWnd. I would suggest to pass 0, and not 1.

    From MSDN:

    hwndOwner
    Handle to an owner window. This parameter is typically set to NULL. If it is not NULL, and a dial-up connection needs to be made to access the folder, a UI prompt will appear in this window.

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