Simple WinAPI code problem.
Well I'm new in WinAPI, and can't figure why this does not work.
All I want to do is write a number in the edit box, and press a button to make the number appear in a CTEXT just below it. (and if possible save the number into a variable).
Code:
BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_MYBUTTON:
BOOL Funciono;
int var = GetDlgItemInt(hwnd, IDC_NUMBER, &Funciono, FALSE); //IDC_NUMBER is an EDIT box.
if( Funciono == TRUE )
{
SetDlgItemInt(hwnd, IDC_SHOWVAR, var, "-");//IDC_SHOWVAR is a CTEXT.
}
break;
case IDCANCEL:
EndDialog(hwnd, IDCANCEL);
break;
}
break;
default: return FALSE;
}
return TRUE;
}
Then there is the rest of the window code which has no problems.
The error jumps in the "BOOL" part, thanks for any help.