Results 1 to 4 of 4

Thread: How to get the HWND and HINSTANCE in OUTLOOK

  1. #1

    Thread Starter
    Addicted Member Buy2easy.com's Avatar
    Join Date
    Jul 2002
    Posts
    200

    How to get the HWND and HINSTANCE in OUTLOOK

    How do you get the hwnd property for a window and the hinstance property for a window in outlook i need it so that i can open a save file dialog box. thanks for the help!

    it is application.hwnd and application.hinstance in excel but i need it in outlook.

    thanks

  2. #2

    Thread Starter
    Addicted Member Buy2easy.com's Avatar
    Join Date
    Jul 2002
    Posts
    200

    In case anyone else needs to know how

    Just incase there is someone else later that has this need here is how I got it done:

    First declare the following function:

    Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal ClassName As String, ByVal Title As String) As Long

    Next:

    Look at the title bar of the window you wants handle and place it in the spot that says "Title" . In the place that it says "ClassName" put the string "rctrl_renwnd32"

    Last:

    Declare a long to get the functions return value and that return value is the handle.

  3. #3
    New Member
    Join Date
    May 2008
    Posts
    2

    Re: How to get the HWND and HINSTANCE in OUTLOOK

    Hi, I'm working on a outlook add-in project and I need show some cursomer form made by VB, as I know when VB show the form, the form can accept a owner as the form.show function parameter.
    And now I can get the HWND of outlook window, but when I use the hwnd as the owner parameter of form.show function, it shows that type dismatch.
    How can I use the hwnd as a form's owner? Or how can I make the outlook window as the form's owner, so the form will show in the front of outlook window?
    I'm working with outlook 2000/2003 and VB6 SP6.
    Thank you.

  4. #4
    New Member
    Join Date
    May 2008
    Posts
    2

    Re: How to get the HWND and HINSTANCE in OUTLOOK

    Hi, I'm working on a outlook add-in project and I need show some cursomer form made by VB, as I know when VB show the form, the form can accept a owner as the form.show function parameter.
    And now I can get the HWND of outlook window, but when I use the hwnd as the owner parameter of form.show function, it shows that type dismatch.
    How can I use the hwnd as a form's owner? Or how can I make the outlook window as the form's owner, so the form will show in the front of outlook window?
    I'm working with outlook 2000/2003 and VB6 SP6.
    Thank you.

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