https://bugs.winehq.org/show_bug.cgi?id=51899
--- Comment #20 from Bruni earns.61@gmail.com --- (In reply to O. Nykyforchyn from comment #19)
Created attachment 70885 [details] Screenshot of Collins Dictionary
I compiled Wine with the latter patch, and logs show that all handles pass through get_dc_attr() for EDTWIN.EXE. Is this the required goal or am I miss something?
Selected text is unreadable indeed.
BTW, Can EM_GETSEL be broken here by posting an incorrect selection position? Can Wine just cut a 'hole' in the background, instead of applying a style for selected text?
According to "Programming Windows" by Charles Petzold, sending an edit control an EM_GETSEL message returns an integer containing this information:
LRESULT iSelect = SendMessage (hwndEdit, EM_GETSEL, 0, 0);
The low word of iSelect is the position of the first selected character; the high word of iSelect is the position of the character following the selection. If these two words are equal, no text has been selected.
Maybe, it's worthwhile to trace those positions inside the message loop for the control like this?
LRESULT iSelect = SendMessage (hwndEdit, EM_GETSEL, 0, 0); if (HIWORD(iSelect) != LOWORD(iSelect)) { TRACE("Start position of the selected text %x\n", LOWORD(iSelect)); TRACE("End position of the selected text %x\n", HIWORD(iSelect)); }
I don't know how to insert these lines in dlls/user.exe16/message.c without infinite recursion in SendMessage, though.