If I use this:
.IF dx==EN_SETFOCUS ;un Edit de hWndIDEN a recu le focus
;idEditCtrl = (int) LOWORD(wParam); // identifier of edit control
;wNotifyCode = HIWORD(wParam); // notification code
;hwndEditCtrl = (HWND) lParam; // handle of edit control
invoke SendMessage,lParam,EM_SETSEL,0,-1

I select the text when I put the focus with TAB key ,but not with a click of mouse?
Posted on 2002-07-07 12:56:49 by franlou

Essayes de poster ta question en fran?ais, comme ?a t'aurais des r?ponse des gens qui comprennent le fran?ais.

et pr?cises bien la question..?

Posted on 2002-07-07 18:22:13 by Sabeel
franlou, there is no need to highlight manually, as Windows automatically highlights all text when you go through the child controls using the Tab key.

Sabeel, il n'y a pas beaucoup des gens ici qui comprennent le francais.
Posted on 2002-07-07 18:44:36 by comrade
to comrade
but I wish highlight the text when I get the focus with The cursor by clicking on the textbox

to sabeel j'aimerai bien ?crire en francais mais je crois que c'est pas bien vu ici?

j'essaye pour reprendre la question pr?c?dente:
je voudrai en clickant dans une editbox mettre en surbrillance le texte de celle-ci;aussi j'ai utilis? le code pr?cit?;mais ca ne marche pas;ca marche que si je voyage d'une editbox ? l'autre avec la touche TAB

merci:tongue: :grin:
Posted on 2002-07-08 01:41:29 by franlou
if u want to highlight all the text when the editbox gain focus, u should send it the EM_SETSEL message, with lParam = 0
and wParam = -1.
Posted on 2002-07-08 18:15:45 by Sabeel
He already does that, Sabeel, but he needs to do same on mouse click.
Posted on 2002-07-08 23:20:40 by comrade
The problem, as I see it, is that your code does work. But when Windows manually processes the mouse-click, it automatically changes the selection your code made. One crude selection I can think of is to SetTimer on a mouse-click for about 10ms, and on that timer create the selection and immediatly KillTimer afterwards.
Posted on 2002-07-08 23:23:10 by comrade
    [*]Subclass the edit control
    [*]Handle the WM_LBUTTONDOWN message (Left Mouse Button) / WM_RBUTTONDOWN(Right Mouse Button)
    [*]During this message use your EM_SETSEL combo (0, -1)
Posted on 2002-07-08 23:57:52 by stryker
Should be better than my solution, if it would work.
Posted on 2002-07-09 00:00:37 by comrade
I tried it and it works. Get ICZ tut #20 add this line at the EditWndProc procedure
    .elseif uMsg==WM_KEYDOWN

mov eax,wParam
.if al==VK_RETURN
invoke MessageBox,hEdit,addr Message,addr AppName,MB_OK+MB_ICONINFORMATION
invoke SetFocus,hEdit
invoke CallWindowProc,OldWndProc,hEdit,uMsg,wParam,lParam
[color=#3366FF] .elseif uMsg==WM_RBUTTONDOWN
invoke SendMessage, hEdit, EM_SETSEL, 0, -1
.elseif uMsg==WM_LBUTTONDOWN
invoke SendMessage, hEdit, EM_SETSEL, 0, -1[/color]
invoke CallWindowProc,OldWndProc,hEdit,uMsg,wParam,lParam
Posted on 2002-07-09 00:06:06 by stryker
I'm essaying it
Posted on 2002-07-09 06:08:13 by franlou