mrDuke, найти окно и отправить ему сообщение WM_COMMAND при помощи
::PostMessage
Syntax
BOOL PostMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
Parameters
hWnd
[in] Handle to the window whose window procedure is to receive the message. The following values have special meanings.
HWND_BROADCAST
The message is posted to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows.
NULL
The function behaves like a call to PostThreadMessage with the dwThreadId parameter set to the identifier of the current thread.
Msg
[in] Specifies the message to be posted.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
формат сообщения
WM_COMMAND
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The high-order word specifies the notification code if the message is from a control. If the message is from an accelerator, this value is 1. If the message is from a menu, this value is zero.
The low-order word specifies the identifier of the menu item, control, or accelerator.
lParam
Handle to the control sending the message if the message is from a control. Otherwise, this parameter is NULL.
(описание сишное, правда , но смысл тот же)