![]() Or, if you’d rather simply copy and paste it into a package of your own, here it is in long form. ![]() You can download the completed source code for this project here: reticle Otherwise, stick around and I’ll walk you through how to build this component… ![]() ![]() If you just want to get to the solution, go ahead and skip down to the “ completed source” heading and grab the source-code. Move the reticle over some other window, and Spy++ reads out the window handle, class name and caption, along with a small bunch of other information.Īs I want this functionality in my own application, I decided to build a custom control to reproduce this behavior. When you click on the icon and hold down your mouse pointer, the little targeting reticle becomes detached from the icon and tracks your mouse. Spy++ has a “Find Window” dialog which contains this icon: If you’ve ever used Microsoft’s Spy++ tool (which comes with professional editions of visual studio), you’ll know precisely what I mean when I describe this reticle. Each time, I have to decide how I’m going to get the target window handle in order to send messages to it, and on many occasions the best approach is to provide the application user with a reticle for locating the target window. It can be useful for automating the target application, or even as a primitive form of Inter-process communication. Over the years, I don’t think I can count the number of times that I’ve wanted to send window messages to some other application.
0 Comments
Leave a Reply. |