Sign in to follow this  
Followers 0
Juggernaut

3 quick questions

5 posts in this topic

I have my GUI, and I am wondering:

A) How can i make the background of the GUI transparent?

:P How can I make the window always on top?

C) How can i use the pixelsearch function to scan for pixels ONLY in MY GUI?

Thanks!

Share this post


Link to post
Share on other sites



Open the helpfile that came with AutoIt, click on the index tab and look for these functions:

WinSetTrans() <--set the transparency of any window.

WinSetOnTop() <--need i explain?

and as for the pixelsearch thing, if you look ast the pixelsearch function you will see that there is a hWnd parameter. Pass the handle to your GUI to this parameter when using the PixelSearch function and also stick this to the top of your script:

Opt("PixelCoordMode", 2)

hope this helped.


Click here for the best AutoIt help possible.Currently Working on: Autoit RAT

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Ah, yes, helped alot :P

But one question, i am setting the x and y of the search range, how would i be able to get the form width and height?

like:

$color = PixelSearch(0, 0, FORMWIDTH?, FORMHEIGHT?, etc..)

Also:

The transparency, i am looking to get just the background of the form transparent, not the whole form

Edited by Juggernaut

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Can anyone give me a hand with the PixelSearch part? That is my main concern

Here is my code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("PixelCoordMode", 2)


Example1()

; example 1
Func Example1()
    Local $msg

    $gui = GUICreate("HP", 120, 20, 10, 10); will create a dialog box that when displayed is centered
    GUISetState(@SW_SHOW); will display an empty dialog box

   ; Run the GUI until the dialog is closed
    While 1
        WinSetOnTop("HP","",1)
        WinSetTrans("HP", "", 100)
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
    Exit
EndFunc  ;==>Example1

While True
        $lPos = PixelSearch(0, 0, GUI??, GUI??, 0xE36C70, 1, 1, "HP")
       
        If IsArray($lPos) And Not @error Then
        ;Beep(1000, 2)
        Else
        ;Beep(1000, 2)
            MsgBox(1,"no","Cant find color!")
       EndIf
WEnd
Edited by Juggernaut

Share this post


Link to post
Share on other sites

Can anyone give me a hand with the PixelSearch part? That is my main concern

Here is my code:

#include <GUIConstantsEx.au3>
 #include <WindowsConstants.au3>
 Opt("PixelCoordMode", 2)
 
 
 Example1()
 
; example 1
 Func Example1()
     Local $msg
 
     $gui = GUICreate("HP", 120, 20, 10, 10); will create a dialog box that when displayed is centered
     GUISetState(@SW_SHOW); will display an empty dialog box
 
   ; Run the GUI until the dialog is closed
     While 1
         WinSetOnTop("HP","",1)
         WinSetTrans("HP", "", 100)
         $msg = GUIGetMsg()
         If $msg = $GUI_EVENT_CLOSE Then ExitLoop
     WEnd
     GUIDelete()
     Exit
 EndFunc ;==>Example1
 
 While True
         $lPos = PixelSearch(0, 0, GUI??, GUI??, 0xE36C70, 1, 1, "HP")
        
         If IsArray($lPos) And Not @error Then
        ;Beep(1000, 2)
         Else
        ;Beep(1000, 2)
             MsgBox(1,"no","Cant find color!")
        EndIf
 WEnd
PixelSearch needs a window handle not a title. The width and height of a window can be obtianed from WinGetPos.

$wpos = WinGetPos($gui)
.
.
.
$lPos = PixelSearch(0, 0, $wpos[2],$wpos[3], 0xE36C70, 1, 1, $gui)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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