WM_KILLFOCUS debugging is impossible

Viewed 76

I have in my Win32 application WM-KILLFOCUS hanging procedure. If I try to debug and test them proper function, windows lost focus on each breakpoints. Because focus gets Visual Studio window. Is here some way, how debugging application without focus losing? (The same problem is with mouse moving, etc.)

1 Answers

Sorry about the late reply - I've been v busy - but here's a brief writeup about how to debug in a VM (as per the comments above).

  1. Download and install suitable VM software on your development machine. I use VMware Player. This is free for non-commercial use, but if you are using it in a commercial setting please buy a copy (it is not expensive).

  2. Create a new Virtual Machine, configured roughly as follows:

  • memory 6GB or so (hopefully you can spare that much)

  • disk space 100GB (don't worry if this sounds overly large - the file that backs the virtual disk will grow as needed)

  • network adapter bridged (important!)

  1. Install Windows in the VM - from an ISO image (you can use Microsoft's Media Creation Tool to do this). This need to be Windows 10, VMware Player doesn't support Windows 11.

  2. Once that is up and running, install the Visual Studio Remote Debuggung Tools in the VM.

  3. Copy your binary/ies (and maybe your .PDB file/s, I don't recall if these are needed) to the VM.

  4. Launch your app in the VM and fire up the remote debugging tools there. Then configure these for 'no security' (this makes it easier to establish a connection, and, since you're presumably in a secure environment, it's safe enough).

  5. Connect to the Remote Debugger running in the VM from VS on the host machine. You will need to know the VM's IP address (you can find out what that is by running ipconfig in the VM).

  6. In VS, select the application to debug.

You should now be up and running and you should have all the awesome features of the VS debugger available to you. Any problems or questions, please feel free to ask (the last few steps are a bit hazy in my mind, but I've done my best and if you can't find your way through it I'll research this a bit more).

Good luck!

Related