1)MsgId表示是什么消息,比如emWin的固定消息:WM_INIT_DIALOG(创建窗体时通知我们需要设置控件哪些参数)、WM_PAINT(通知我们窗体刷新绘制完毕)、WM_NOTIFY_PARENT(通知我们有控件被点击)等等…,当然还可以是我们自己起名的消息: message.MsgId =WM_MSGUSER; WM_SendMessage(hWin,&message); 2) hWin是目标窗口句柄...
区分开消息后再做相应的处理,假如消息是WM_NOTIFY_PARENT通知父窗口的消息,那就要判断消息来自哪里(WM_GetId()) 消息“始作俑者”是根据控件id来判断的所以先调用函数WM_GetId(pMsg->hWinSrc)将源消息句柄转换成ID再区分,不同的控件会有通知代码,看手册每个控件的通知即可,根据发生的动作点击、释放等可...
本例子创建的三个对话框可以正常的切换就靠函GUI_Delay的执行,当然,周期性的调用函数WM_Exec或者GUI_...
SLIDER_SetValue( WM_GetDialogItem(hWin, GUI_ID_SLIDER1),50);break;caseWM_KEY:switch(((WM_KEY_INFO*)(pMsg->Data.p))->Key) {caseGUI_ID_ESCAPE: GUI_EndDialog(hWin,1);break;caseGUI_ID_ENTER: GUI_EndDialog(hWin,0);break; }break;caseWM_NOTIFY_PARENT: Id= WM_GetId(pMsg->hWinSrc...
case WM_NOTIFY_PARENT:Id = WM_GetId(pMsg->hWinSrc);NCode = pMsg->Data.v;switch(Id){ c...
caseWM_KEY: switch(((WM_KEY_INFO*)(pMsg->Data.p))->Key) { caseGUI_KEY_ESCAPE: ; break; caseGUI_KEY_ENTER: GUI_EndDialog(hDlg,0); break; } break; caseWM_NOTIFY_PARENT: Id =WM_GetId(pMsg->hWinSrc); // Id of widget NCode= pMsg->Data.v; // Notification code switch(NCode...
代码语言:javascript 复制 _cbDialogHome(WM_MESSAGE*pMsg){Switch(pMsg->MsgId){CaseWM_INIT_DIALOG:WM_CreateTimer(pMsg->hWin,0,100,0);//创建窗口定时器CaseWM_PAINT://窗口重绘CaseWM_NOTIFY_PARENT://按键消息处理 Id=WM_GetId(pMsg->hWinSrc);//哪个按键NCode=pMsg->Data.v;//是点击还是松开Switch...
WM_GetDialogItem(hDlg, GUI_ID_USER + 12); break; caseWM_NOTIFY_PARENT: Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */ NCode =pMsg->Data.v; /* Notification code */ switch(NCode) { caseWM_NOTIFICATION_CLICKED: //---(8) Pressed = 1; caseWM_NOTIFICATION_RELEASED: //---...
caseWM_NOTIFY_PARENT: if(pMsg->Data.v == WM_NOTIFICATION_RELEASED) { int Id= WM_GetId(pMsg->hWinSrc); // Id of widget if (Id== GUI_ID_CLOSE) { if(_LockClose) { return; } _hFrame = 0; } } break; } if(_pcbOldFrame) { (*_pcbOldFrame)(pMsg); }} /*** _cbBkWindow*...
switch(((WM_KEY_INFO*)(pMsg->Data.p))->Key) { caseGUI_ID_ESCAPE: GUI_EndDialog(hWin,1); break; caseGUI_ID_ENTER: GUI_EndDialog(hWin,0); break; } break; caseWM_NOTIFY_PARENT: Id= WM_GetId(pMsg->hWinSrc); /* Id of widget */ NCode= pMsg->Data.v; /* Notificationcode *...