home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 April A / Pcwk4a98.iso / PROGRAM / DELPHI16 / Calmira / Src / SRC / CALMSGS.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-15  |  4KB  |  87 lines

  1. {**************************************************************************}
  2. {                                                                          }
  3. {    Calmira shell for Microsoft« Windows(TM) 3.1                          }
  4. {    Source Release 1.0                                                    }
  5. {    Copyright (C) 1997  Li-Hsin Huang                                     }
  6. {                                                                          }
  7. {    This program is free software; you can redistribute it and/or modify  }
  8. {    it under the terms of the GNU General Public License as published by  }
  9. {    the Free Software Foundation; either version 2 of the License, or     }
  10. {    (at your option) any later version.                                   }
  11. {                                                                          }
  12. {    This program is distributed in the hope that it will be useful,       }
  13. {    but WITHOUT ANY WARRANTY; without even the implied warranty of        }
  14. {    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         }
  15. {    GNU General Public License for more details.                          }
  16. {                                                                          }
  17. {    You should have received a copy of the GNU General Public License     }
  18. {    along with this program; if not, write to the Free Software           }
  19. {    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             }
  20. {                                                                          }
  21. {**************************************************************************}
  22.  
  23. unit CalMsgs;
  24.  
  25. interface
  26.  
  27. uses WinTypes, Messages;
  28.  
  29. const
  30.   WM_SETTINGSCHANGED = WM_USER + 100;  { broadcast to all Calmira windows }
  31.   WM_OPENSHORT       = WM_USER + 101;  { used internally by TShort }
  32.  
  33.   CM_PREVINSTANCE = 1;   { activates the previous instance }
  34.   CM_TASKCONFIG   = 2;   { tells the taskbar to reload the settings }
  35.   CM_EXPLORER     = 3;   { tells Calmira to display the tree view }
  36.   CM_STARTMENU    = 4;   { makes Calmira popup the start menu }
  37.   CM_STARTCLOSE   = 5;   { makes the start button pop up }
  38.   CM_UNLOADTASKBAR= 6;   { closes the taskbar program }
  39.   CM_ARRANGEICONS = 7;   { calls Calmira's icon arrangement function }
  40.   CM_ADDCALWINDOW = 8;   { adds an icon window to the taskbar }
  41.   CM_DELCALWINDOW = 9;   { removes an icon window from the taskbar }
  42.   CM_GETTASKICON  = 10;  { Calmira returns the handle of a suitble icon }
  43.   CM_STARTPROP    = 11;  { displays Start Properties dialog }
  44.   CM_TASKPROP     = 12;  { displays Taskbar Properties dialog }
  45.   CM_MINIMIZEALL  = 13;  { minimizes all programs }
  46.  
  47.   { Used by Wndhooks DLL }
  48.  
  49.   WM_SHELLWNDCREATE  = WM_USER + 200; { top level window created }
  50.   WM_SHELLWNDDESTROY = WM_USER + 201; { top level window destroyed }
  51.   WM_MOUSEHOOK       = WM_USER + 202; { mouse has moved }
  52.   WM_HIDEQUERY       = WM_USER + 203; { window has been minimized }
  53.   WM_WINACTIVE       = WM_USER + 204; { window has been activated }
  54.   WM_DESKMENU        = WM_USER + 205; { right click on wallpaper }
  55.  
  56. var
  57.   WM_CALMIRA : Word;
  58.   TaskBarWnd : HWND;
  59.   CalmiraWnd : HWND;
  60.  
  61. { After the window finding functions are called, the window handles can
  62.   be accessed through the variables instead to avoid calling FindWindow
  63.   repeatedly }
  64.  
  65. function TaskbarWindow: HWND;
  66. function CalmiraWindow: HWND;
  67.  
  68. implementation
  69.  
  70. uses WinProcs;
  71.  
  72. function TaskbarWindow: HWND;
  73. begin
  74.   Result := FindWindow('TApplication', 'Taskbar');
  75.   TaskBarWnd := Result;
  76. end;
  77.  
  78. function CalmiraWindow: HWND;
  79. begin
  80.   Result := FindWindow('TApplication', 'Calmira');
  81.   CalmiraWnd := Result;
  82. end;
  83.  
  84. initialization
  85.   WM_CALMIRA := RegisterWindowMessage('Calmira Registered Message');
  86. end.
  87.