mahxds

Hover Button above other Applications

2 posts in this topic

Hello,
 
im Trying to get a Button shown above an other Application.
That itself is not a problem. The problem is that , that this Application can have more then 1 window open, and i want to run the script continuously in the background.
I want that Button only shown when that Window is active . 

1st Problem

So far, that Button is only Shown when i Switch to a Window that begins with "Target:". After that its shown on every Window.

So i tried to but a If clause into the While loop. Well first it seemed to work, but once i switch from a non Traget window , to a Target window, it seems to get stuck in the Loop, and loads like 5 secs over and over again, and shows then the button normally.

Why is that so ?

2nd Problem

Once i try to click the Button.... nothing happens....

hope anyone can see the mistake i made there :s

Thanks

greets

mahxds

Winactive("Target") Then 
GUISetState(@SW_SHOW)
else
GUISetState(@SW_HIDE)
EndIF
 
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ColorConstants.au3>
#include <MsgBoxConstants.au3>
 
WinWaitActive("TARGET:")
$pos_A = WinGetPos("TARGET:")
$hGui = GUICreate("", 100, 25, 0,0, $WS_POPUP)
$Button = GUICtrlCreateButton("Pictures", 0, 0, 100, 25) 
GUICtrlSetBkColor($Button, $COLOR_YELLOW)
GUISetState(@SW_SHOW) 
AdlibRegister('_WinMove', 10)
WinSetOnTop($hGui,"",1) 
 
 
Func _WinMove()
        $p_A = WinGetPos("[ACTIVE]")
        WinMove($hGui, "", $p_A[0]+$p_A[2] - 365, $p_A[1] + $p_A[3]-0)
EndFunc   ;==>_WinMove
 
 
 
 
; Run the GUI until the dialog is closed
 
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
    Case $Button
MsgBox($MB_SYSTEMMODAL, "fsfsdfs", "The file exists.")
 
EndSwitch
WEnd

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