可以的,小窗口是按关闭按钮后弹出的;
static void _cbFrame(WM_MESSAGE * pMsg) {//Framewin的回调函数
static FRAMEWIN_Handle hFramewin;
switch (pMsg->MsgId) {
case WM_NOTIFY_PARENT://来自子窗口的notify
if (pMsg->Data.v == WM_NOTIFICATION_RELEASED) {//widget的Notification codes存储在Date.v中;判断子窗口(控件)是否释放
int Id = WM_GetId(pMsg->hWinSrc); //得到源控件ID(子窗口ID)
if (Id == GUI_ID_CLOSE) {//判断控件是否要关闭framewin(这里是指“关闭按钮”)
if(!hFramewin){
hFramewin=FRAMEWIN_CreateEx(50,30,100,50,pMsg->hWin,WM_CF_SHOW,0,0,"", 0);
}
return;//防止执行旧回调函数(系统函数),否则系统函数会把窗口关闭
}
}
break;
}
if (_pcbOldFrame) {//该指针为framewin的旧回调函数指针
(*_pcbOldFrame)(pMsg);//执行旧回调函数(系统函数)
}
} |