Sure, thanks for the help man... I don't know how else to search for this problem on the internet... no solution.
Here it goes:
Code:
HWND hwnd; //I've done this because if not it'd say hwnd is not declared.
VOID MoveVar(void)
{
BOOL MGood = FALSE;
int var = 0;
var = GetDlgItemInt(hwnd, IDC_NUMBER, &MGood, TRUE);
if(MGood == TRUE)
{SetDlgItemInt(hwnd, IDC_SHOWVAR, var, TRUE);
MessageBox(hwnd, "This msgbox doesn't popup...", "...", MB_OK);
}
MessageBox(hwnd, "This msgbox does popup...", "...", MB_OK);
}
BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
EndDialog(hwnd, IDOK);
break;
case IDC_METAL:
MoveVar(); //due to the 2nd msgbox I know the button is working.
break;
case IDC_NUMBER:
break;
case IDCANCEL:
EndDialog(hwnd, IDCANCEL);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}