I have registered FINDMSGSTRINGW but it doesn't show on the main loop:
#include <windows.h>
#include <iostream>
int main() {
using namespace std;
UINT uFindReplaceMsg = RegisterWindowMessageW(FINDMSGSTRINGW);
WCHAR szFindWhat[MAX_PATH] = {0}; // buffer receiving string
FINDREPLACEW fr;
ZeroMemory(&fr, sizeof(fr));
fr.lStructSize = sizeof(fr);
fr.hwndOwner = GetConsoleWindow();
fr.lpstrFindWhat = szFindWhat;
fr.wFindWhatLen = MAX_PATH;
fr.Flags = 0;
HWND hdlg = FindTextW(&fr);
MSG msg;
for (;;) {
GetMessageW(&msg, 0, 0, 0);
TranslateMessage(&msg);
if (msg.message == uFindReplaceMsg) {
cout << "uFindReplaceMsg detected" << endl;
}
DispatchMessageW(&msg);
}
}
Clicking "find next" on the dialog should produce messages in console but nothing is happening.