[ros-diffs] [tkreuzer] 54076: [EXPLORER] Implement support for hotkeys for run, show desktop and logoff currently it also causes the startmenu to open, like with win-E, but this is a different bug See issue #1...

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Mon Oct 10 22:12:41 UTC 2011


Author: tkreuzer
Date: Mon Oct 10 22:12:39 2011
New Revision: 54076

URL: http://svn.reactos.org/svn/reactos?rev=54076&view=rev
Log:
[EXPLORER]
Implement support for hotkeys for run, show desktop and logoff
currently it also causes the startmenu to open, like with win-E, but this is a different bug

See issue #1512 for more details.

Modified:
    trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp
    trunk/reactos/base/shell/explorer/taskbar/desktopbar.h
    trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp
    trunk/reactos/base/shell/explorer/taskbar/startmenu.h

Modified: trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp?rev=54076&r1=54075&r2=54076&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp [iso-8859-1] Mon Oct 10 22:12:39 2011
@@ -245,7 +245,10 @@
 void DesktopBar::RegisterHotkeys()
 {
 	 // register hotkey WIN+E opening explorer
-	RegisterHotKey(_hwnd, 0, MOD_WIN, 'E');
+	RegisterHotKey(_hwnd, IDHK_EXPLORER, MOD_WIN, 'E');
+	RegisterHotKey(_hwnd, IDHK_RUN, MOD_WIN, 'R');
+	RegisterHotKey(_hwnd, IDHK_DESKTOP, MOD_WIN, 'D');
+	RegisterHotKey(_hwnd, IDHK_LOGOFF, MOD_WIN, 'L');
 
 		///@todo register all common hotkeys
 }
@@ -253,8 +256,21 @@
 void DesktopBar::ProcessHotKey(int id_hotkey)
 {
 	switch(id_hotkey) {
-	  case 0:	explorer_show_frame(SW_SHOWNORMAL);
-		break;
+		case IDHK_EXPLORER:
+			explorer_show_frame(SW_SHOWNORMAL);
+			break;
+
+		case IDHK_RUN:
+			_startMenuRoot->Command(IDC_LAUNCH, 0);
+			break;
+
+		case IDHK_LOGOFF:
+			_startMenuRoot->Command(IDC_LOGOFF, 0);
+			break;
+
+		case IDHK_DESKTOP:
+			g_Globals._desktops.ToggleMinimize();
+			break;
 
 		///@todo implement all common hotkeys
 	}

Modified: trunk/reactos/base/shell/explorer/taskbar/desktopbar.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskbar/desktopbar.h?rev=54076&r1=54075&r2=54076&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer/taskbar/desktopbar.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/taskbar/desktopbar.h [iso-8859-1] Mon Oct 10 22:12:39 2011
@@ -63,6 +63,11 @@
 
 #define	IDC_FIRST_MENU			0x3000
 
+// hotkeys
+#define IDHK_EXPLORER 0
+#define IDHK_RUN 1
+#define IDHK_DESKTOP 2
+#define IDHK_LOGOFF 3
 
  /// desktop bar window, also known as "system tray"
 struct DesktopBar : public

Modified: trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp?rev=54076&r1=54075&r2=54076&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp [iso-8859-1] Mon Oct 10 22:12:39 2011
@@ -1692,6 +1692,10 @@
 	}
 }
 
+int StartMenuRoot::Command(int id, int code)
+{
+	return super::Command(id, code);
+}
 
 LRESULT	StartMenuRoot::Init(LPCREATESTRUCT pcs)
 {
@@ -2111,10 +2115,10 @@
 		MessageBox(0, TEXT("SHFindComputer() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
 }
 
-struct RunDialogThread : public Thread 
-{ 
-	int	Run(); 
-}; 
+struct RunDialogThread : public Thread
+{
+	int	Run();
+};
 
 int RunDialogThread::Run()
 {

Modified: trunk/reactos/base/shell/explorer/taskbar/startmenu.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskbar/startmenu.h?rev=54076&r1=54075&r2=54076&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer/taskbar/startmenu.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/taskbar/startmenu.h [iso-8859-1] Mon Oct 10 22:12:39 2011
@@ -369,6 +369,7 @@
 
 	static HWND Create(HWND hwndDesktopBar, int icon_size);
 	void	TrackStartmenu();
+	int	Command(int id, int code);
 
 	HWND	_hwndStartButton;
 




More information about the Ros-diffs mailing list