Jump to content

Writing over the screen


Recommended Posts

I'm working on a script that will draw lines over a full screen program and make the line  stay there. Is it possible to do that?

<{POST_SNAPBACK}>

Try looking up the GUICtrlCreateLine script that was written a while ago. If you make a transparent window overlay, I'm sure you could draw the GUI lines on it.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

this example uses DllCall() to draw on a window....

Opt("WinWaitDelay",1)
Opt("WinTitleMatchMode",4)

Send("#r")
WinWait("Run")
$hwnd = WinGetHandle("Run","")
for $i = 1 to 10
OutlineControl("Run","","Static1",0xFFFF00)
Sleep(500)
DLLCall("user32.dll","int","InvalidateRect","hwnd",$hwnd,"int",0,"int",1)
sleep(250)
next
for $i = 1 to 10
OutlineControl("Run","","Button1",0xFF00FF)
Sleep(500)
DLLCall("user32.dll","int","InvalidateRect","hwnd",$hwnd,"int",0,"int",1)
sleep(250)
Next
for $i = 1 to 10
OutlineControl("Run","","Button2",0x00FF00)
Sleep(500)
DLLCall("user32.dll","int","InvalidateRect","hwnd",$hwnd,"int",0,"int",1)
sleep(250)
Next
for $i = 1 to 10
OutlineControl("Run","","Button3",0xFF0000)
Sleep(500)
DLLCall("user32.dll","int","InvalidateRect","hwnd",$hwnd,"int",0,"int",1)
Sleep(250)
Next
Func OutlineControl($l_szTitle,$l_szText,$l_szControl,$color)
   $l_hWnd = ControlGetHandle($l_szTitle,$l_szText,$l_szControl)
   $l_hWndDad = WinGetHandle($l_szTitle,$l_szText)
 $l_rect = ControlGetPos($l_szTitle,$l_szText,$l_szControl)
   $l_hdc = DLLCall("user32.dll","int","GetDC","hwnd",$l_hWndDad)
   $pen = DLLCall("gdi32.dll","int","CreatePen","int",0,"int",10,"int",$color)
   DLLCall("gdi32.dll","int","SelectObject","int",$l_hdc[0],"int",$pen[0])
   DLLCall("gdi32.dll","int","MoveToEx","int",$l_hdc[0],"int",$l_rect[0],"int",$l_rect[1],"int",0);startpos x/y
   DLLCall("gdi32.dll","int","LineTo","int",$l_hdc[0],"int",$l_rect[0] + $l_rect[2],"int",$l_rect[1]);top line
   DLLCall("gdi32.dll","int","LineTo","int",$l_hdc[0],"int",$l_rect[0] + $l_rect[2],"int",$l_rect[1]+$l_rect[3]);right line
   DLLCall("gdi32.dll","int","LineTo","int",$l_hdc[0],"int",$l_rect[0],"int",$l_rect[1]+$l_rect[3]);bottom line
   DLLCall("gdi32.dll","int","LineTo","int",$l_hdc[0],"int",$l_rect[0],"int",$l_rect[1]);left line
   Sleep(150)

 $l_hdc = DLLCall("user32.dll","int","ReleaseDC","hwnd",$l_hWndDad,"int",$l_hdc[0])
EndFunc
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

  • 3 years later...

Writing over the screen.au3 (38) : ==> Subscript used with non-Array variable.:

DLLCall("gdi32.dll","int","MoveToEx","int",$l_hdc[0],"int",$l_rect[0],"int",$l_rect[1],"int",0)

DLLCall("gdi32.dll","int","MoveToEx","int",$l_hdc[0],"int",$l_rect^ ERROR

>Exit code: 1 Time: 8.787

Link to comment
Share on other sites

Excuse me... what about the graphics control and GDIPlus ?

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

  • Developers

Writing over the screen.au3 (38) : ==> Subscript used with non-Array variable.:

DLLCall("gdi32.dll","int","MoveToEx","int",$l_hdc[0],"int",$l_rect[0],"int",$l_rect[1],"int",0)

DLLCall("gdi32.dll","int","MoveToEx","int",$l_hdc[0],"int",$l_rect^ ERROR

>Exit code: 1 Time: 8.787

You forgot to ask a question so doubt if you get any good answers.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...