From ab16331d2033c4d550afb238b1dfdc325ef0a5b8 Mon Sep 17 00:00:00 2001 From: Sinus Rollins Date: Tue, 8 Feb 2022 17:39:10 +0100 Subject: [PATCH] Removed some unnecessary stuff, and exits ODT on exit --- ODTKRA/Main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ODTKRA/Main.cpp b/ODTKRA/Main.cpp index 1cbca4d..c901056 100644 --- a/ODTKRA/Main.cpp +++ b/ODTKRA/Main.cpp @@ -1,6 +1,4 @@ -#include #include -#include #include void killODT(int param) @@ -25,7 +23,7 @@ int main() SwitchToThisWindow(hWindowHandle, true); } - Sleep(100); // not sure if needed + Sleep(500); // not sure if needed // Starts ODT ShellExecute(NULL, L"open", L"C:\\Program Files\\Oculus\\Support\\oculus-diagnostics\\OculusDebugTool.exe", NULL, NULL, SW_SHOWDEFAULT); @@ -44,6 +42,10 @@ int main() ShowWindow(hWindowHandle, SW_MINIMIZE); + Sleep(1000); + + hWindowHandle = FindWindow(NULL, Target_window_Name); + HWND PropertGrid = FindWindowEx(hWindowHandle, NULL, L"wxWindowNR", NULL); HWND wxWindow = FindWindowEx(PropertGrid, NULL, L"wxWindow", NULL); @@ -54,9 +56,10 @@ int main() while (true) { SendMessage(wxWindow, WM_KEYDOWN, VK_UP, 0); SendMessage(wxWindow, WM_KEYUP, VK_UP, 0); + Sleep(50); SendMessage(wxWindow, WM_KEYDOWN, VK_DOWN, 0); SendMessage(wxWindow, WM_KEYUP, VK_DOWN, 0); - Sleep(60000); + Sleep(600000); } return 0;