I am stuck.
Why cant i switch the EditBoxes with this code?
THY
Why cant i switch the EditBoxes with this code?
THY
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
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.
; ~~~
; 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.
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:
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
Wasting your clocks
If I remember correctly. Too long never use masm
style equ WS_CHILD or WS_VISIBLE or WS_BORDER
mov eax, NOT style
If I remember correctly. Too long never use masm
I don't get it, if you just want to create a window without WS_TABSTOP, just don't use it... :?:
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. :)
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. :)
Wasting your clocks
If I remember correctly. Too long never use masm
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.
Rooky