- what i'm trying to actually do: implement search algo (already did it), from a secondary DlgProc (separate dialog, of course), then display the result as a MARKED/SELECTED TEXT in the ascii buffer of the rich edit control using EM_EXSETSEL (this should 'select the defined text, right?)...
- what actually happens: if result is found, the secondary dlgProc closes the dlg, storing the found result's RVA (it's GlobalAlloc'd buff) in a global dword... after that the MAIN dlg proc call the calculation of parameters and actually sending the msg (posted just below is this proc...)...
- result of SendMessageTimeout: returns TRUE (it worked?!), GetLastError: (ERROR_ACCESS_DENIED)... and there's no text actually being selected in the richedit == it actually didn't worked...
- yeah, this is my first meeting with RICHEDIT controls' coding, i'm not really into sophisticated gui stuff usually...
P.S.: yep, i've tryed to load the structure (wParam of msg) with RVA's, tried it with OFFSET's too... nothing happens in both occasions... any ideas, guys?!
MarkFoundString PROC rvaFound:DWORD
LOCAL dwTemp:DWORD
LOCAL rChar:CHARRANGE
invoke szLen, addr srchString
mov edx, txtAddr
mov ecx, rvaFound
sub ecx, edx ; getting offsets...
mov rChar.cpMin, ecx
add eax, ecx
mov rChar.cpMax, eax
invoke SendMessageTimeout, hTxt, EM_EXSETSEL, 0, addr rChar, SMTO_NORMAL, 30*1000, addr dwTemp
ret
MarkFoundString ENDP