新手上路
- 积分
- 25
- 金钱
- 25
- 注册时间
- 2016-4-19
- 在线时间
- 3 小时
|
发表于 2017-1-22 13:33:20
|
显示全部楼层
void GUI_EndDialog(WM_HWIN hDialog, int r)
{
WM_DIALOG_STATUS* pStatus;
pStatus = GUI_GetDialogStatusPtr(hDialog);
if (pStatus) {
pStatus->ReturnValue = r;
pStatus->Done = 1;
}
WM_DeleteWindow(hDialog);
}
void WM_DeleteWindow (WM_HWIN hWin) {
WM_Obj* pWin;
if (!hWin)
{
return;
}
WM_ASSERT_NOT_IN_PAINT();
WM_LOCK();
if (WM__IsWindow(hWin)) {
pWin = WM_H2P(hWin);
ResetNextDrawWin(); /* Make sure the window will no longer receive drawing messages */
/* Make sure that focus is set to an existing window */
if (WM__hWinFocus == hWin) {
WM__hWinFocus = 0;
}
if (WM__hCapture == hWin) {
WM__hCapture = 0;
}
/* check if critical handles are affected. If so, reset the window handle to 0 */
_CheckCriticalHandles(hWin);
/* Inform parent */
WM_NotifyParent(hWin, WM_NOTIFICATION_CHILD_DELETED);
/* Delete all children */
_DeleteAllChildren(pWin->hFirstChild);
#if WM_SUPPORT_NOTIFY_VIS_CHANGED
WM__SendMsgNoData(hWin, WM_NOTIFY_VIS_CHANGED); /* Notify window that visibility may have changed */
#endif
/* Send WM_DELETE message to window in order to inform window itself */
WM__SendMsgNoData(hWin, WM_DELETE); /* tell window about it */
WM__DetachWindow(hWin);
/* Remove window from window stack */
WM__RemoveFromLinList(hWin);
/* Handle transparency counter if necessary */
#if WM_SUPPORT_TRANSPARENCY
if (pWin->Status & WM_SF_HASTRANS) {
WM__TransWindowCnt--;
}
#endif
/* Make sure window is no longer counted as invalid */
if (pWin->Status & WM_SF_INVALID) {
WM__NumInvalidWindows--;
}
/* Free window memory */
WM__NumWindows--;
GUI_ALLOC_Free(hWin);
/* Select a valid window */
WM_SelectWindow(WM__FirstWin);
} else {
GUI_DEBUG_WARN("WM_DeleteWindow: Invalid handle");
}
WM_UNLOCK();
} |
|