-
November 4th, 2010, 09:40 AM
#1
SendMessage to AfxMessageBox
Hi!
I'm trying to send a message to an AfxMessageBox. I want to simulate an <OK> button press.
The reason is, that we are using a scanner to scan an <OK> barcode instead of pressing the <OK> button itself.
HWND hWnd = ::FindWindowEx(NULL, NULL, _T("#32770"), _T("MyMessageBox"));
if (hWnd)
{
::SendMessage(hWnd, MyMessage, (WPARAM)0, (LPARAM)0);
}
This works when the AfxMessageBox is an MB_OK type and MyMessage is WM_CLOSE.
If the type is MB_YESNO or others, this does not work. If the messages are others than WM_CLOSE, this does not work.
I would like to be able to simulate a <YES> button press og <NO> button press for a MB_YESNO MessageBox type.
Any idears ?
/Jakob
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|