Sign in to follow this  
Followers 0
Traddles

drawing on another applications window

5 posts in this topic

I want to write a script that involves drawing on another applications window (or at least giving the appearence of doing so) is there a way to do this, or a way to make my window invisible (so I can see through it to what's behind it) and just draw visibly on my window?

Share this post


Link to post
Share on other sites



I want to write a script that involves drawing on another applications window (or at least giving the appearence of doing so) is there a way to do this, or a way to make my window invisible (so I can see through it to what's behind it) and just draw visibly on my window?

Fairly simple. You'll need Auto3Lib for the API calls:

#include <A3LWinAPI.au3>

Global $hWnd, $hDC, $tRect

Run("Notepad.exe")
_Lib_WinWaitActive("Untitled - Notepad")
$hWnd  = WinGetHandle("Untitled - Notepad")
if @Error then _Lib_ShowError("Unable to get Notepad window handle")

$hDC = _API_GetDC($hWnd)
$tRect = __tagRECT()
_tagSetData($tRect, "Left"  , 100)
_tagSetData($tRect, "Top"   , 100)
_tagSetData($tRect, "Right" , 400)
_tagSetData($tRect, "Bottom", 160)
_API_DrawText($hDC, "DrawText demo", $tRect, 0)

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

what is A3LWinAPI.au3? I couldn't find any documentation for it or even the actual file.

Edited by Traddles

Share this post


Link to post
Share on other sites

what is A3LWinAPI.au3? I couldn't find any documentation for it or even the actual file.

Look in his signature :whistle:

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

ahhh, I searched around the forums and saw that file, I didn't know that A3LWinAPI.au3 was a part of that package...

thanks for your help guys, I'll have to go mess around with that api for a while.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0