I put a combo and edit on a dialog. I populized the combo with "Left" , "Center" and "Right" and I tried to use SetWindowLong to change alignment.... but it ain't working. I can't see what I'm doing wrong.....

push eax
invoke GetWindowLong, eax, GWL_STYLE
and eax, 0FFFFFFFCh
push eax
invoke SendMessage, lParam, CB_GETCURSEL, 0, 0
pop edx
pop ecx
or edx, eax
invoke SetWindowLong, ecx, GWL_STYLE, edx
Posted on 2004-03-20 12:08:29 by Milos
Hi Milos,

Some styles require that you use SetWindowPos with the SWP_FRAMECHANGED flag before they take effect. I have not tried it with this particular one but it is worth a try...

invoke SetWindowPos, [hwnd], 0, 0, 0, 0, 0, \

Posted on 2004-03-20 13:16:44 by donkey
Nope.... it didn't have any effect.
Does anybody have any sample showing how to do this? I am sure its simple but I'm missing something.
Posted on 2004-03-20 18:57:33 by Milos
Some time ago in a galaxy far away I was asking the same question. I didn't want to go to RichEdit, just wanted simple Edit to do that.
Summarizing: the best suggestion I got (and could think of myself) was this:
"keep 3 edit controls, each initially with the respective alignment, save text into all of them, and show (ShowWindow) the one that corresponds to the alignment you currently need."
After that I decided to use RichEdit. I still don't regret using it.
Posted on 2004-03-20 20:36:35 by SolidCode