Kidnap
Video Capture Help ] AVIFile Tutorial ] Licensing and Distribution ] Resources ] Awards ] Latest News ] Source Code ] Free Controls ]

 

Cross-Process Window Message Example
Download (8k) VB source here!

This is a really interesting sample VB5 project. Run this and you will see a "target" icon on an empty MDI form. Click and drag the "target" to any running app (notepad.exe or calc.exe for example). Kidnap will grab the external app, steal it's menu and make it a "child" window. I went so far as to make the menus functional in this demo, but until I learn more about cross-process subclassing, you are on your own if you want to subclass the external child window. *note* this sample uses subclassing which can cause problems in the VB IDE during break mode. If you want to step through the code, please comment out the SetWindowLong() statement in MDIForm_Load() and MDIForm_UnLoad() first.

Techniques demonstrated in this project
---------------------------------------
-Extensive use of Windows API functions to enhance VB
-Subclassing an MDIForm in native VB5
-Handling mouse coordinates outside a form
-Returning info about a user-selected window at runtime
-Communicating and sending commands across process-boundaries (using menus)


Useful functions in mKidnap.bas
--------------------------------
vbMakeChildWindow
vbGetClassName
vbGetTopLevelParent

You may freely use and modify this code in your
own programs. However, you may not redistribute
this archive without permission from Ray Mercer
<raymer@shrinkwrapvb.com>

Copyright (c) 1998-2000, Ray Mercer - All Rights Reserved