Esempio n. 1
0
HBITMAP load_desk_bitmap(const char* command, bool makebmp)
{
    char exe_path[MAX_PATH];
    char bmp_path[MAX_PATH];
    char buffer[4*MAX_PATH];
    int x, r;

    const char *cptr;
    unsigned long bsrt_vernum;

    cptr = command;
    if (false == is_bsetroot_command(&cptr)) {
bbexec:
        if (command[0])
            BBExecute_string(command, RUN_NOERRORS);
        return NULL;
    }

#ifndef BBTINY
    if (makebmp) {
        HBITMAP bmp = make_root_bmp(cptr);
        if (bmp)
            return bmp;
    }
#endif

    set_my_path(NULL, exe_path, "bsetroot.exe");
    bsrt_vernum = getfileversion(exe_path);
    //dbg_printf("bsrt_vernum %08x", bsrt_vernum);
    if (bsrt_vernum < 0x02000000)
        goto bbexec;

    x = sprintf(buffer, "\"%s\" %s", exe_path, cptr);

#ifndef BBTINY
    if (makebmp) {
        set_my_path(NULL, bmp_path, "$bsroot$.bmp");
        x += sprintf(buffer + x, " -save \"%s\"", bmp_path);
    }
#endif

#if 0
    if (bsrt_vernum >= 0x02010000) {
        char base_path[MAX_PATH];
        file_directory(base_path, bbrcPath(NULL));
        x += sprintf(buffer + x, " -prefix \"%s\"", base_path);
    }
#endif

    r = BBExecute_string(buffer, RUN_NOSUBST|RUN_WAIT|RUN_NOERRORS);
    //dbg_printf("command <%s>", buffer);
    if (0 == r)
        return NULL;

#ifndef BBTINY
    if (makebmp)
        return read_bitmap(bmp_path, true);
#endif

    return NULL;
}
Esempio n. 2
0
void readSettings(void)
{
	int i;

	ZeroMemory(&mSkin, offset_hooks);

	//====================
	// titlebar click actions
	for (i = 0; i < 12; i++)
	{
		static const char *modifiers[] = { "", "Shift", "Ctrl" };
		static const char *buttons[]  = { "Dbl", "Right", "Mid", "Left" };
		static const char *button_ids[6+1+1] =
		{
			"Close", "Maximize", "Minimize",
			"Rollup", "AlwaysOnTop", "Pin",
			"Lower", NULL
		};

		char rcstring[80];
		sprintf(rcstring, "bbleanskin.titlebar.%s%sClick:", modifiers[i%3], buttons[i/3]);
		const char *p = ReadString(rcpath, rcstring, "");
		mSkin.captionClicks.Dbl[i] = get_string_index(p, button_ids);
	}

	// ############# EDIT: MADE ALL BUTTONS VISIBLE BY DEFAULT ##############
	// ##### (MAKES MORE SENSE, UNLESS BUTTONS 5 and 6 DO NOT WORK (?)) #####
	//  strncpy(mSkin.button_string, ReadString(rcpath, "bbleanskin.titlebar.buttons:", "400321"), 6);
	strncpy(mSkin.button_string, ReadString(rcpath, "bbleanskin.titlebar.buttons:", "465321"), 6);
	// ######################################################################

	// button pics
	read_buttons();

	//====================
	// other settings

//	mSkin.nixShadeStyle = ReadBool(rcpath, "bbleanskin.option.nixShadeStyle:", true);
	mSkin.nixShadeStyle = ReadBool(rcpath, "bbleanskin.option.nixShadeStyle:", false);
//	mSkin.snapWindows = ReadBool(rcpath, "bbleanskin.option.snapWindows:", true);
	mSkin.snapWindows = ReadBool(rcpath, "bbleanskin.option.snapWindows:", false);
	applyToOpen = ReadBool(rcpath, "bbleanskin.option.applyToOpen:", true);
//	adjustCaptionHeight = ReadBool(rcpath, "bbleanskin.option.adjustCaptionHeight:", false);
	adjustCaptionHeight = ReadBool(rcpath, "bbleanskin.option.adjustCaptionHeight:", true);
	enableLog = ReadBool(rcpath, "bbleanskin.option.enableLog:", false);

	//mSkin.drawLocked = ReadBool(rcpath, "bbleanskin.option.drawLocked:", false);
	mSkin.imageDither = ReadBool(bbrcPath(), "session.imageDither:", false);

	//====================
	// windows appearance settings
	MenuHeight = ReadInt(rcpath, "bbleanskin.windows.menu.height:", -1);
	strcpy(windows_menu_fontFace, ReadString(rcpath, "bbleanskin.windows.menu.Font:", ""));
	windows_menu_fontHeight = ReadInt(rcpath, "bbleanskin.windows.menu.fontHeight:", 8);
	ScrollbarSize = ReadInt(rcpath, "bbleanskin.windows.scrollbarsize:", -1);
	setTTColor = ReadBool(rcpath, "bbleanskin.windows.setToolTipColor:", false);

	mSkin.BBhwnd = BBhwnd;
	mSkin.BBVersion = BBVersion;
	mSkin.loghwnd = m_hwnd;
	mSkin.enableLog = enableLog;
}