Пример #1
0
HBITMAP ToolbarGetImage(
    _In_ INT CommandID
    )
{
    switch (CommandID)
    {
    case PHAPP_ID_VIEW_REFRESH:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_ARROW_REFRESH_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_ARROW_REFRESH));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_HACKER_OPTIONS:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_COG_EDIT_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_COG_EDIT));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_HACKER_FINDHANDLESORDLLS:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_FIND_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_FIND));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_VIEW_SYSTEMINFORMATION:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_CHART_LINE_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_CHART_LINE));
            }

            return toolbarBitmap;
        }
        break;
    case TIDC_FINDWINDOW:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_APPLICATION_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_TBAPPLICATION));
            }

            return toolbarBitmap;
        }
        break;
    case TIDC_FINDWINDOWTHREAD:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_APPLICATION_GO_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_APPLICATION_GO));
            }

            return toolbarBitmap;
        }
        break;
    case TIDC_FINDWINDOWKILL:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_CROSS_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_CROSS));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_VIEW_ALWAYSONTOP:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_APPLICATION_GET_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_APPLICATION_GET));
            }

            return toolbarBitmap;
        }
        break;
    case TIDC_POWERMENUDROPDOWN:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = PhLoadPngImageFromResource(PluginInstance->DllBase, ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDB_POWER_MODERN), FALSE);
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(ToolBarImageSize.cx, ToolBarImageSize.cy, MAKEINTRESOURCE(IDI_LIGHTBULB_OFF));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_HACKER_SHOWDETAILSFORALLPROCESSES:
        {
            HICON shieldIcon;
            HBITMAP toolbarBitmap = NULL;

            if (shieldIcon = PhLoadIcon(NULL, IDI_SHIELD, PH_LOAD_ICON_SIZE_SMALL, 0, 0))
            {
                toolbarBitmap = PhIconToBitmap(shieldIcon, ToolBarImageSize.cx, ToolBarImageSize.cy);
                DestroyIcon(shieldIcon);
            }

            return toolbarBitmap;
        }
        break;
    }

    return NULL;
}
Пример #2
0
HBITMAP ToolbarGetImage(
    _In_ INT CommandID
    )
{
    static INT cx = 0;
    static INT cy = 0;

    if (!cx)
    {
        cx = GetSystemMetrics(SM_CXSMICON);
    }

    if (!cy)
    {
        cy = GetSystemMetrics(SM_CYSMICON);
    }

    switch (CommandID)
    {
    case PHAPP_ID_VIEW_REFRESH:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_ARROW_REFRESH_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_ARROW_REFRESH));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_HACKER_OPTIONS:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_COG_EDIT_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_COG_EDIT));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_HACKER_FINDHANDLESORDLLS:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_FIND_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_FIND));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_VIEW_SYSTEMINFORMATION:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_CHART_LINE_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_CHART_LINE));
            }

            return toolbarBitmap;
        }
        break;
    case TIDC_FINDWINDOW:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_APPLICATION_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_TBAPPLICATION));
            }

            return toolbarBitmap;
        }
        break;
    case TIDC_FINDWINDOWTHREAD:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_APPLICATION_GO_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_APPLICATION_GO));
            }

            return toolbarBitmap;
        }
        break;
    case TIDC_FINDWINDOWKILL:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_CROSS_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_CROSS));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_VIEW_ALWAYSONTOP:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_APPLICATION_GET_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_APPLICATION_GET));
            }

            return toolbarBitmap;
        }
        break;
    case TIDC_POWERMENUDROPDOWN:
        {
            HBITMAP toolbarBitmap = NULL;

            if (ToolStatusConfig.ModernIcons)
            {
                toolbarBitmap = LoadImageFromResources(cx, cy, MAKEINTRESOURCE(IDB_POWER_MODERN));
            }
            else
            {
                toolbarBitmap = ToolbarLoadImageFromIcon(cx, cy, MAKEINTRESOURCE(IDI_LIGHTBULB_OFF));
            }

            return toolbarBitmap;
        }
        break;
    case PHAPP_ID_HACKER_SHOWDETAILSFORALLPROCESSES:
        {
            HBITMAP toolbarBitmap = NULL;
            HICON shieldIcon = NULL;

            if (shieldIcon = PhLoadIcon(NULL, IDI_SHIELD, PH_LOAD_ICON_SIZE_SMALL | PH_LOAD_ICON_STRICT, 0, 0))
            {
                toolbarBitmap = PhIconToBitmap(
                    shieldIcon,
                    cx,
                    cy
                    );

                DestroyIcon(shieldIcon);
            }

            return toolbarBitmap;
        }
        break;
    }

    return NULL;
}