コード例 #1
0
ファイル: WM_IsWindow.c プロジェクト: Liu1992/GasSub_LPC1788
/*********************************************************************
*
*       WM_IsWindow
*/
int WM_IsWindow(WM_HWIN hWin) {
  int r;
  WM_LOCK();
  r = WM__IsWindow(hWin);
  WM_UNLOCK();
  return r;
}
コード例 #2
0
ファイル: wm.c プロジェクト: uKingSky/KingSky
void WM_DeleteWindow (WM_HWIN Win) {
  WM_Obj* pWin;
  if (!Win)
    return;
  WM_LOCK();
  if (WM__IsWindow(Win)) {
    pWin = WM_H2P(Win);
    ResetNextDrawWin();              /* Make sure the window will no longer receive drawing messages */
  /* Make sure that focus is set to an existing window */
    if (WM__hWinFocus == Win) {
      WM__hWinFocus = 0;
    }
    if (Win == WM__hCapture) {
      WM__hCapture = 0;
    }
  /* Delete all children */
    _DeleteAllChildren(pWin->hFirstChild);
    _DeleteInSiblingList(Win);
  /* Send WM_DELETE message to window in order to inform window itself */
    WM__SendMsgNoData(Win, WM_DELETE);     /* tell window about it */
    /* Inform other modules if necessary */
    if (WM__pfDeleteWindowHook) {
      (*WM__pfDeleteWindowHook)(Win);
    }
  /* Remove window from window stack */
    if (pWin->Status & WM_SF_INVALID) {
      WM__NumInvalidWindows--;
    }
    WM__RemoveFromLinList(Win);
  /* Clear area used by this window */
    WM_InvalidateArea(&pWin->Rect);
  /* Free window memory */
    WM__NumWindows--;
    WM_FREE(Win);
  /* Select a valid window */
    WM_SelectWindow(WM__FirstWin);
  } else {
    GUI_DEBUG_WARN("WM_DeleteWindow: Invalid handle");
  }
  WM_UNLOCK();
}