Detecting clicks in the Outlook Explorer region

Add-in Express™ Support Service
That's what is more important than anything else

Detecting clicks in the Outlook Explorer region
 
mitchell balsam




Posts: 8
Joined: 2017-01-27
We are building a tool that hides the FolderView control in Outlook. We need to support a use case where, the user is viewing the standard FolderView of the inbox, then clicks the button that obscures the standard FolderView with our control. Now the user clicks on the Inbox folder again in the Explore. We need to be told that the inbox folder was clicked so we can hide our FolderView Replacement.

Problem is, you only get the FolderSwitch or BeforeFolderSwitch events only one time. Meaning, once the inbox folder is displayed, you will not get a second event even if you click on the inbox folder again, and again.

So where looking for any technique that will provide us a callback when anything in the Explorer is clicked.

One approach would be to hook the Window and wait for events for that window in the Explorer region. But, unlike other parts of the outlook application the Folder, MapiFolders etc are not derived Win32 Window and therefore we cant get the Hwnd. No Hwnd no way to call SetWinEventHook to wait for a callback..

Any suggestions would be appreciated.
Posted 24 Nov, 2017 18:59:18 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Mitchell,

You can use WindowFromPoint (https://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx). When you have a click in that window, you can use Automation to find the folder being clicked.


Andrei Smolin
Add-in Express Team Leader
Posted 27 Nov, 2017 09:39:51 Top