完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
(1)void GUI_EndDialog(WM_HWIN hDialog, int r); 函数的形参R的作用是什么,看到有些程序是0,有些是1,不知道这是什么原因?
(2)WM_GetDialogItem()获取对话框句柄必须紧跟(方式1) case WM_INIT_DIALOG:后吗?我测试的时候,发现下面第2种方式获取句柄后无法关闭对话框; 方式1: case WM_INIT_DIALOG: Fwin1 = WM_GetDialogItem(pMsg->hWin, ID_FRAMEWIN_1); hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetText(hItem, ""); break; 方式2: case WM_INIT_DIALOG: hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetText(hItem, ""); Fwin1 = WM_GetDialogItem(pMsg->hWin, ID_FRAMEWIN_1); break; 回调函数如下: static void _cbDialog1(WM_MESSAGE * pMsg) { WM_HWIN hItem; int NCode; int Id; // USER START (Optionally insert additional variables) // USER END WM_HWINFwin1; switch (pMsg->MsgId) { case WM_INIT_DIALOG: Fwin1 = WM_GetDialogItem(pMsg->hWin, ID_FRAMEWIN_1); hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetText(hItem, ""); break; case WM_NOTIFY_PARENT: Id = WM_GetId(pMsg->hWinSrc); NCode = pMsg->Data.v; switch(Id) { case ID_EDIT_0: // Notifications sent by 'Edit' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_VALUE_CHANGED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END } break; case ID_BUTTON_15: // Notifications sent by 'OK' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END GUI_EndDialog(Fwin1,0); break; // USER START (Optionally insert additional code for further notification handling) // USER END } break; // USER START (Optionally insert additional code for further Ids) // USER END } break; // USER START (Optionally insert additional message handling) // USER END default: WM_DefaultProc(pMsg); break; } } |
|
相关推荐
1个回答
|
|
这个参数是专门针对阻塞式窗口说的,非阻塞式窗口忽略这个参数
|
|
|
|
只有小组成员才能发言,加入小组>>
809 浏览 0 评论
1161 浏览 1 评论
2535 浏览 5 评论
2871 浏览 9 评论
移植了freeRTOS到STMf103之后显示没有定义的原因?
2719 浏览 6 评论
keil5中manage run-time environment怎么是灰色,不可以操作吗?
1100浏览 3评论
198浏览 2评论
464浏览 2评论
378浏览 2评论
M0518 PWM的电压输出只有2V左右,没有3.3V是怎么回事?
459浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 05:26 , Processed in 1.108540 second(s), Total 48, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号