Postmessage to a ToolbarWindow Control

M

Michi

Hi.

I'm trying to post a wm_command message to a control in a toolbar
(ToolbarWindow32) but don't get it done.

After getting the hanlde of the application I retrieve the handle of
the toolbar:
hwnd = (IntPtr)FindWindow("#1000", appTitle);
hwndChild = FindWindowEx((IntPtr)hwnd, IntPtr.Zero, "ToolbarWindow32",
null);
And then post the message like:
chk = PostMessage((int)hwndChild, WM_COMMAND, 7, 0);
(=> nothing happens in the application and chk is set to 1)
I used Winspector to check out the wParam (Control ID (7)), lParam
(Code (0)), the message (WM_COMMAND) and the toolbars handle. All
those seems to be correct.

Can you please give me a hint, what I'm overlooking?

Many thanks and kind regards.
Michi
 
N

Nicholas Paldino [.NET/C# MVP]

Michi,

Have you hooked the window up to Spy++ (it's a tool included with Visual
Studio, and there are other windows interception tools out there as well)
and checked to see if your window gets the message?
 
M

Michi

Michi,

    Have you hooked the window up to Spy++ (it's a tool included with Visual
Studio, and there are other windows interception tools out there as well)
and checked to see if your window gets the message?

--
          - Nicholas Paldino [.NET/C# MVP]
          - (e-mail address removed)




I'm trying to post a wm_command message  to a control in a toolbar
(ToolbarWindow32) but don't get it done.
After getting the hanlde of the application I retrieve the handle of
the toolbar:
hwnd = (IntPtr)FindWindow("#1000", appTitle);
hwndChild = FindWindowEx((IntPtr)hwnd, IntPtr.Zero, "ToolbarWindow32",
null);
And then post the message like:
chk = PostMessage((int)hwndChild, WM_COMMAND, 7, 0);
(=> nothing happens in the application and chk is set to 1)
I used Winspector to check out the wParam (Control ID (7)), lParam
(Code (0)), the message (WM_COMMAND) and the toolbars handle. All
those seems to be correct.
Can you please give me a hint, what I'm overlooking?
Many thanks and kind regards.
Michi- Zitierten Text ausblenden -

- Zitierten Text anzeigen -

Nicholas,

no I didn't. I use VS Express and can't find spy++ in it. I found it
in msdn (http://msdn2.microsoft.com/en-us/library/aa315486(VS.
60).aspx), but I didn't find a download of it.
 

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