Adding button to reading pane in outlook 2003 using shared addins

V

vidishasharma

Hi,

I am trying to add button in reading pane in outlook 2003 using shared
addins however I am getting no solution to do that. Can somebody
suggest how is it achievable using shared addin

Tom
 
K

Ken Slovak - [MVP - Outlook]

It's not achievable no matter what kind of addin you're writing. You would
need to create a button and find the reading pane using Win32 API calls and
overlay your button "window" over the reading pane, handling click events
also from Win32 API callbacks.
 
V

vidishasharma

Thank you for the quick response. I appreciate

Can you please direct me to some examples how I can invoke these Win32
API calls. I have never worked with Win32 API and therefore some
example as to how to find reading pane using Win32 API calls would be
of great help.
 
A

Andrei Smolin [Add-in Express]

You may look at Add-in Express - a tool for creating Office 2000-2007 COM
add-ins. It allows embedding custom .NET forms into Outlook Explorer,
Inspector, Navigation Pane, To-Do Bar, and Reading Pane windows. See
http://www.add-in-express.com/add-in-net/tour.php?lp=outlook-forms-views-regions.

This feature relies on Win32 API immensely. The instrument used for creating
this feature is Spy++ available in the Visual Studio setup folder.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com
 
K

Ken Slovak - [MVP - Outlook]

I don't know of any canned examples of what you want. As Andrei mentioned
you can use Spy++ to see what window class and caption are used for the
reading pane and that would be your starting point.

Something like this is really not a trivial thing to code at all, it will
take a lot of study and experimentation or the use of an experienced Win32
API programmer.
 
V

vidishasharma

I don't know of any canned examples of what you want. As Andrei mentioned
you can use Spy++ to see what window class and caption are used for the
reading pane and that would be your starting point.

Something like this is really not a trivial thing to code at all, it will
take a lot of study and experimentation or the use of an experienced Win32
API programmer.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm




Thank you for the quick response. I appreciate
Can you please direct me to some examples how I can invoke these Win32
API calls. I have never worked  with Win32 API and therefore some
example as to how to find reading pane using Win32 API calls would be
of great help.- Hide quoted text -

- Show quoted text -


All this sound quite difficult.....
 
K

Ken Slovak - [MVP - Outlook]

It is difficult. If it was easy you'd see lots of addins doing things like
that.




I don't know of any canned examples of what you want. As Andrei mentioned
you can use Spy++ to see what window class and caption are used for the
reading pane and that would be your starting point.

Something like this is really not a trivial thing to code at all, it will
take a lot of study and experimentation or the use of an experienced Win32
API programmer.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment
Optionshttp://www.slovaktech.com/products.htm


All this sound quite difficult.....
 
V

vidishasharma

As you mentioned

"You would need to create a button and find the reading pane using
Win32 API calls and
overlay your button "window" over the reading pane, handling click
events
also from Win32 API callbacks."

Does that mean I can overlay the button over the reading pane or Do I
have to create all together a new window with a button at the desired
location and then I have to overlay my newly created window over the
reading pane.

Please help
 
K

Ken Slovak - [MVP - Outlook]

I believe you would overlay your button, which would be a window really,
over the reading pane wherever you wanted it to appear. This is all
undocumented stuff and I've never seen anywhere a step by step of what to do
or how, and I've never done it myself, so you're really on your own in this.
 
V

vidishasharma

I have added a win32 api button in reading pane using
_childwindow = CreateWindowEx(WS_EX_LEFT, "BUTTON", "Childwindow",
WS_CHILD | WS_VISIBLE, 750,60, 20, 20,
_windowLike, IntPtr.Zero , IntPtr.Zero,IntPtr.Zero );


I was very much able to do that

now I tried to get the control using following lines of code however
Control b = Control.FromHandle(_childwindow);

however I get the cotrol as null. I read it that "FromHandle only
works for HWNDs that were directly created by a Windows Forms control
or form." If that is true how can I get this button control in my c#.
I want to attach a click event to this control.

Also I want to know how to handle events for windows created using
Win32 APIs in .Net appliaction

I am totally struck Please help.
 
V

vidishasharma

Hi,

I am able to achieve the events for win32 api button I added in my
reading pane of outlook. Now on mouseover on that button I want to
display a .Net windows form at a location just below the win32 button.

I am trying to achieve this by setting the location of windows form
wrt to the cordinates of the win32 api button. I very much get the
correct cordinates of the button however when I try to set those
coordinates for winform I am unable to do that.

On debuging I see that even I try to set the location of winform
still it is taking some default location. I am not getting what wrong
os going here.

Please guide me what wrong I am doing.

Regards.
 
V

vidishasharma

I figured it out

where t.handle is the handle of my window form
_windowHandle is the handle of my outlook.

SetParent(t.Handle, _windowHandle);

did all the charm. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top