I am stuck.
Why cant i switch the EditBoxes with this code?

THY
Posted on 2004-10-04 11:20:34 by Rooky
Rooky
EditBox proc hParent:DWORD

invoke CreateWindowEx,WS_EX_CLIENTEDGE,ADDR EditClass,NULL,
WS_CHILD OR WS_VISIBLE OR WS_BORDER AND WS_TABSTOP,
; ~~~
; i think need 'OR'
30,edi,250,25,hParent,ebx,
hInstance,NULL
ret
EditBox endp
Posted on 2004-10-04 19:27:09 by P2M
WS_CHILD OR WS_VISIBLE OR WS_BORDER AND WS_TABSTOP,
; ~~~
; i think need 'OR'

This solution dosn`t work. No matter what i take:

AND
OR
+

The problem comes with the Images i load after putting the editboxes in.
they shouldn be tabable but they are.
Posted on 2004-10-05 03:17:53 by Rooky
Rooky,

You'll need to exclude the WS_TABSTOP value.

I am not familair enough with MASM and its high level AND/OR, etc stuff but basically you'll need something like this:

example in C:


DWORD Style = WS_CHILD | WS_VISIBLE | WS_BORDER;
Style &= ~WS_TABSTOP;

~ = NOT value.
[/code[

example in ASM:
[code]
mov eax, WS_CHILD
or eax, WS_VISIBLE
or eax, WS_BORDER
mov ecx, WS_TABSTOP
not ecx
and eax, ecx
[/code]

Hope this helps you.

Relvinian
Posted on 2004-10-05 03:40:59 by Relvinian
Wasting your clocks



style equ WS_CHILD or WS_VISIBLE or WS_BORDER
mov eax, NOT style


If I remember correctly. Too long never use masm
Posted on 2004-10-05 06:37:43 by roticv
I don't get it, if you just want to create a window without WS_TABSTOP, just don't use it... :?:

EditBox proc hParent:DWORD 

invoke CreateWindowEx,WS_EX_CLIENTEDGE,ADDR EditClass,NULL,
WS_CHILD OR WS_VISIBLE OR WS_BORDER,
30,edi,250,25,hParent,ebx,
hInstance,NULL
ret
EditBox endp


But if you want the boxes to have tabstops, you do need WS_TABSTOP. This is accomplished using the OR operator. + might work as well, but it's a bad idea for some other style equates (like WS_POPUPWINDOW), try to avoid it in general. The AND operator simply won't work to add styles! Take a look at the style equates definitions and the descriptions for each bitwise operator in the reference manual, you'll see why.

Also your parent window must be a dialog box (or at least you have to process it's messages in the main loop as if it was one, using the IsDialogMessage API).

Hope that helps. :)
Posted on 2004-10-05 11:12:17 by QvasiModo
Wasting your clocks



style equ WS_CHILD or WS_VISIBLE or WS_BORDER
mov eax, NOT style


If I remember correctly. Too long never use masm

No, I think that will set *every* bit in EAX except for WS_CHILD, WS_VISIBLE and WS_BORDER.

Suppose you have some unknown style bits in EAX, you want to set WS_CHILD, WS_VISIBLE and WS_BORDER, and clear WS_TABSTOP. This code would do:
or eax,WS_CHILD, WS_VISIBLE or WS_BORDER

and eax,not WS_TABSTOP

Think that the bitwise operators actually modify bits in a number, they have litle to do with their "logical" meaning.
Posted on 2004-10-05 11:21:36 by QvasiModo
Rooky
Posted on 2004-10-05 21:21:56 by P2M