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.
Asked
Active
Viewed 197 times
0
-
What language do you want this? Do you want to do this in C++, vbscript, cscript, javascript, java, c#, C, VB, .NET, etc, etc. Please specify – apollosoftware.org Jun 02 '14 at 14:44
-
1The language doesn't really matter as its using the winapi. – Col_Blimp Jun 02 '14 at 14:46
-
Could you use the Windows Handle to find the Parent Dialog. You could use Window Handle then emulate keystrokes to access the buttons, but it's kind of a convoluted solution. – apollosoftware.org Jun 02 '14 at 14:51
-
How do they get *opened*? Do you have a window handle? Do you control the thread that owns the windows? We need more information. – Cody Gray - on strike Jun 02 '14 at 15:07
-
Ive linked to the functions I use, its the generic windows dialogs created as per the windows instructions but the find/replace unlike conventional dialogs dont seem to have a close function. – Col_Blimp Jun 02 '14 at 15:15
1 Answers
1
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.

Remy Lebeau
- 555,201
- 31
- 458
- 770