1 added + 9 modified, total 10 files
reactos/subsys/system/explorer
diff -u -r1.36 -r1.37
--- doxy-footer.html 14 Mar 2004 14:44:23 -0000 1.36
+++ doxy-footer.html 15 Mar 2004 20:45:40 -0000 1.37
@@ -3,7 +3,7 @@
<tr>
<td><address style="align: right;"><small>
ROS Explorer Source Code Documentation
-<br>generated on 14.03.2004 by <a href="http://www.doxygen.org/index.html">
+<br>generated on 15.03.2004 by <a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0>
</small></address>
</td>
reactos/subsys/system/explorer
diff -u -r1.51 -r1.52
--- explorer.dsp 14 Mar 2004 16:39:27 -0000 1.51
+++ explorer.dsp 15 Mar 2004 20:45:40 -0000 1.52
@@ -494,6 +494,10 @@
# End Source File
# Begin Source File
+SOURCE=.\res\speaker.ico
+# End Source File
+# Begin Source File
+
SOURCE=.\res\startmenu.ico
# End Source File
# Begin Source File
reactos/subsys/system/explorer
diff -u -r1.45 -r1.46
--- explorer_intres.h 28 Feb 2004 18:10:03 -0000 1.45
+++ explorer_intres.h 15 Mar 2004 20:45:40 -0000 1.46
@@ -36,6 +36,7 @@
#define IDS_STARTMENU 32
#define IDS_MINIMIZE_ALL 33
#define IDS_DESKTOP_NUM 34
+#define IDS_VOLUME 35
#define IDI_REACTOS 100
#define IDI_EXPLORER 101
#define IDI_STARTMENU 102
@@ -75,6 +76,7 @@
#define IDI_NETWORK 148
#define IDI_COMPUTER 149
#define IDM_DESKTOPBAR 150
+#define IDM_VOLUME 151
#define IDD_DESKBAR_TASKBAR 153
#define IDB_ICON_ALIGN_0 153
#define IDD_DESKBAR_STARTMENU 154
@@ -87,6 +89,7 @@
#define IDB_ICON_ALIGN_7 160
#define IDB_ICON_ALIGN_8 161
#define IDB_ICON_ALIGN_9 162
+#define IDI_SPEAKER 162
#define IDB_ICON_ALIGN_10 163
#define IDB_LOGOV16 164
#define ID_VIEW_NAME 401
@@ -137,9 +140,11 @@
#define ID_STOP 40009
#define ID_MINIMIZE_ALL 40010
#define ID_EXPLORE 40011
-#define ID_SWITCH_DESKTOP_1 50000
#define ID_TASKMGR 40012
-#define ID_BROWSE_UP 40013
+#define ID_BROWSE_UP 40013
+#define ID_TRAY_VOLUME 40014
+#define ID_VOLUME_PROPERTIES 40015
+#define ID_SWITCH_DESKTOP_1 50000
#define ID_WINDOW_NEW 0xE130
#define ID_WINDOW_ARRANGE 0xE131
#define ID_WINDOW_CASCADE 0xE132
@@ -156,8 +161,8 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 161
-#define _APS_NEXT_COMMAND_VALUE 40014
+#define _APS_NEXT_RESOURCE_VALUE 163
+#define _APS_NEXT_COMMAND_VALUE 40016
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_SYMED_VALUE 101
#endif
reactos/subsys/system/explorer
diff -u -r1.63 -r1.64
--- explorer_intres.rc 13 Mar 2004 20:05:32 -0000 1.63
+++ explorer_intres.rc 15 Mar 2004 20:45:40 -0000 1.64
@@ -132,6 +132,7 @@
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Desktop %d"
+ IDS_VOLUME "Volume"
END
#endif // Romanian resources
@@ -443,6 +444,7 @@
IDI_PRINTER ICON DISCARDABLE "res/printer.ico"
IDI_NETWORK ICON DISCARDABLE "res/network.ico"
IDI_COMPUTER ICON DISCARDABLE "res/computer.ico"
+IDI_SPEAKER ICON DISCARDABLE "res/speaker.ico"
/////////////////////////////////////////////////////////////////////////////
//
@@ -513,6 +515,7 @@
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "alle Fenster minimieren"
IDS_DESKTOP_NUM "Desktop %d"
+ IDS_VOLUME "Lautst�rke"
END
#endif // German (Germany) resources
@@ -685,6 +688,15 @@
END
END
+IDM_VOLUME MENU DISCARDABLE
+BEGIN
+ POPUP ""
+ BEGIN
+ MENUITEM "Open Volume Control", ID_TRAY_VOLUME
+ MENUITEM "Adjust Audio Properties", ID_VOLUME_PROPERTIES
+ END
+END
+
/////////////////////////////////////////////////////////////////////////////
//
@@ -862,6 +874,7 @@
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Desktop %d"
+ IDS_VOLUME "Volume"
END
#endif // English (U.S.) resources
@@ -988,6 +1001,7 @@
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Bureau %d"
+ IDS_VOLUME "Volume"
END
#endif // French (France) resources
@@ -1190,6 +1204,7 @@
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Desktop %d"
+ IDS_VOLUME "Volume"
END
#endif // Portuguese (Portugal) resources
reactos/subsys/system/explorer/taskbar
diff -u -r1.31 -r1.32
--- desktopbar.cpp 12 Mar 2004 21:12:27 -0000 1.31
+++ desktopbar.cpp 15 Mar 2004 20:45:40 -0000 1.32
@@ -44,8 +44,7 @@
DesktopBar::DesktopBar(HWND hwnd)
: super(hwnd),
- // initialize Common Controls library
- WM_TASKBARCREATED(RegisterWindowMessage(WINMSG_TASKBARCREATED))
+ _trayIcon(hwnd, ID_TRAY_VOLUME)
{
SystemParametersInfo(SPI_GETWORKAREA, 0, &_work_area_org, 0);
}
@@ -239,6 +238,13 @@
return SendMessage(_hwndTaskBar, nmsg, wparam, lparam);
break;
+ case WM_TIMER:
+ if (wparam == ID_TRAY_VOLUME) {
+ KillTimer(_hwnd, wparam);
+ WinExec("sndvol32.exe -t", SW_SHOWNORMAL); // launch volume control in small mode
+ }
+ break;
+
default: def:
return super::WndProc(nmsg, wparam, lparam);
}
@@ -312,10 +318,14 @@
g_Globals._desktops.SwitchToDesktop(desktop_idx);
- if (_hwndQuickLaunch)
+ if (_hwndQuickLaunch)
PostMessage(_hwndQuickLaunch, PM_UPDATE_DESKTOP, desktop_idx, 0);
break;}
+ case ID_TRAY_VOLUME:
+ WinExec("sndvol32.exe", SW_SHOWNORMAL);
+ break;
+
default:
if (_hwndQuickLaunch)
return SendMessage(_hwndQuickLaunch, WM_COMMAND, MAKEWPARAM(id,code), 0);
@@ -357,3 +367,34 @@
return FALSE;
}
+
+
+void DesktopBar::AddTrayIcons()
+{
+ _trayIcon.Add(SmallIcon(IDI_SPEAKER), ResString(IDS_VOLUME));
+}
+
+void DesktopBar::TrayClick(UINT id, int btn)
+{
+ switch(id) {
+ case ID_TRAY_VOLUME:
+ if (btn == TRAYBUTTON_LEFT)
+ SetTimer(_hwnd, ID_TRAY_VOLUME, 500, NULL); // wait a bit to correctly handle double clicks
+ else {
+ PopupMenu menu(IDM_VOLUME);
+ SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
+ menu.TrackPopupMenuAtPos(_hwnd, GetMessagePos());
+ }
+ break;
+ }
+}
+
+void DesktopBar::TrayDblClick(UINT id, int btn)
+{
+ switch(id) {
+ case ID_TRAY_VOLUME:
+ KillTimer(_hwnd, ID_TRAY_VOLUME); // finish one-click timer
+ WinExec("sndvol32.exe", SW_SHOWNORMAL);
+ break;
+ }
+}
reactos/subsys/system/explorer/taskbar
diff -u -r1.22 -r1.23
--- desktopbar.h 12 Mar 2004 21:12:27 -0000 1.22
+++ desktopbar.h 15 Mar 2004 20:45:40 -0000 1.23
@@ -30,9 +30,6 @@
#define TITLE_EXPLORERBAR TEXT("") // use an empty window title, so windows taskmanager does not show the window in its application list
-#define WINMSG_TASKBARCREATED TEXT("TaskbarCreated")
-
-
#define DESKTOPBARBAR_HEIGHT 29
@@ -64,9 +61,11 @@
/// desktop bar window, also known as "system tray"
-struct DesktopBar : public OwnerDrawParent<Window>
+struct DesktopBar : public TrayIconControllerTemplate<
+ OwnerDrawParent<Window> >
{
- typedef OwnerDrawParent<Window> super;
+ typedef TrayIconControllerTemplate<
+ OwnerDrawParent<Window> > super;
DesktopBar(HWND hwnd);
~DesktopBar();
@@ -76,7 +75,6 @@
protected:
CommonControlInit _usingCmnCtrl;
- int WM_TASKBARCREATED;
RECT _work_area_org;
int _taskbar_pos;
@@ -96,4 +94,10 @@
WindowHandle _hwndrebar;
struct StartMenuRoot* _startMenuRoot;
+
+ TrayIcon _trayIcon;
+
+ void AddTrayIcons();
+ virtual void TrayClick(UINT id, int btn);
+ virtual void TrayDblClick(UINT id, int btn);
};
reactos/subsys/system/explorer/taskbar
diff -u -r1.20 -r1.21
--- quicklaunch.cpp 26 Feb 2004 19:47:39 -0000 1.20
+++ quicklaunch.cpp 15 Mar 2004 20:45:40 -0000 1.21
@@ -253,7 +253,7 @@
}
}
- return 1;
+ return 0; // Don't return 1 to avoid recursion with DesktopBar::Command()
}
int QuickLaunchBar::Notify(int id, NMHDR* pnmh)
reactos/subsys/system/explorer/taskbar
diff -u -r1.42 -r1.43
--- traynotify.cpp 14 Mar 2004 22:44:08 -0000 1.42
+++ traynotify.cpp 15 Mar 2004 20:45:40 -0000 1.43
@@ -471,6 +471,12 @@
*/
TCHAR title[MAX_PATH];
+ if (entry._tipText == TEXT("FRITZ!fon"))
+ return true;
+
+ if (entry._tipText == TEXT("FRITZ!fax"))
+ return true;
+
if (GetWindowText(entry._hWnd, title, MAX_PATH)) {
if (_tcsstr(title, TEXT("Task Manager")))
return false;
reactos/subsys/system/explorer/utility
diff -u -r1.48 -r1.49
--- window.h 14 Mar 2004 22:20:10 -0000 1.48
+++ window.h 15 Mar 2004 20:45:41 -0000 1.49
@@ -953,3 +953,121 @@
static int CALLBACK CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort);
};
+
+
+enum {TRAYBUTTON_LEFT=0, TRAYBUTTON_RIGHT, TRAYBUTTON_MIDDLE};
+
+#define PM_TRAYICON (WM_APP+0x1E)
+
+#define WINMSG_TASKBARCREATED TEXT("TaskbarCreated")
+
+
+struct TrayIcon
+{
+ TrayIcon(HWND hparent, UINT id)
+ : _hparent(hparent), _id(id) {}
+
+ ~TrayIcon()
+ {Remove();}
+
+ void Add(HICON hIcon, LPCTSTR tooltip=NULL)
+ {Set(NIM_ADD, _id, hIcon, tooltip);}
+
+ void Modify(HICON hIcon, LPCTSTR tooltip=NULL)
+ {Set(NIM_MODIFY, _id, hIcon, tooltip);}
+
+ void Remove()
+ {
+ NOTIFYICONDATA nid = {
+ sizeof(NOTIFYICONDATA), // cbSize
+ _hparent, // hWnd
+ _id, // uID
+ };
+
+ Shell_NotifyIcon(NIM_DELETE, &nid);
+ }
+
+protected:
+ HWND _hparent;
+ UINT _id;
+
+ void Set(DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL)
+ {
+ NOTIFYICONDATA nid = {
+ sizeof(NOTIFYICONDATA), // cbSize
+ _hparent, // hWnd
+ id, // uID
+ NIF_MESSAGE|NIF_ICON, // uFlags
+ PM_TRAYICON, // uCallbackMessage
+ hIcon // hIcon
+ };
+
+ if (tooltip)
+ _tcsncpy(nid.szTip, tooltip, COUNTOF(nid.szTip));
+
+ if (nid.szTip[0])
+ nid.uFlags |= NIF_TIP;
+
+ Shell_NotifyIcon(dwMessage, &nid);
+ }
+};
+
+
+template<typename BASE> struct TrayIconControllerTemplate : public BASE
+{
+ typedef BASE super;
+
+ TrayIconControllerTemplate(HWND hwnd) : BASE(hwnd),
+ WM_TASKBARCREATED(RegisterWindowMessage(WINMSG_TASKBARCREATED))
+ {
+ }
+
+ LRESULT WndProc(UINT message, WPARAM wparam, LPARAM lparam)
+ {
+ if (message == PM_TRAYICON) {
+ switch(lparam) {
+ case WM_MOUSEMOVE:
+ TrayMouseOver(wparam);
+ break;
+
+ case WM_LBUTTONDOWN:
+ TrayClick(wparam, TRAYBUTTON_LEFT);
+ break;
+
+ case WM_LBUTTONDBLCLK:
+ TrayDblClick(wparam, TRAYBUTTON_LEFT);
+ break;
+
+ case WM_RBUTTONDOWN:
+ TrayClick(wparam, TRAYBUTTON_RIGHT);
+ break;
+
+ case WM_RBUTTONDBLCLK:
+ TrayDblClick(wparam, TRAYBUTTON_RIGHT);
+ break;
+
+ case WM_MBUTTONDOWN:
+ TrayClick(wparam, TRAYBUTTON_MIDDLE);
+ break;
+
+ case WM_MBUTTONDBLCLK:
+ TrayDblClick(wparam, TRAYBUTTON_MIDDLE);
+ break;
+ }
+
+ return 0;
+ } else if (message == WM_TASKBARCREATED) {
+ AddTrayIcons();
+ return 0;
+ } else
+ return super::WndProc(message, wparam, lparam);
+ }
+
+ virtual void AddTrayIcons() = 0;
+ virtual void TrayMouseOver(UINT id) {}
+ virtual void TrayClick(UINT id, int btn) {}
+ virtual void TrayDblClick(UINT id, int btn) {}
+
+protected:
+ const UINT WM_TASKBARCREATED;
+};
CVSspam 0.2.8