Jump to content

drawing on another applications window


Traddles
 Share

Recommended Posts

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?

Link to comment
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
Link to comment
Share on other sites

  • Moderators

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

Look in his signature :whistle:

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...