desktopbar.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 
00020  //
00021  // Explorer and Desktop clone
00022  //
00023  // desktopbar.h
00024  //
00025  // Martin Fuchs, 22.08.2003
00026  //
00027 
00028 
00029 #define CLASSNAME_EXPLORERBAR   TEXT("Shell_TrayWnd")
00030 #define TITLE_EXPLORERBAR       TEXT("")    // use an empty window title, so windows taskmanager does not show the window in its application list
00031 
00032 
00033 #define DESKTOPBARBAR_HEIGHT    (GetSystemMetrics(SM_CYSIZE) + 5 * GetSystemMetrics(SM_CYEDGE))
00034 #define REBARBAND_HEIGHT        (GetSystemMetrics(SM_CYSIZE) + 2 * GetSystemMetrics(SM_CYEDGE))
00035 
00036 
00037 #define IDC_START               0x1000
00038 #define IDC_LOGOFF              0x1001
00039 #define IDC_SHUTDOWN            0x1002
00040 #define IDC_LAUNCH              0x1003
00041 #define IDC_START_HELP          0x1004
00042 #define IDC_SEARCH_FILES        0x1005
00043 #define IDC_SEARCH_COMPUTER     0x1006
00044 #define IDC_SETTINGS            0x1007
00045 #define IDC_ADMIN               0x1008
00046 #define IDC_DOCUMENTS           0x1009
00047 #define IDC_RECENT              0x100A
00048 #define IDC_FAVORITES           0x100B
00049 #define IDC_PROGRAMS            0x100C
00050 #define IDC_EXPLORE             0x100D
00051 #define IDC_NETWORK             0x100E
00052 #define IDC_CONNECTIONS         0x100F
00053 #define IDC_DRIVES              0x1010
00054 #define IDC_CONTROL_PANEL       0x1011
00055 #define IDC_SETTINGS_MENU       0x1012
00056 #define IDC_PRINTERS            0x1013
00057 #define IDC_PRINTERS_MENU       0x1014
00058 #define IDC_BROWSE              0x1015
00059 #define IDC_SEARCH_PROGRAM      0x1016
00060 #define IDC_SEARCH              0x1017
00061 #define IDC_TERMINATE           0x1018
00062 #define IDC_RESTART             0x1019
00063 
00064 #define IDC_FIRST_MENU          0x3000
00065 
00066 
00067  /// desktop bar window, also known as "system tray"
00068 struct DesktopBar : public
00069 #ifdef __REACTOS__
00070     TrayIconControllerTemplate<
00071                 OwnerDrawParent<Window> >
00072 #else
00073     OwnerDrawParent<Window>
00074 #endif
00075 {
00076 #ifdef __REACTOS__
00077     typedef TrayIconControllerTemplate<
00078                 OwnerDrawParent<Window> > super;
00079 #else
00080     typedef OwnerDrawParent<Window> super;
00081 #endif
00082 
00083     DesktopBar(HWND hwnd);
00084     ~DesktopBar();
00085 
00086     static HWND Create();
00087 
00088 protected:
00089     RECT    _work_area_org;
00090     int     _taskbar_pos;
00091 
00092     LRESULT Init(LPCREATESTRUCT pcs);
00093     LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00094     int     Notify(int id, NMHDR* pnmh);
00095     int     Command(int id, int code);
00096 
00097     void    Resize(int cx, int cy);
00098     void    ControlResize(WPARAM wparam, LPARAM lparam);
00099     void    RegisterHotkeys();
00100     void    ProcessHotKey(int id_hotkey);
00101     void    ShowStartMenu();
00102     LRESULT ProcessCopyData(COPYDATASTRUCT* pcd);
00103 
00104     WindowHandle _hwndTaskBar;
00105     WindowHandle _hwndNotify;
00106     WindowHandle _hwndQuickLaunch;
00107     WindowHandle _hwndrebar;
00108     /* Needed to make the StartButton pushed, if it's called by windowskey: SC_TASKLIST command */
00109     WindowHandle _hwndStartButton;
00110 
00111     struct StartMenuRoot* _startMenuRoot;
00112 
00113 #ifdef __REACTOS__
00114     TrayIcon    _trayIcon;
00115 
00116     void    AddTrayIcons();
00117     virtual void TrayClick(UINT id, int btn);
00118     virtual void TrayDblClick(UINT id, int btn);
00119 #else
00120     const UINT WM_TASKBARCREATED;
00121 #endif
00122 };
00123 
00124 
00125  /// special "Start" button with one click activation
00126 struct StartButton : public PictureButton
00127 {
00128     typedef PictureButton super;
00129 
00130     StartButton(HWND hwnd);
00131 
00132 protected:
00133     LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00134 };

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage