Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build a screenmate programmatically?

Tags:

c#

I would like to know how to build an screenmate.

Something like this:

Example # 1: http://www.youtube.com/watch?v=SHvDOPkGQqE

Example # 2: http://www.youtube.com/watch?v=5tHpmeZseIs

Example # 3: http://www.viddler.com/explore/myvirtuallady/videos/5/

I guess that there has to be a way to do it, but I don't know how.

Can this be done using some Microsoft frameworks? Maybe with C#?


1 Answers

To draw the screenmate itself you can use a normal Form that has no border and a TransparencyKey color to make the background transparent. You can then draw the animation by overriding OnPaint().

To get it to react to other windows like in the first video is a bit trickier, and requires some pinvoke into user32.dll. The function FindWindow gets the handles of other windows and GetWindowRect will let you get their position and sizes so you can write some code that makes the screen mate react to them.

like image 140
Sploofy Avatar answered Dec 04 '25 23:12

Sploofy