Hi,
I am syncing the saving of my application data with the file saving of the plug-in my com dll is plugged into. I have successfully hooked File,save and Ctrl-S. There is one final saving scenario that I would like to cover.
When the application's data file is changed and the user closes the application with File Close or the Red X, then the application pops up a MessageBox with the familiar, "Save changes to filename?"
I can see when the MessageBox pops up using the code in a WH_CBT hookproc below.
if(nCode == HCBT_ACTIVATE)
{
char WindowString[40];
GetWindowText((HWND)wParam,WindowString,40);
if(!strcmp(WindowString,"The Application's Name"))
{
HWND txtLabel = GetDlgItem((HWND)wParam,0xffff);
GetWindowText(txtLabel,WindowString,16);
if(!strcmp(WindowString,"Save changes to"))
}
}
}
Now when the user clicks Yes, a WM_NOTIFY is sent out with the ID but I can's seem to trap
that message in any hook type tried thus far. And googling around, I find myself in a sea of MessageBox modification threads.
Is catching the Yes button push possible? Must be if Spy++ can do it.
Thanks
:Ron