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