[mw_shl_code=c,true]问题是这样:预想是在桌面窗口的回调函数中处理按键消息,ZERO键实现一个窗口的创建,ALARM实现窗口的删除。实际效果是能够创建窗口,但无法删除(具体现象是桌面窗口没有重绘,创建的窗口依旧存在)。[/mw_shl_code]
[mw_shl_code=c,true]为证明程序没有卡死,加入了LED指示按键后的响应状态,ZERO创建窗口,同时电亮LED,ALARM删除窗口并熄灭LED,实际效果是,LED出现点亮并熄灭,但创建的窗口依旧是删除后依旧存在。[/mw_shl_code]
[mw_shl_code=c,true]代码如下[/mw_shl_code]
[mw_shl_code=c,true]请各位大神指点迷境!万谢![/mw_shl_code]
[mw_shl_code=c,true]static void WinHandler(WM_MESSAGE * pMsg) {
switch (pMsg->MsgId) {
case WM_PAINT: //
GUI_SetBkColor(GUI_BLACK); /* Automacally update desktop window */
GUI_Clear();
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24B_ASCII);
GUI_DispStringAt("WM Test",400,200);
break;
case WM_NOTIFY_PARENT: //????×??°???±?á?¨?????°?????¨????LED?¤?÷ ?©
break;
case WM_KEY:
switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key) {
case KEY_MESSAGE_ZERO :
LED0_On();
hProgbar = PROGBAR_Create(100,40,100,20,WM_CF_SHOW);
break;
case KEY_MESSAGE_ALARM :
PROGBAR_Delete(hProgbar);
LED0_Off();
break;[/mw_shl_code]
|