Defines | Functions

startmenu.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "desktopbar.h"
#include "startmenu.h"
#include "../dialogs/searchprogram.h"
#include "../dialogs/settings.h"
Include dependency graph for startmenu.cpp:

Go to the source code of this file.


#define SHELLPATH_CONTROL_PANEL   TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}")
#define SHELLPATH_PRINTERS   TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")
#define SHELLPATH_NET_CONNECTIONS   TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}")


int GetStartMenuBtnTextWidth (HDC hdc, LPCTSTR title, HWND hwnd)
void DrawStartMenuButton (HDC hdc, const RECT &rect, LPCTSTR title, const SMBtnInfo &btn, bool has_focus, bool pushed, int icon_size)
void ShowExitWindowsDialog (HWND hwndOwner)

Define Documentation

#define SHELLPATH_CONTROL_PANEL   TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}")

Definition at line 44 of file startmenu.cpp.

Referenced by StartMenuHandler::Command().

#define SHELLPATH_NET_CONNECTIONS   TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}")

Definition at line 46 of file startmenu.cpp.

Referenced by StartMenuHandler::Command().

#define SHELLPATH_PRINTERS   TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")

Definition at line 45 of file startmenu.cpp.

Referenced by StartMenuHandler::Command().

Function Documentation

void DrawStartMenuButton ( HDC  hdc,
const RECT &  rect,
LPCTSTR  title,
const SMBtnInfo &  btn,
bool  has_focus,
bool  pushed,
int  icon_size 

Definition at line 1382 of file startmenu.cpp.

Referenced by StartMenu::Paint(), and StartMenu::UpdateIcons().


    if (!btn._enabled)
        style |= DFCS_INACTIVE;

    POINT iconPos = {rect.left+2, (};
    RECT textRect = {rect.left+icon_size+4,, rect.right-4, rect.bottom-4};

    if (pushed) {
        style |= DFCS_PUSHED;
        ++iconPos.x;        ++iconPos.y;
        ++textRect.right;   ++textRect.bottom;

    int bk_color_idx = COLOR_BTNFACE;
    int text_color_idx = COLOR_BTNTEXT;

    if (has_focus) {
        bk_color_idx = COLOR_HIGHLIGHT;
        text_color_idx = COLOR_HIGHLIGHTTEXT;

    COLORREF bk_color = GetSysColor(bk_color_idx);
    HBRUSH bk_brush = GetSysColorBrush(bk_color_idx);

    if (title)
        FillRect(hdc, &rect, bk_brush);

    if (btn._icon_id > ICID_NONE)
        g_Globals._icon_cache.get_icon(btn._icon_id).draw(hdc, iconPos.x, iconPos.y, icon_size, icon_size, bk_color, bk_brush/*, icon_size*/);

     // draw submenu arrow at the right
    if (btn._hasSubmenu) {
        ResIconEx arrowIcon(IDI_ARROW, icon_size, icon_size);
        ResIconEx selArrowIcon(IDI_ARROW_SELECTED, icon_size, icon_size);

        DrawIconEx(hdc, rect.right-icon_size, iconPos.y,
                    has_focus? selArrowIcon: arrowIcon,
                    icon_size, icon_size, 0, bk_brush, DI_NORMAL);

    if (title) {
        BkMode bk_mode(hdc, TRANSPARENT);

        if (!btn._enabled)  // dis->itemState & (ODS_DISABLED|ODS_GRAYED)
            DrawGrayText(hdc, &textRect, title, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
        else {
            TextColor lcColor(hdc, GetSysColor(text_color_idx));
            DrawText(hdc, title, -1, &textRect, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);

Here is the caller graph for this function:

int GetStartMenuBtnTextWidth ( HDC  hdc,
LPCTSTR  title,
HWND  hwnd 

Definition at line 1373 of file startmenu.cpp.

Referenced by StartMenu::AddButton().

    RECT rect = {0, 0, 0, 0};
    DrawText(hdc, title, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);

    return rect.right-rect.left;

Here is the caller graph for this function:

void ShowExitWindowsDialog ( HWND  hwndOwner )

Definition at line 2140 of file startmenu.cpp.

References IDS_TITLE, and TEXT.

Referenced by StartMenuHandler::Command(), DesktopBar::WndProc(), and DesktopWindow::WndProc().

    static DynamicFct<EXITWINDOWSDLG> ExitWindowsDialog(TEXT("SHELL32"), 60);

    if (ExitWindowsDialog)
        MessageBox(hwndOwner, TEXT("ExitWindowsDialog() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);

Here is the caller graph for this function:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage