PDA

View Full Version : Checkboxes



ganglyman21
02-29-2008, 12:12 PM
Ok so driving me insane, does anyone know how to make it when u check a check box it activates a timer and when it's unchecked it kills the timer? Any help is much appreciated.

ganglyman21
03-03-2008, 02:10 PM
To anyone who cares?



int StateOn;
int StateOff;
CButton* pCheck = (CButton*)GetDlgItem(IDC_CHECK5);

StateOn = pCheck->GetCheck(), 1;

StateOff = pCheck->GetCheck(), 0;

Thats as far as Ive got. Haven't tested in a hack yet. But will after I found some food!

EDIT//


int NAME;

CButton* pCheck = (CButton*)GetDlgItem(IDC_CHECKBOX);

NAME = pCheck->GetCheck(), 1;


if (NAME)
SetTimer(TIMERNAME, 1, NULL);
else
KillTimer(TIMERNAME);


How did I do? Need to add a member variable also. I tested this out, might be an easier way but I did this myself so there you go. It works!

ppl2pass
07-02-2008, 01:32 PM
do i have to add this for every checkbox? or only once? and where do i place this.


int StateOn;
int StateOff;
CButton* pCheck = (CButton*)GetDlgItem(IDC_CHECK5);

StateOn = pCheck->GetCheck(), 1;

StateOff = pCheck->GetCheck(), 0;


also where do i place this?

int NAME;

CButton* pCheck = (CButton*)GetDlgItem(IDC_CHECKBOX);

NAME = pCheck->GetCheck(), 1;


if (NAME)
SetTimer(TIMERNAME, 1, NULL);
else
KillTimer(TIMERNAME);

thank you.

ganglyman21
07-02-2008, 01:47 PM
Id need to find an old source and I dont have my mem stick here at the minute to see. Will elt u know when I find it. Can't remember how far I got.