//=========================================================================== void Toolbar_button_event(UINT message, LPARAM i) { if (4 == i) { if (WM_LBUTTONDBLCLK == message) { BBExecute_string(_T("control.exe timedate.cpl"), false); } return; } if (WM_LBUTTONUP == message) { bool co = false, rt = false; if (TBInfo.bbsb_hwnd) co = TBInfo.bbsb_currentOnly, rt = TBInfo.bbsb_reverseTasks; co ^= (0 == (GetAsyncKeyState(VK_SHIFT) & 0x8000)); switch(i) { case 0: PostMessage(BBhwnd, BB_WORKSPACE, BBWS_DESKLEFT, 0); break; case 1: PostMessage(BBhwnd, BB_WORKSPACE, BBWS_DESKRIGHT, 0); break; case 2: PostMessage(BBhwnd, BB_WORKSPACE, (int)rt^BBWS_PREVWINDOW, co); break; case 3: PostMessage(BBhwnd, BB_WORKSPACE, (int)rt^BBWS_NEXTWINDOW, co); break; } } }
void Desk_new_background(const char *p) { p = Desk_extended_rootCommand(p); if (p) { if (0 == stricmp(p, "none")) p = ""; if (0 == stricmp(p, "style")) p = NULL; } if (false == Settings_background_enabled) p = ""; else if (NULL == p) p = mStyle.rootCommand; if (0 == strcmp(Root.command, p)) return; strcpy(Root.command, p); if (NULL == hDesktopWnd || false == Settings_smartWallpaper) { // use Windows Wallpaper? Desk_Clear(); if (Root.command[0]) BBExecute_string(Root.command, true); } else { if (hDTThread) WaitForSingleObject(hDTThread, INFINITE); hDTThread = (HANDLE)_beginthread(load_root_thread, 0, NULL); } }
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; }