diff options
Diffstat (limited to 'xorg-server/hw/xwin/xlaunch/main.cc')
-rw-r--r-- | xorg-server/hw/xwin/xlaunch/main.cc | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/xorg-server/hw/xwin/xlaunch/main.cc b/xorg-server/hw/xwin/xlaunch/main.cc index 2247d3aaf..ad84f6a10 100644 --- a/xorg-server/hw/xwin/xlaunch/main.cc +++ b/xorg-server/hw/xwin/xlaunch/main.cc @@ -34,6 +34,9 @@ #include <X11/Xlib.h> +#ifdef _MSC_VER +#define snprintf _snprintf +#endif /// @brief Send WM_ENDSESSION to all program windows. /// This will shutdown the started xserver BOOL CALLBACK KillWindowsProc(HWND hwnd, LPARAM lParam) @@ -69,7 +72,9 @@ class CMyWizard : public CWizard config.Load(filename); } catch (std::runtime_error &e) { - printf("Fehler: %s\n", e.what()); + char Message[255]; + sprintf(Message,"Failure: %s\n", e.what()); + MessageBox(NULL,Message,"Exception",MB_OK); } } @@ -108,7 +113,10 @@ class CMyWizard : public CWizard } // Check for valid input if (config.display.empty()) + { + MessageBox(hwndDlg,"Please fill in a display number.","Error",MB_OK); SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + } else SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIENTS); return TRUE; @@ -354,7 +362,9 @@ class CMyWizard : public CWizard config.Save(ofn.lpstrFile); } catch (std::runtime_error &e) { - printf("Fehler: %s\n", e.what()); + char Message[255]; + sprintf(Message,"Failure: %s\n", e.what()); + MessageBox(NULL,Message,"Exception",MB_OK); } } } @@ -489,7 +499,7 @@ class CMyWizard : public CWizard return NULL; } - /// @brief Do the actual start of Xming and clients + /// @brief Do the actual start of VCXsrv and clients void StartUp() { std::string buffer; @@ -499,13 +509,8 @@ class CMyWizard : public CWizard std::string display_id = ":" + config.display; std::string display = "localhost" + display_id + ":0"; -#ifdef _DEBUG - // Debug only: Switch to Xming installation directory - SetCurrentDirectory("C:\\Programme\\Xming"); -#endif - - // Build Xming commandline - buffer = "Xming " + display_id + " "; + // Build Xsrv commandline + buffer = "vcxsrv " + display_id + " "; switch (config.window) { case CConfig::MultiWindow: @@ -577,7 +582,7 @@ class CMyWizard : public CWizard sic.cb = sizeof(sic); ZeroMemory( &pic, sizeof(pic) ); - // Start Xming process. + // Start VCXsrv process. #ifdef _DEBUG printf("%s\n", buffer.c_str()); #endif @@ -627,7 +632,7 @@ class CMyWizard : public CWizard #ifdef _DEBUG printf("killing process!\n"); #endif - // Check if Xming is still running + // Check if Xsrv is still running DWORD exitcode; GetExitCodeProcess(pi.hProcess, &exitcode); unsigned counter = 0; @@ -636,7 +641,7 @@ class CMyWizard : public CWizard if (++counter > 10) TerminateProcess(pi.hProcess, (DWORD)-1); else - // Shutdown Xming (the soft way!) + // Shutdown Xsrv (the soft way!) EnumThreadWindows(pi.dwThreadId, KillWindowsProc, 0); Sleep(500); GetExitCodeProcess(pi.hProcess, &exitcode); @@ -690,7 +695,9 @@ int main(int argc, char **argv) return 0; } catch (std::runtime_error &e) { - printf("Fehler: %s\n", e.what()); + char Message[255]; + sprintf(Message,"Failure: %s\n", e.what()); + MessageBox(NULL,Message,"Exception",MB_OK); return -1; } } |