Exemplo n.º 1
0
void Desk_read_background(const char *p)
{
	bool makebmp;

	Desk_Reset(true);

	p = Desk_extended_rootCommand(p);
	if (p)
	{
		if (0 == _stricmp(p, "none"))
			p = "";
		if (0 == _stricmp(p, "style"))
			p = NULL;
	}
	if (false == Settings_enableBackground)
		p = "";
	else
		if (NULL == p)
			p = mStyle.rootCommand;

	makebmp = hDesktopWnd && Settings_smartWallpaper;
	if (0 == strcmp(Root.command, p) && *p && (Root.bmp || !makebmp))
		return;
	HBITMAP read_bitmap(const char* path, bool delete_after);
	set_bitmap(read_bitmap(p, makebmp));
	if (hDesktopWnd)
		Desk_SetPosition();
	strcpy(Root.command, p);
	if (g_usingVista && 0 == *p)
		SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, NULL, SPIF_SENDCHANGE);

	//PostMessage(BBhwnd, BB_REDRAWGUI, BBRG_DESK, 0);
}
Exemplo n.º 2
0
// --------------------------------------------
void Desk_Exit(void)
{
    if (have_imp(pSetHooks)) {
        pSetHooks(NULL, 0);
        FreeLibrary(GetModuleHandle(deskhook_dll));
    }
    pSetHooks = NULL;

    if (hDesktopWnd) {
        DestroyWindow(hDesktopWnd);
        UnregisterClass(szDesktopName, hMainInstance);
        hDesktopWnd = NULL;
    }

    Desk_Reset(true);
}
Exemplo n.º 3
0
int exec_cfg_command(const char *argument)
{
    const struct cfgmenu *p_menu, *p_item;
    const void *v;

    // is it a plugin related command?
    if (0 == memicmp(argument, "plugin.", 7)) {
        if (0 == PluginManager_handleBroam(argument+7))
            return 0;
        Menu_Update(MENU_UPD_CONFIG);
        return 1;
    }

    // search the item in above structures
    v = exec_internal_broam(argument, cfg_main, &p_menu, &p_item);
    if (NULL == p_item)
        return 0;

    // now take care for some item-specific refreshes
    if (v == &Settings_toolbar.enabled) {
        if (Settings_toolbar.enabled)
            beginToolbar(hMainInstance);
        else
            endToolbar(hMainInstance);
        Menu_Update(MENU_UPD_CONFIG);
    } else if (v == &Settings_menu.sortByExtension
            || v == &Settings_menu.showHiddenFiles) {
        PostMessage(BBhwnd, BB_REDRAWGUI, BBRG_MENU|BBRG_FOLDER, 0);
    } else if (v == &Settings_smartWallpaper) {
        Desk_Reset(true);
    } else if (v == &Settings_menu.dropShadows) {
        Menu_Exit(), Menu_Init();
    } else if (v == &Settings_UTF8Encoding) {
        Workspaces_GetCaptions();
        Tray_SetEncoding();
        PostMessage(BBhwnd, BB_REDRAWGUI, BBRG_MENU|BBRG_FOLDER, 0);
    }

    if (p_menu == cfg_sub_graphics || v == &Settings_UTF8Encoding)
        PostMessage(BBhwnd, BB_RECONFIGURE, 0, 0); // full reconfigure
    else
        PostMessage(BBhwnd, BB_RECONFIGURE, 1, 0); // bypass plugins

    return 1;
}