else
return 0; // disable any other resizing
} else if (wparam == SC_TASKLIST)
- ShowStartMenu();
+ ShowOrHideStartMenu();
goto def;
case WM_SIZE:
{
switch(id) {
case IDC_START:
- ShowStartMenu();
+ ShowOrHideStartMenu();
break;
case ID_ABOUT_EXPLORER:
}
-void DesktopBar::ShowStartMenu()
+void DesktopBar::ShowOrHideStartMenu()
{
if (_startMenuRoot)
{
if (!Button_GetState(_hwndStartButton))
Button_SetState(_hwndStartButton, TRUE);
- _startMenuRoot->TrackStartmenu();
+ if (_startMenuRoot->IsStartMenuVisible())
+ _startMenuRoot->CloseStartMenu();
+ else
+ _startMenuRoot->TrackStartmenu();
// StartMenu was closed, release button state
Button_SetState(_hwndStartButton, false);
void ControlResize(WPARAM wparam, LPARAM lparam);
void RegisterHotkeys();
void ProcessHotKey(int id_hotkey);
- void ShowStartMenu();
+ void ShowOrHideStartMenu();
LRESULT ProcessCopyData(COPYDATASTRUCT* pcd);
WindowHandle _hwndTaskBar;
ShowWindow(_hwnd, SW_HIDE);
}
+bool StartMenuRoot::IsStartMenuVisible() const
+{
+ return IsWindowVisible(_hwnd);
+}
+
void StartMenuRoot::ProcessKey(int vk)
{
switch(vk) {
static HWND Create(HWND hwndDesktopBar, int icon_size);
void TrackStartmenu();
+ void CloseStartMenu(int id=0);
+ bool IsStartMenuVisible() const;
int Command(int id, int code);
HWND _hwndStartButton;
virtual void ProcessKey(int vk);
void Paint(PaintCanvas& canvas);
- void CloseStartMenu(int id=0);
+
void ReadLogoSize();
UINT GetLogoResId();