Thanks Ken, unfortuneately it's not working, i think the interger always becomes zero, and if i use the third parameter, it reveals that the function has failed.
I'm not sure what i'm doing wrong here.
I have created an edit box, then deactivated it:
Code:
temp5 = CreateWindowEx(WS_EX_CLIENTEDGE, //more or 'extended' styles
TEXT("EDIT"), //'class' of control to create
NULL, //the control caption
WS_CHILD|WS_VISIBLE|WS_BORDER, //control style: how it looks
90, //control position: left
190, //control position: top
25, //control width
25, //control height
hWnd, //parent window handle
HMENU(105), //control's ID
hInst, //application instance
NULL);
EnableWindow(temp5, FALSE);
Then i have a check box that when clicked activates the edit box (this seems to work fine; when i check the box the edit box goes "ungrey", when i remove the check it greys up again);
I have this code:
Code:
id1 = GetDlgCtrlID (temp5);
word3=GetDlgItemInt(temp5,id1,point,0);
if (test == false)
MessageBox( NULL,
TEXT("Didn't Work"),
TEXT("ERROR"),
MB_OK|MB_ICONERROR);
Word3 is a static int, and point is a static int* pointing at test.
When i run the program word3 is always 0 (atleast it seems to be always zero) and i always get the message box coming saying that the function has failed.
Any suggestions?
Edit: I've managed to get it working, i went back to using GetWindowText() then used atoi() to convert the char array into an integer, though I'm still curious as to why when i used GetDlgCtrlID () it didn't work.