diff options
author | Simon Rettberg | 2019-03-01 10:29:42 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-03-01 10:29:42 +0100 |
commit | bc08232b2b0a3ca62ada8a175b9b6eda0dfdbc50 (patch) | |
tree | 42c6e8adc85a03ff0e59b7a6a84f1bd026e22a04 /core | |
parent | [run-virt] Add printer to UI (diff) | |
download | mltk-bc08232b2b0a3ca62ada8a175b9b6eda0dfdbc50.tar.gz mltk-bc08232b2b0a3ca62ada8a175b9b6eda0dfdbc50.tar.xz mltk-bc08232b2b0a3ca62ada8a175b9b6eda0dfdbc50.zip |
[run-virt] Support setting printer as default by naming it @*
Diffstat (limited to 'core')
-rwxr-xr-x | core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe | bin | 57344 -> 58368 bytes | |||
-rw-r--r-- | core/modules/run-virt/winres/src/winres.c | 19 |
2 files changed, 16 insertions, 3 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe b/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe Binary files differindex 2e0aff80..af1d0bd1 100755 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe diff --git a/core/modules/run-virt/winres/src/winres.c b/core/modules/run-virt/winres/src/winres.c index ca968cda..939739fb 100644 --- a/core/modules/run-virt/winres/src/winres.c +++ b/core/modules/run-virt/winres/src/winres.c @@ -993,9 +993,22 @@ static void postSuccessfulMount(const netdrive_t *d, wchar_t *letter) //int offs = (def ? 1 : 0); TODO } StringCchPrintfW(cmdline, MAX_PATH, L"printui.dll PrintUIEntry /q /in /n \"%s\"", wUncPath); - // TODO: Make sure COM is initialized - ShellExecuteW(NULL, L"open", L"rundll32", cmdline, NULL, SW_HIDE); - // TODO: Set default; need to wait for install to finish + SHELLEXECUTEINFOW e = {0}, f = {0}; + e.cbSize = sizeof(e); + e.lpFile = L"rundll32"; + e.lpParameters = cmdline; + e.nShow = SW_HIDE; + f = e; // Copy struct before we set the following flag for the first one + e.fMask = SEE_MASK_NOCLOSEPROCESS; // So we can wait for the first one + ShellExecuteExW(&e); + if (def) { // Only actually do so if we want to set it as default + WaitForSingleObject(e.hProcess, INFINITE); + } + CloseHandle(e.hProcess); + if (def) { + StringCchPrintfW(cmdline, MAX_PATH, L"printui.dll PrintUIEntry /q /y /n \"%s\"", wUncPath); + ShellExecuteExW(&f); + } } } |