alright, im using Radasm to code this...
i made a dialog with the res editor that comes with radasm, i put a button onto this dialog and i was wondering if there is code that i can initiate at the startup of my program that will disable this button... i know i can just disable it through the res editor, but would that really be the same? i just need to know how to make it so i can enable/disable it without having to use the resource editor..

thanks
Posted on 2003-07-27 21:16:56 by sTonER_DeVIOUS
use EnableWindow,hWnd,FALSE
Posted on 2003-07-27 21:40:46 by devilsclaw
if someone is smart enough they can hook the api and enable it so this should not be your only form of protection on the button.
Posted on 2003-07-27 21:41:50 by devilsclaw
i dont have my win32asm reference on this computer so im going to ask this question
EnableWindow,hWnd,FALSE

how would i use that to make my button be disabled? .. and also how would i call my button with that to make it enabled? sorry..for the bother :rolleyes:
Posted on 2003-07-27 21:48:25 by sTonER_DeVIOUS
uhm,

invoke EnableWindow,hButton,FALSE

Can't say much more than that. Put it in your WM_INITDIALOG handler, get the handle of the button using GetDlgItem and pass it to the call. to enable your button use

invoke EnableWindow,hButton,TRUE
Posted on 2003-07-27 22:00:45 by donkey
hWnd is the handle of the button... you will have to look at the id of the button in the resource editor or just edit the rc file with not pad...


FALSE means Dissabled TRUE means enable

you will have to have another button run the EnableWindow to re-enable it.
Posted on 2003-07-27 22:03:04 by devilsclaw
alright thank you both for your replies, and ill see how it works and get back at you.. thanks again :)
Posted on 2003-07-27 22:05:28 by sTonER_DeVIOUS
i was reading on how to get the handle of my button... (that would be the "hButton" right?) and hum it didnt make sense to me..

i put this

.if eax==WM_INITDIALOG
invoke EnableWindow,hButton,FALSE

but i dont know how to get the handle... i know you told me, but im still learning so could you please help with that?? thanks a ton
Posted on 2003-07-28 04:17:56 by sTonER_DeVIOUS
Originally posted by donkey
uhm,

invoke EnableWindow,hButton,FALSE

Can't say much more than that. Put it in your WM_INITDIALOG handler, get the handle of the button using GetDlgItem and pass it to the call. to enable your button use

invoke EnableWindow,hButton,TRUE
Posted on 2003-07-28 04:21:22 by donkey
yep thats why i said..
but i dont know how to get the handle... i know you told me, but im still learning so could you please help with that?? thanks a ton


"i know you told me"... i dont know how to setup the getdlgitem, i tried, i just dont get it... and sorry for late reply .. i had to drive 300 miles to go to my gramps funeral
Posted on 2003-07-30 02:24:16 by sTonER_DeVIOUS
My condolences,

invoke GetDlgItem,hDlg,ItemID
mov hItem,eax
Posted on 2003-07-30 02:36:18 by donkey
thank ya!
Posted on 2003-07-30 02:39:09 by sTonER_DeVIOUS