Close Find/Replace Dialog programmatically

235 Views Asked by At

How do I close the Windows Find and Replace dialog boxes programmatically ensuring the FINDMSGSTRING message is sent so I can get the settings to save them? DestroyWindow does not send the message.

1

There are 1 best solutions below

0
On BEST ANSWER

FindText() and ReplaceText() both return an HWND for the dialog. If you want to close that HWND yourself programmably, send it a WM_CLOSE message. That is the same message the dialog receives if the user dismisses the dialog. It will destroy itself after closing, but this gives it the opportunity to send the final FINDMSGSTRING message to you.