Hello, I'm trying to use the Find common dialog, according to the Platform SDK you have to call RegisterWindowMessage to get a message identifier for the FINDMSGSTRING registered message. So,

FINDMSGSTRING db "commdlg_FindReplace",0
FR_MSG dd ?
invoke RegisterWindowMessage,addr FINDMSGSTRING
mov    FR_MSG,eax
Since I get a value (not 0) in FR_MSG, I think this works. Next, you have to initialize the FINDREPLACE structure filling the hwndOwner member with the handle to the window that should receive the messages. I' using the 'Main' window handle. Then call FindText. I get the dialog so this works also. Also the main message loop should call IsDialogMessage to ensure the dialog correctly processes keyboard messages. This works. Now (Finally) for the problem. I should be able to catch the messages sent from the dialog in the main message handler routine. Example,

WndProc proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
.if uMsg == WM_CREATE
  (do stuff)
.elseif uMsg == WM_COMMAND
  (do stuff)
.elseif uMsg == FR_MSG
  (do stuff)
invoke DefWindowProc,hWin,uMsg,wParam,lParam
WndProc endp
I'm getting a compiler error A2070 : invalid instruction operands at the line .elseif uMsg == FR_MSG Can anyone see whats wrong ? Or tell me how you got it to work ?
Posted on 2001-02-13 11:38:00 by anon
the answer is really easy i think: FR_MSG is a variable. you can't compare a variable with another like you did: .elseif uMsg==FR_MSG the solution would be to put mov eax,uMsg before the first .if and the compare eax with FR_MSG
Posted on 2001-02-13 11:45:00 by [SaFc0n]
Thanks , You were right, now it works perfectly :)
Posted on 2001-02-13 12:03:00 by anon