void ExplorerPropertySheet(HWND hparent) { PropertySheetDialog ps(hparent); ps.dwFlags |= PSH_USEICONID | PSH_PROPTITLE; ps.pszIcon = MAKEINTRESOURCE(IDI_REACTOS); ps.pszCaption = TEXT("Explorer"); PropSheetPage psp1(IDD_DESKBAR_DESKTOP, WINDOW_CREATOR(DesktopSettingsDlg)); psp1.dwFlags |= PSP_USETITLE; psp1.pszTitle = MAKEINTRESOURCE(IDS_DESKTOP); ps.add(psp1); PropSheetPage psp2(IDD_DESKBAR_TASKBAR, WINDOW_CREATOR(TaskbarSettingsDlg)); psp2.dwFlags |= PSP_USETITLE; psp2.pszTitle = MAKEINTRESOURCE(IDS_TASKBAR); ps.add(psp2); PropSheetPage psp3(IDD_DESKBAR_STARTMENU, WINDOW_CREATOR(StartmenuSettingsDlg)); psp3.dwFlags |= PSP_USETITLE; psp3.pszTitle = MAKEINTRESOURCE(IDS_STARTMENU); ps.add(psp3); ps.DoModal(); }
void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine) { ExplorerCmd cmd; if (g_Globals._hMainWnd) { if (IsIconic(g_Globals._hMainWnd)) ShowWindow(g_Globals._hMainWnd, SW_RESTORE); else SetForegroundWindow(g_Globals._hMainWnd); return; } g_Globals._prescan_nodes = false; XMLPos explorer_options = g_Globals.get_cfg("general/explorer"); XS_String mdiStr = XMLString(explorer_options, "mdi"); // If there isn't yet the "mdi" setting in the configuration, display the MDI/SDI dialog. if (mdiStr.empty()) Dialog::DoModal(IDD_MDI_SDI, WINDOW_CREATOR(MdiSdiDlg), g_Globals._hwndDesktop); // Now read the MDI attribute again and interpret it as boolean value. cmd._mdi = XMLBool(explorer_options, "mdi", true); cmd._cmdShow = cmdShow; // parse command line options, which may overwrite the MDI flag if (lpCmdLine) cmd.ParseCmdLine(lpCmdLine); // create main window MainFrameBase::Create(cmd); }
int NotifyArea::Command(int id, int code) { switch(id) { case ID_SHOW_HIDDEN_ICONS: _show_hidden = !_show_hidden; UpdateIcons(); break; case ID_SHOW_ICON_BUTTON: _show_button = !_show_button; UpdateIcons(); break; case ID_CONFIG_NOTIFYAREA: Dialog::DoModal(IDD_NOTIFYAREA, WINDOW_CREATOR(TrayNotifyDlg), GetParent(_hwnd)); break; case ID_CONFIG_TIME: launch_cpanel(_hwnd, TEXT("timedate.cpl")); break; default: SendParent(WM_COMMAND, MAKELONG(id,code), 0); } return 0; }
HWND ClockWindow::Create(HWND hwndParent) { static BtnWindowClass wcClock(CLASSNAME_CLOCKWINDOW, CS_DBLCLKS); ClientRect clnt(hwndParent); WindowCanvas canvas(hwndParent); FontSelection font(canvas, GetStockFont(ANSI_VAR_FONT)); RECT rect = {0, 0, 0, 0}; TCHAR buffer[16]; // Arbitrary high time so that the created clock window is big enough SYSTEMTIME st = { 1601, 1, 0, 1, 23, 59, 59, 999 }; if (!GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buffer, sizeof(buffer)/sizeof(TCHAR))) _tcscpy(buffer, TEXT("00:00")); // Calculate the rectangle needed to draw the time (without actually drawing it) DrawText(canvas, buffer, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT); int clockwindowWidth = rect.right-rect.left + 4; return Window::Create(WINDOW_CREATOR(ClockWindow), 0, wcClock, NULL, WS_CHILD|WS_VISIBLE, clnt.right-(clockwindowWidth), 1, clockwindowWidth, clnt.bottom-2, hwndParent); }
HWND NotifyArea::Create(HWND hwndParent) { static BtnWindowClass wcTrayNotify(CLASSNAME_TRAYNOTIFY, CS_DBLCLKS); ClientRect clnt(hwndParent); return Window::Create(WINDOW_CREATOR(NotifyArea), WS_EX_STATICEDGE, wcTrayNotify, TITLE_TRAYNOTIFY, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN, clnt.right-(NOTIFYAREA_WIDTH_DEF+1), 1, NOTIFYAREA_WIDTH_DEF, clnt.bottom-2, hwndParent); }
HWND TaskBar::Create(HWND hwndParent) { ClientRect clnt(hwndParent); int taskbar_pos = 80; // This start position will be adjusted in DesktopBar::Resize(). return Window::Create(WINDOW_CREATOR(TaskBar), 0, BtnWindowClass(CLASSNAME_TASKBAR), TITLE_TASKBAR, WS_CHILD|WS_VISIBLE | CCS_TOP|CCS_NODIVIDER|CCS_NORESIZE, taskbar_pos, 0, clnt.right-taskbar_pos-(NOTIFYAREA_WIDTH_DEF+1), clnt.bottom, hwndParent); }
HWND DesktopWindow::Create() { static IconWindowClass wcDesktop(TEXT("Progman"), IDI_REACTOS, CS_DBLCLKS); /* (disabled because of small ugly temporary artefacts when hiding start menu) wcDesktop.hbrBackground = (HBRUSH)(COLOR_BACKGROUND+1); */ int width = GetSystemMetrics(SM_CXSCREEN); int height = GetSystemMetrics(SM_CYSCREEN); HWND hwndDesktop = Window::Create(WINDOW_CREATOR(DesktopWindow), WS_EX_TOOLWINDOW, wcDesktop, TEXT("Program Manager"), WS_POPUP|WS_VISIBLE, //|WS_CLIPCHILDREN for SDI frames 0, 0, width, height, 0); // work around to display desktop bar in Wine ShowWindow(GET_WINDOW(DesktopWindow, hwndDesktop)->_desktopBar, SW_SHOW); // work around for Windows NT, Win 98, ... // Without this the desktop has mysteriously only a size of 800x600 pixels. MoveWindow(hwndDesktop, 0, 0, width, height, TRUE); return hwndDesktop; }
void explorer_about(HWND hwndParent) { Dialog::DoModal(IDD_ABOUT_EXPLORER, WINDOW_CREATOR(ExplorerAboutDlg), hwndParent); }