金牌会员
- 积分
- 1553
- 金钱
- 1553
- 注册时间
- 2016-11-21
- 在线时间
- 411 小时
|
1金钱
#include "DIALOG.h"
#define ID_FRAMEWIN_0 (GUI_ID_USER + 0x02)
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ FRAMEWIN_CreateIndirect, "test", ID_FRAMEWIN_0, 0, 0, 320, 240, 0, 0x0, 0 },
};
char over=0;
static void _cbDialog(WM_MESSAGE * pMsg) {
switch (pMsg->MsgId) {
case WM_NOTIFY_PARENT:
if(pMsg->Data.v==WM_NOTIFICATION_RELEASED)
{
int Id=WM_GetId(pMsg->hWinSrc);
if(Id==GUI_ID_CLOSE)
{
over=1;
}
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
void Createtest(void) {
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
FRAMEWIN_AddCloseButton(hWin,0,0);
while(1)
{
if(over==1)
{
over=0;
break;
}
GUI_Exec();
}
}
程序就是上面写的那样,添加的CloseButton在回调函数中无法获取键值,函数一值在while(1)中循环,点击了CloseButton后界面关闭了但是不会退出循环。
|
|