Device misdetected as serial mouse

I just encountered this problem myself on Windows 7 Professional x64, and a solution that worked for me was to go into the registry and edit the following value: Location: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\sermouse Key: Start Value: 3 Change Value to 4 and it will stop this problem occurring. Here is a list of all valid Start values: … Read more

What is dll hijacking?

The basics are simple. Windows has a search path for DLLs, much the same way it has a $PATH for finding executables. If you can figure out what DLLs an app requests without an absolute path (triggering this search process), you can then place your hostile DLL somewhere higher up the search path so it’ll … Read more

How do I tell CMake to use Clang on Windows?

You also need – in addition to the Clang compilers itself – an build/link environment for Windows. The latest CMake 3.6 builds do have several integrated supported Clang build environments on Windows (e.g. Visual Studio, Cygwin; see Release Notes). I’ve just run a successful test with LLVM-3.9.0-r273898-win32.exe from cmake-3.6.0-rc4-win64-x64.msi from Microsoft VS2015 Community … Read more

How can I get the child windows of a window given its HWND?

Here you have a working solution: public class WindowHandleInfo { private delegate bool EnumWindowProc(IntPtr hwnd, IntPtr lParam); [DllImport(“user32”)] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr lParam); private IntPtr _MainHandle; public WindowHandleInfo(IntPtr handle) { this._MainHandle = handle; } public List<IntPtr> GetAllChildHandles() { List<IntPtr> childHandles = new List<IntPtr>(); GCHandle gcChildhandlesList = GCHandle.Alloc(childHandles); IntPtr … Read more

How to get PID of process just started from within a batch file?

This is an old post but I think that it worth to share the following ‘easy to use’ solution which works fine nowadays on Windows. Start multiple processes in parallel: start “<window title>” <command will be executed> Example: start “service1” mvn clean spring-boot:run start “service2” mvn clean spring-boot:run Obtain the PID of the processes (optional): … Read more

Get error code from within a batch file

Sounds like you’ll want the “If Errorlevel” command. Assuming your executable returns a non-0 exit code on failure, you do something like: myProgram.exe if errorlevel 1 goto somethingbad echo Success! exit :somethingbad echo Something Bad Happened. Errorlevel checking is done as a greater-or-equal check, so any non-0 exit value will trigger the jump. Therefore, if … Read more