PDA

Click to See Complete Forum and Search --> : How to get the HWND and HINSTANCE in OUTLOOK


Buy2easy.com
Jan 7th, 2004, 07:47 AM
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

Buy2easy.com
Jan 9th, 2004, 07:29 AM
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.

skylu
May 8th, 2008, 03:52 AM
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.

skylu
May 8th, 2008, 08:41 PM
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.