summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-08 12:26:08 +0100
committerSimon Rettberg2016-01-08 12:26:08 +0100
commit5d86711b2cfcd2ca77fa00fba0a98783df4b8334 (patch)
tree5912f72b40ebe634348f3c84b2059bd002b4c384 /remote/modules
parentPreparations for exam mode (diff)
downloadtm-scripts-5d86711b2cfcd2ca77fa00fba0a98783df4b8334.tar.gz
tm-scripts-5d86711b2cfcd2ca77fa00fba0a98783df4b8334.tar.xz
tm-scripts-5d86711b2cfcd2ca77fa00fba0a98783df4b8334.zip
[run-virt] openslx.exe: Hide console, re-set logoff caption periodically
Diffstat (limited to 'remote/modules')
-rwxr-xr-xremote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exebin14848 -> 15360 bytes
-rw-r--r--remote/modules/run-virt/winres.c37
2 files changed, 31 insertions, 6 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe
index eec60c3a..a1616798 100755
--- a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe
+++ b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe
Binary files differ
diff --git a/remote/modules/run-virt/winres.c b/remote/modules/run-virt/winres.c
index 1af91d33..a9037b61 100644
--- a/remote/modules/run-virt/winres.c
+++ b/remote/modules/run-virt/winres.c
@@ -18,7 +18,12 @@ static int setResolution();
static int muteSound();
static int setShutdownText();
-int main(int argc, char ** argv)
+static void CALLBACK resetShutdown(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+{
+ setShutdownText();
+}
+
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
int ret;
/*
@@ -41,14 +46,34 @@ int main(int argc, char ** argv)
OSVERSIONINFO version;
version.dwOSVersionInfoSize = sizeof(version);
BOOL retVer = GetVersionEx(&version);
+ // Set resolution to what HOSTRES.TXT says
setResolution();
+ // Mute sound by default
if (retVer && version.dwMajorVersion >= 6)
muteSound();
- ret = setShutdownText();
- char buffer[100];
- snprintf(buffer, 100, "Returned %d", ret);
- if (ret != 0)
- MessageBoxA(0, buffer, "Set caption", 0);
+ // Shutdown button label
+ if (retVer && version.dwMajorVersion == 6 && version.dwMinorVersion == 1) {
+ // Only on Windows 7
+ char buffer[100];
+ ret = setShutdownText();
+ if (ret != 0) {
+ snprintf(buffer, 100, "Returned %d", ret);
+ MessageBoxA(0, buffer, "Set caption", 0);
+ }
+ // Repeatedly set caption
+ UINT_PTR tRet = SetTimer(NULL, 0, 5000, (TIMERPROC)&resetShutdown);
+ if (tRet == 0) {
+ snprintf(buffer, 100, "Could not create timer: %d", (int)tRet);
+ MessageBoxA(0, buffer, "SetTimer", 0);
+ return 0;
+ }
+ // Message pump
+ MSG Msg;
+ while(GetMessage(&Msg, NULL, 0, 0) > 0) {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
+ }
return 0;
}