Example #1
0
File: kimehook.c Project: komh/kime
VOID EXPENTRY uninstallHook( VOID )
{
    WinSubclassWindow( hwndKime, oldKimeWndProc );

    WinReleaseHook( hab, NULLHANDLE, HK_INPUT, ( PFN )inputHook, hm );
    WinReleaseHook( hab, NULLHANDLE, HK_ACCEL, ( PFN )accelHook, hm );
    WinReleaseHook( hab, NULLHANDLE, HK_SENDMSG, ( PFN )sendMsgHook, hm );
    WinReleaseHook( hab, NULLHANDLE, HK_DESTROYWINDOW, (PFN)destroyWindowHook, hm );

    WinBroadcastMsg(HWND_DESKTOP, WM_NULL, 0, 0, BMSG_FRAMEONLY | BMSG_POST);

    IM32Term();
}
Example #2
0
void shutdown(HFILE com)
{
  HAB		hAnchorBlock;
  ULONG		ulRetCode;
  ULONG		ulSendResult;
  HMQ		hMsgQWindow;
  QMSG		rMsgQWin;
  QMSG		rMsgDESK;
  int 		x;

  if ((hAnchorBlock = WinInitialize(0)) == NULLHANDLE)
    return;
  if ((hMsgQWindow = WinCreateMsgQueue(hAnchorBlock, 0)) == NULLHANDLE)
    return;
  rMsgDESK.hwnd = HWND_DESKTOP;
  rMsgDESK.msg = 0;
  rMsgDESK.mp1 = MPVOID;
  rMsgDESK.mp2 = MPVOID;
  rMsgDESK.time = 0;
  rMsgDESK.reserved = 0;
  ulSendResult = WinBroadcastMsg(HWND_DESKTOP,
				 WM_SYSCOMMAND,
				 MPFROMSHORT(SC_CLOSE),
				 MPFROM2SHORT(CMDSRC_MENU,FALSE),
				 (ULONG) BMSG_FRAMEONLY);

  for (int i=0; i < 60; i++)	// One minute for a clean stop of all programs
  {
    x = CheckState(com);
    if (x != state) state = x;
    if (state == 0) { counter = COUNT_INIT; return; };
    if (state == 2) break;
    DosSleep(1000);
  }

  DosBeep(4000, 100);
  DosBeep(3000, 100);
  DosBeep(2000, 100);
  DosBeep(1000, 100);
  DosShutdown(0);
  UPSPowerOff(com);
  WinDestroyMsgQueue(hMsgQWindow);
  WinTerminate(hAnchorBlock);
  return;
}
Example #3
0
File: kiphook.c Project: komh/kip
VOID EXPENTRY uninstallHook( VOID )
{
    WinReleaseHook( hab, NULLHANDLE, HK_SENDMSG, ( PFN )sendMsgHook, hm );

    WinBroadcastMsg(HWND_DESKTOP, WM_NULL, 0, 0, BMSG_FRAMEONLY | BMSG_POST);
}
Example #4
0
MRESULT EXPENTRY threadTimerMgrProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) {
   if (msg == WM_TIMER) {
      switch (LONGFROMMP(mp1)) {
      // scadenza ritardo sparizione puntatore mouse ---------------------
         case TID_MOUSEPTR:
            g.is.hidePtrTmr = 0;
            WinStopTimer(g.timerThrd.hab, g.timerThrd.hwnd, TID_MOUSEPTR);
            msg = _sysValue(SV_POINTERLEVEL);
            if (!msg) {
               WinShowPointer(HWND_DESKTOP, FALSE);
               WinShowPointer(HWND_DESKTOP, FALSE);
            } else if (msg > 0x7fff) {
               do {
                  WinShowPointer(HWND_DESKTOP, FALSE);
               } while (_sysValue(SV_POINTERLEVEL) > 0x7fff);
               WinShowPointer(HWND_DESKTOP, FALSE);
            } /* endif */
            g.is.ptrHidden = 1;
            break;
      // scadenza ritardo attivazione automatica finestre ----------------
         case TID_AUTOFOCUS:
            _resetTimer(g.hwnd.autoFocus, TID_AUTOFOCUS);
            break;
      // scadenza ritardo sparizione barra titolo ------------------------
         case TID_HIDETITLE:
            _resetTimer(g.hwnd.hideTitle, TID_HIDETITLE);
            break;
      // scadenza ritardo apparizione barra titolo -----------------------
         case TID_UNHIDETITLE:
            _resetTimer(g.hwnd.unhideTitle, TID_UNHIDETITLE);
            break;
      // scadenza ritardo attivazione automatica barra menu --------------
//         case TID_MENUACTIVATE:
//            _resetTimer(g.hwndActMenu, TID_MENUACTIVATE);
//            break;
      } /* endswitch */
      return (MRESULT)FALSE;
   } /* endif */
   // reset all the bitmaps
   if (msg == SMWM_RESETBITMAPS) {
      HINI hini;
      if (o.tb.on || o.tb.htbar || o.tb.roll) {
         if (freeBitmapResources() &&
             (NULLHANDLE != (hini = stlrOpenProfile()))) {
            initResources(hini, FALSE);
            repaintAll();
            PrfCloseProfile(hini);
         } /* endif */
      } /* endif */
      return (MRESULT)FALSE;
   } /* endif */
   if ((msg == SMWM_DISABLE) && ((HWND)mp2 == hwnd)) {
      if ((BOOL)mp1) { // disabilita tutte le funzioni
         o.gen.disabled = 1;
         g.hwnd.menu = 0;
         g.is.cinitmenu = 0;
         freeBitmapResources();
         stlrStopHitTestCheck();
      } else if (!g.is.expired) {         // riabilita funzioni
         HINI hini;
         o.gen.disabled = 0;
         if (NULLHANDLE != (hini = stlrOpenProfile()))
            initResources(hini, FALSE);
      } /* endif */
      WinBroadcastMsg(HWND_DESKTOP, WM_STYLER2, (MPARAM)STLR_DISABLED,
                      (MPARAM)o.gen.disabled,
                      BMSG_POST | BMSG_FRAMEONLY | BMSG_DESCENDANTS);
      return (MRESULT)FALSE;
   } // end if
   if (msg == WM_STYLER2) {
      if ((ULONG)mp1 == STLR_HIDEALL) {
         g.is.hideall = !g.is.hideall;
         _stlrMsgPostAll(STLR_HIDEALL, 0);
      } else if ((ULONG)mp1 == STLR_ROLLALL) {
         g.is.rollall = !g.is.rollall;
         _stlrMsgPostAll(STLR_ROLLALL, 0);
      } /* endif */
      return (MRESULT)FALSE;
   } /* endif */
   return WinDefWindowProc(hwnd, msg, mp1, mp2);
}