Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/26/2022 in all areas

  1. @mLipokGenerally, you shouldn't need to worry about that because the webdriver handles this automatically for you. However, you should be able to do it with _WD_ExecuteScript and Javascript.
    1 point
  2. Try this : #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Global Const $AlphaKey = 0xFFFFFF $hGUI = GUICreate("GUI", 294, 69, 192, 124) $idProgressBar = GUICtrlCreateProgress(8, 24, 278, 17) $hGUI_c = GUICreate("", 50, 17, (8+278-50)/2, 24, $WS_POPUP,$WS_EX_LAYERED+$WS_EX_TRANSPARENT+$WS_EX_MDICHILD, $hGUI) GUISetBkColor($AlphaKey, $hGUI_c) $idLabel = GUICtrlCreateLabel("0", 0, 0, 50, 17, $SS_CENTER) GUICtrlSetFont(-1, 10) _WinAPI_SetLayeredWindowAttributes($hGUI_c, $AlphaKey) GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOWNA, $hGUI_c) For $i = 0 To 50 GUICtrlSetData($idProgressBar, $i*2) GUICtrlSetData($idLabel, $i*2 & " %") Sleep(100) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
    1 point
  3. human, (What does that make the rest of us, I wonder? ) I ran across the same problem a while ago. The trick is to use WinSetState to hide the first GUI after having created it with GUISetState. So the first script becomes: #include <GUIConstantsEx.au3> #include <GuiButton.au3> #include <WindowsConstants.au3> Opt("GUIResizeMode", 0) Opt("GUICoordMode", 1) Opt("GUIOnEventMode", 1) Opt("TrayAutoPause", 0) Dim $MAIN_GUI = GUICreate("TestClient", 540, 40, 120, 40, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $ws_popup), $WS_EX_TOPMOST) Dim $Button = GUICtrlCreateButton("Button", 5, 5, 220, 30) GUICtrlSetOnEvent($Button, "testfunc") GUICtrlSetBkColor($Button, 0x00FF00) GUICtrlSetFont($Button, 16) Dim $Status_Feld = GUICtrlCreateLabel("", 230, 10, 300, 20) GUICtrlSetFont($Status_Feld, 14) ;GUISetCoord(826, 947) GUISetState(@SW_SHOW) WinSetState($MAIN_GUI, "", @SW_HIDE) While 1 ;$msg = GUIGetMsg() ; GUIGetMsg does not woork in OnEvent mode! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;If $msg = $Button Then testfunc() Sleep(10) WEnd Func testfunc() MsgBox(1, "test", "test") EndFunc ;==>testfuncI have also tidied it up a bit. There is no point in using GUIGetMsg when you have set OnEvent mode - read the Help file to find out why! But you must put something in the loop to prevent CPU at 100% usage - Sleep(10) will do nicely. I also wondered why you had used GUISetCoord as the Help file says it is "To be used specifically in Opt ("GUICoordMode", 2)" and you have set Opt("GUICoordMode", 1). Anyway, I hope this helps. Ask if anything is unclear. M23 Edit: Welcome to the AutoIt forums, by the way!
    1 point
×
×
  • Create New...