Hi @All
I work on a tool this have many Check boxes and options
But Gives for it a better sulotion?
.const
IDC_Option1 equ 1001
IDC_Option2 equ 1002
...
..
.
.data
szOptionString db "Option1",0
szOptionString2 db "Option2",0
...
..
.
Option1 dd offset szOptionString ,IDC_Option1 ,TRUE,0
Option2 dd offset szOptionString2 ,IDC_Option2 ,TRUE,0
...
..
.
MyProcs \
dd offset Option1
dd offset Option2
...
..
.
.code
lea esi,MyProcs
Greets,
You may be able to create a macro that simplifies the declaration ... or you simply use a Dialog that is build with a Resource editor.
For creation..
IDC_Option1 equ 1001
.const
optStr1 db "Arm",0
optStr2 db "Leg",0
...
optStrs dd OFFSET optStr1, OFFSET optStr2, ..., 0
.code
mov esi,OFFSET optStrs
mov ebx,IDC_Option1
@@:
mov eax,[esi]
test eax,eax
jz @F
;create your checkbox -- szLabel=eax, ID=ebx, ..something for position?
add esi,4
inc ebx
jmp @B
@@:
;...etc...
Checking their states can be done in a similar way.
Quote from: qWord on October 21, 2012, 08:22:03 AM
You may be able to create a macro that simplifies the declaration
Here is one, just for fun...
include \masm32\include\masm32rt.inc
include SetArray.inc ; attached
.data?
TheArray dd 100 dup(?)
.code
txStrings db "File", 0
db "New", 0
db "Open", 0
db "Save", 0
db "Save As", 0
db 0
start:
mov esi, offset TheArray
; also valid: SetArray TheArray, txStrings
SetArray esi, txStrings
xor ebx, ebx
.While 1
lodsd
.Break .if !eax
push eax
print "#"
inc ebx
print str$(ebx), 9
pop eax
print eax, 13, 10
.Endw
inkey
exit
end start
Hi thanks to all
very nice tips
I have figured out a other solution like TBBUTTON struct
OptionStruct Struct
pszText DWORD ?
idCommand DWORD ?
lParam DWORD ?
OptionStruct ends
pOption Option <offset szOption1,IDC_CHECKBOX1,offset Option1>
Option <offset szOption2,IDC_CHECKBOX2,offset Option2>
nbrOfPatches equ ($-offset pOption) / size OptionStruct
lea esi,pOption
And works very nice