mahxds Posted February 11, 2015 Posted February 11, 2015 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
orbs Posted February 13, 2015 Posted February 13, 2015 hello mahxds, welcome to the AutoIt forum! i can't help in specific, but i think you can get some leads from this: '?do=embed' frameborder='0' data-embedContent>> Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates WinPose - simultaneous fluent move and resize Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Magic Math - a math puzzle Demos: Title Bar Menu - click the window title to pop-up a menu
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now