This is a mirror of official site: http://jasper-net.blogspot.com/

Add Your Control On Top Another Application

| Monday, May 10, 2010
image_thumb_520ED5EB.png

Couple of days ago I got an email asked me to help with creating a buttons on top all open applications, this has reminded me the CodedUI Recorder.
As you can see from the picture when using CodedUI Testing you will see the “Currently Recording” notification on every active application you are recording.

How?

The design is to make the title bar window of the target application as the parent\owner window of the Control your want to add.
But this is not enough, we need to listen to many events like size change, style etc.. but I’ll get there later.
Here is what we need to do:

Find window handle with FindWindow
Get window position and title bar info using GetTitleBarInfo
Set window as owner\parent using SetWindowLong
SetWinEventHook for couple of events of the target application.

Read more: Shai Raiten Part 1, Part 2

Posted via email from jasper22's posterous

0 comments: