home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / keybset.zip / sl.c < prev    next >
Text File  |  1995-03-19  |  1KB  |  51 lines

  1. /***************************************************************************\
  2. * sl.c - this is the pm part of the ShiftLock project         950319
  3. *
  4. * Copyright (c) 1995 Martin Lafaix. All Rights Reserved.
  5. \***************************************************************************/
  6.  
  7. #define INCL_WIN
  8.  
  9. #include <os2.h>
  10.  
  11. BOOL EXPENTRY SLINIT(HAB habCaller);
  12. BOOL EXPENTRY SLTERM(VOID);
  13.  
  14. int main(int argc, char *argv[], char *envp[])
  15. /*
  16.  * This is the main function.  It initializes the input hook, and then
  17.  * waits for a WM_CLOSE message to remove it.
  18.  *
  19.  * Returns:  0.
  20.  */
  21. {
  22.   HAB hab = WinInitialize(0);
  23.   HMQ hmq = WinCreateMsgQueue(hab, 0);
  24.   QMSG qmsg;
  25.   ULONG flCreate = FCF_TITLEBAR | FCF_TASKLIST;
  26.   HWND hwndFrame;
  27.   HWND hwnd;
  28.  
  29.   WinRegisterClass(hab, "MLC_SHIFTLOCK", (PFNWP)WinDefWindowProc, 0, 0);
  30.  
  31.   hwndFrame = WinCreateStdWindow(HWND_DESKTOP, 0,
  32.                                  &flCreate, "MLC_SHIFTLOCK",
  33.                                  "MLShiftLock", 0,
  34.                                  (HMODULE)0, 4321,
  35.                                  &hwnd);
  36.  
  37.   SLINIT(hab);
  38.    
  39.   while(WinGetMsg(hab, &qmsg, 0, 0, 0))
  40.     WinDispatchMsg(hab, &qmsg);
  41.  
  42.   SLTERM();
  43.  
  44.   WinDestroyWindow(hwndFrame);
  45.  
  46.   WinDestroyMsgQueue(hmq);
  47.   WinTerminate(hab);
  48.  
  49.   return 0;
  50. }
  51.