Click here to Skip to main content
15,896,111 members
Articles / Desktop Programming / MFC

MS Spy++ style Window Finder

Rate me:
Please Sign up or sign in to vote.
4.84/5 (43 votes)
9 Jul 2002CPOL11 min read 458.9K   26.5K   211  
Ever wondered how the cool Microsoft Spy++ Window Finder Tool is created ? Here is one possible implementation.

#ifndef WINDOW_FINDER_H
  #define WINDOW_FINDER_H

#include <windows.h>

long StartSearchWindowDialog (HWND hwndMain);

BOOL CheckWindowValidity (HWND hwndDialog, HWND hwndToCheck);

long DoMouseMove 
(
  HWND hwndDialog, 
  UINT message, 
  WPARAM wParam, 
  LPARAM lParam
);

long DoMouseUp
(
  HWND hwndDialog, 
  UINT message, 
  WPARAM wParam, 
  LPARAM lParam
);

BOOL SetFinderToolImage (HWND hwndDialog, BOOL bSet);

BOOL MoveCursorPositionToBullsEye (HWND hwndDialog);

long SearchWindow (HWND hwndDialog);

long DisplayInfoOnFoundWindow (HWND hwndDialog, HWND hwndFoundWindow);

long RefreshWindow (HWND hwndWindowToBeRefreshed);

long HighlightFoundWindow (HWND hwndDialog, HWND hwndFoundWindow);

BOOL CALLBACK SearchWindowDialogProc
(
  HWND hwndDlg, // handle to dialog box 
  UINT uMsg, // message 
  WPARAM wParam, // first message parameter 
  LPARAM lParam // second message parameter 
); 

#endif


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems Engineer NEC
Singapore Singapore
Lim Bio Liong is a Specialist at a leading Software House in Singapore.

Bio has been in software development for over 10 years. He specialises in C/C++ programming and Windows software development.

Bio has also done device-driver development and enjoys low-level programming. Bio has recently picked up C# programming and has been researching in this area.

Comments and Discussions