最近接触emWin,按照示例在仿真里面跑了一个代码,但是我发现,在按键弹起时,WM_HideWindow函数得到了执行,但是page0并没有隐藏,请问是为什么,我在start.c中将句柄赋值了给page[0]。
调用WM_HideWindow的地方
case ID_BUTTON_0: // Notifications sent by 'Button'
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)
WM_HideWindow(page[0]);
WM_ShowWindow(page[1]);
WM_SetFocus(WM_GetDialogItem(page[1],ID_BUTTON_0));
// USER END
break;
start.c的内容
#include "dialog.h"
//#inclde "APP3/page.h"
WM_HWIN page[4];
void MainTask(void)
{
GUI_Init(); //初始化emWin/ucGUI
page[0] = CreateFramewin0(WM_HBKWIN); //创建窗体,父窗体是桌面背景
page[1] = CreateFramewin1(WM_HBKWIN);
WM_HideWindow(page[1]);
WM_SetFocus(page[0]);
while(1) {GUI_Delay(20);} //调用GUI_Delay函数延时20MS(最终目的是调用GUI_Exec()函数)
}