Hi,
I am trying to intercept an access violation message from a third party DLL. The purpose is to intercept this message and programmatically post the OK message to destroy its popup window. I am trying to get an example program running which traps for the WM_CLOSE message ID. My callback is never processed when I hit a close button (X on the title bar). Any ideas?
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; // out of memory
if ((panelHandle = LoadPanel (0, "FindErrorMessage.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle);
/* To intercept the WM_CLOSE message with MyCallback */
status = InstallWinMsgCallback (panelHandle, WM_CLOSE, MyCallback, VAL_MODE_INTERCEPT, NULL, &postHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
/* Uninstall the event handler and free associated memory */
RemoveWinMsgCallback (panelHandle, WM_CLOSE);
return 0;
}
int CVICALLBACK MyCallback (int panelHandle, int message, unsigned int* wParam, unsigned int* lParam, void* callbackData) {
//to do items here
MessagePopup ("test 2","test 2");
return 0;
}