Guy
Guy

Reputation: 1332

Programmatically opening Tools Menu of F12 Internet Explorer Developer tools Using PostMessage and ALT+T

I'm trying to programmatically open the pull-down menu, "Tools", of the F12 Developer Tools Of an instance of Internet Explorer by using a series of calls to the function PostMessage simulating the action (ALT+T) as described below.

I have the handle of the IE instance and it's children windows. I'm using this code to simulate ALT+T which does the intended work on similar windows.

PostMessage(hDevTools, WM_SYSKEYDOWN, VK_MENU, 0x20380001);
PostMessage(hDevTools, WM_SYSKEYDOWN, 'T'    , 0x20000001);
PostMessage(hDevTools, WM_SYSCHAR   , 'T'    , 0x20000001);
PostMessage(hDevTools, WM_SYSKEYUP  , 'T'    , 0xE0000001);
PostMessage(hDevTools, WM_SYSKEYUP  , VK_MENU, 0xC0380001);

My problem is that I don't know what handle should I post these messages to.
I used Microsoft Spy++ to find the handle of IE Dev Tools window and it's children and I've tried PostMessaging to most of them, but no luck. the Tools menu is not opening.

I should add that (for test purposes) I have PostMessaged these combinations to the document window of the Internet Explorer and the Tools Menu of the main window of IE was opened.

Upvotes: 3

Views: 635

Answers (1)

Guy
Guy

Reputation: 1332

I found the window handle. It's a window with class name 'ToolbarWindow32' which is a child of another window with class name'IEDEVTOOLSMENU'.

Sending the above PostMessages to this window solves my problem.

Upvotes: 1

Related Questions