The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: 5k3l3t0r on January 21, 2007, 05:46:08 PM

Title: compare buffer content with text
Post by: 5k3l3t0r on January 21, 2007, 05:46:08 PM
hi all again...
i'm new in asm code, and sometimes i stop in litle things (for me big things...lol)
i use SetDlgitemText to change the text in button every time i click (Alternate between 1 and 0)
and wath i need is wen i click, if text = 1 make one action and if = 0 other...

i think my prob is seting the buffer for the getdlgitemtext...

can someone give me an example or a link with specific tut...

tkx bye

5k3l3t0r

Title: Re: compare buffer content with text
Post by: TNick on January 21, 2007, 06:00:04 PM
Simple solution
A var in .DATA section
SomeVar    DWORD    0

when a click arrives:
.IF  SomeVar==0
  mov  SomeVar, 1
;do wonderful things
.ELSE
  mov SomeVar, 0
; do some other wonderful things
.ENDIF

I would say that this is way faster than getting the text...

Regards,
Nick
Title: Re: compare buffer content with text
Post by: 5k3l3t0r on January 21, 2007, 06:29:39 PM
hi again TNick...

cose i'm too new in asm i make some confusion with Vars

can you give me a simple exemple?
the text in the buttons are:  show task and hide task, if you want i can send the source, this is a simple prog
just to training asm and have some fun...

bye

5k3l3t0r
Title: Re: compare buffer content with text
Post by: Tedd on January 22, 2007, 12:26:55 PM
He did give you code..


.DATA
SomeVar    DWORD    0


.CODE
    .
    .
;when the button is pressed (BN_CLICKED)..

.IF  SomeVar==0
    mov  SomeVar, 1
    ;do wonderful things
.ELSE
    mov SomeVar, 0
    ;do some other wonderful things
.ENDIF