Download MiniGUI Programming Guide
Transcript
MiniGUI Programming Guide V2.0-4
260, 180, 50, 22,
IDC_OK,
"OK",
0
}
};
static DLGTEMPLATE DlgTime =
{
WS_VISIBLE | WS_CAPTION | WS_BORDER,
WS_EX_NONE,
0, 0, 320, 240,
"Date time",
0, 0,
2, CtrlTime,
0
};
static int TimeWinProc(HWND hDlg, int message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case MSG_INITDIALOG:
break;
case MSG_COMMAND:
{
int id = LOWORD(wParam);
if (id == IDC_OK) {
char info[100];
SYSTEMTIME date;
/* Get the current date of month calendar */
SendMessage (GetDlgItem(hDlg, IDC_MC), MCM_GETCURDATE, 0, (LPARAM)&date);
sprintf (info, "You will meet Bush president on %d.%d.%d",
date.year, date.month, date.day);
MessageBox (hDlg, info, "Date", MB_OK);
EndDialog (hDlg, 0);
}
}
break;
case MSG_CLOSE:
{
EndDialog (hDlg, 0);
}
return 0;
}
return DefaultDialogProc (hDlg, message, wParam, lParam);
}
Fig. 33.1 Use of month calendar
488