Does anyone know why ChRng CHARRANGE <> StatusBarProc PROC hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM .IF uMsg == WM_COMMAND .IF wParam == BN_CLICKED invoke SendMessage, hWndEdit, EM_EXGETSEL, 0, ADDR ChRng would not work? From what I've seen by debugging, it seems to be a context related issue. Sending this message in some parts of the program works while in other parts it doesn't. Would it have anything to do with the procedure in which it is used? One place where it does work is under a menu item, like such: .ELSEIF eax == IDM_EDIT_INVTEXT invoke SendMessage, hWndEdit, EM_EXGETSEL, 0, ADDR ChRng Any help is appreciated!
By the way, I'm using RichEdit v.3, if that helps in any way.
Try making the CHARRANGE structure LOCAL to the procedure. LOCAL cr:CHARRANGE This may solve the problem for you. Regards, firstname.lastname@example.org
wParam contains both a notification code (BN_CLICKED) and a control ID (upper 16-bits). If you have set the button's ID to something other than zero, wParam will not equal BN_CLICKED when the button is clicked.