Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0: // 按钮按下后,跳到子窗口 CreateLED
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
CreateLED();
break;
}
break;
下面是子窗口的部分代码:
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0: // Notifications sent by 'Button'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
LED0=0;
LED1=0;
break;
case WM_NOTIFICATION_RELEASED:
break;
}
break;
case ID_BUTTON_1: // Notifications sent by 'Button'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
LED0=0;
LED1=1;
break;
}
break;
case ID_BUTTON_2: // Notifications sent by 'Button'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
LED0=1;
LED1=0;
break;
case WM_NOTIFICATION_RELEASED:
break;
}
break;
case ID_BUTTON_3: // Notifications sent by 'Button'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
CreateDianji();
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
WM_HWIN CreateLED(void) {
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
return hWin;
}