Sign in to follow this  
Followers 0

zoom inside my gui

1 post in this topic

Hi im stuck on trying to zoom inside this gui, any experts on this area?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <WinAPI.au3>
Opt("GUIResizeMode", $GUI_DOCKAUTO)
Local $oIE = _IECreateEmbedded()

GUICreate("Embedded Web control Test", 1500, 700, _
(@DesktopWidth - 1500) / 2, (@DesktopHeight - 700) / 2, _

GUICtrlCreateObj($oIE, 0, 20, 1500, 670)
Local $GUI_Button_Home = GUICtrlCreateButton("Refresh", 0, 0, 1500, 20)

GUISetState(@SW_SHOW) ;Show GUI
_IENavigate($oIE, "")



; Waiting for user to close the window
While 1
    Local $msg = GUIGetMsg()
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $GUI_Button_Home



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

  • Similar Content

    • Jibberish
      By Jibberish
      I am automating the testing of a video player. I search a file for ".mp4" and want to create a GUI with radio buttons to select what video to play. The number of videos can change based on the user's library so this must be created automatically.  I have searched for how to accomplish this and there are several posts out there that help a little but I can't figure out the solution. I pulled the offending code from my main script and created the file below to make this easier to read. I am sure one of our experts here can help!
      #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <array.au3> #include <File.au3> #include <GUIConstantsEx.au3> Local $sMediaFile = "D:\MediaFiles\MediaFiles.txt" Local $iStrReturn = 0 Local $aText Local $aArrayFile Local $iMax = 6 ;Default number of Videos - 1 for the array counter Local $aVideoName[$iMax] = [0] Local $sCheckBox1 Local $iT = 0, $iVideoCount = 0, $iCount Local $ix = 0 Local $iy = 0 Local $idClose1 Const $iL = 10 ; Count from Left for GUI so all buttons line up ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Read a list of video file names and create a GUI with Radio Buttons to select a single video. ; Problem: We don't know how many video names will be in the text file, so we can't hard code Case Statements & their variables ; Put the Video File Names into an Array _FileReadToArray($sMediaFile, $aArrayFile) For $a = 1 To $aArrayFile[0] ; Step through the array looking for .mp4 If StringInStr($aArrayFile[$a], ".mp4") Then $iVideoCount = $iVideoCount + 1 $aText = StringSplit($aArrayFile[$a],"\\") ; This video player reads double backslashes For $a1 = 1 to $aText[0] ; Check that the array is big enough If StringInStr($aText[$a1], ".mp4") Then ;MsgBox(0,"","Video is " & $aText[$a1]) If UBound($aVideoName) = $iVideoCount Then ; Resize the array when $iCount is equal to the element count in the array to prevent subscript error ReDim $aVideoName[$aVideoName[0] + $iMax] EndIf $aVideoName[$iVideoCount] = $aText[$a1]; add data to new index element $aVideoName[0] = $a1 ; update the index count for future reference ; The idea is to create a GUI width to accommodate long video file names $it = StringLen($aVideoName[$iVideoCount]) If $iT > $ix Then $ix = $iT EndIf EndIf Next EndIf Next ; Move backwards through the array deleting blank rows For $iCount = UBound($aVideoName) - 1 To 0 Step -1 If $aVideoName[$iCount] = "" Then _ArrayDelete($aVideoName, $iCount) EndIf Next ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Create the GUI - Names and Radio Button counts will vary - How do I do this? ; ;_ArrayDisplay($aVideoName) ;Local $aVarName[$aVideoName[0]] Local $iRows = UBound($aVideoName, $UBOUND_ROWS) $iRows = $iRows -1 $aVideoName[0] = $iRows ; Prep the GUI to display the FileNames with Radio Buttons - Can only select one at a time. $a = 0 $ix = $ix + 200 $iy = ($aVideoName[0] * 30) + 60 $hGUI = GUICreate("Videos", $ix, $iy) ;$iT = $iT+30 ; Create the variable names for the Case statement - Video count may change so Video Names displayed and GUICtrlCreateRadio count may change. ;~ For $a = 1 to $aVarName[0] ;~ If UBound($aVarName) = $aVarName Then ;~ ; Resize the array when $iCount is equal to the element count in the array to prevent subscript error ;~ ReDim $aVarName[$aVarName[0] + $iMax] ;~ EndIf ;~ Assign("$bVideoName" & $a, $a) ;~ Local $aVarName[$a] = Eval($bVideoName[$a]) ;~ ; $aVarName[$a] = GUICtrlCreateRadio($aVarName[$a], $iL, $iT) ;~ Next $iCount = 1 ;MsgBox(0,"","VideoName[0] is "&$aVideoName[0]) ;_ArrayDisplay($aVideoName) Local $bVideoName1 If $iCount < $aVideoName[0] Then $bVideoName1 = GUICtrlCreateRadio($aVideoName[$iCount], $iL, $iT) GUICtrlSetState($bVideoName1, $GUI_CHECKED) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0]) Then Local $bVideoName2 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0]) Then Local $bVideoName3 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0]) Then Local $bVideoName4 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0] -1) Then Local $bVideoName5 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0] -1) Then Local $bVideoName6 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0] -1) Then Local $bVideoName7 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iT = $iT + 30 $idClose1 = GUICtrlCreateButton("Go!", $iL, $iT) GUISetState(@SW_SHOW) ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Switch Statement ; ;Local $nMsg = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $bVideoName1 Case $bVideoName2 Case $bVideoName3 Case $bVideoName4 Case $bVideoName5 ;Case $bVideoName6 <- Fails because there are only 5 videos - Need variable $bVideoNames ;Case $bVideoName7 <- Fails because there are only 5 videos Case $idClose1 $bVideoName1 = GUICtrlRead($bVideoName1) $bVideoName2 = GUICtrlRead($bVideoName2) $bVideoName3 = GUICtrlRead($bVideoName3) $bVideoName4 = GUICtrlRead($bVideoName4) $bVideoName5 = GUICtrlRead($bVideoName5) ;$bVideoName6 = GUICtrlRead($bVideoName6) ;$bVideoName7 = GUICtrlRead($bVideoName7) ExitLoop EndSwitch WEnd GUIDelete($nMsg) MsgBox(0,"","Case " & $nMsg & " was selected.") ; Always returns 8. ??? This is the "MediaFiles.txt" file I am reading:
      D:\\MediaFiles\\BigBuckBunny.mp4 D:\\MediaFiles\\BigBuckBunny60fps.mp4 D:\\MediaFiles\\Sintel.mp4 D:\\MediaFiles\\sintel-2048-surround.mp4 D:\\MediaFiles\\TearsOfSteel.mp4 D:\\MediaFiles\\tearsofsteel_4K.mp4 I'm sure I have several mistakes (or poor coding methods) in my AutoIt file.
    • Skeletor
      By Skeletor
      Hi All,
      I know many newbies search for this feature.
      I decided to share this piece of code with everyone.
      Basically its a "splash screen" that has a transparent image.
      In a nutshell - Gui with a transparent gif.
      Download attachment....
      Splash Screen
    • Skeletor
      By Skeletor
      Hi Developers,
      While trying to find a way to actually style/skin the GUICtrlCreateTabItem, I read the help file and stated:
      My question to you guys is will this be updated? or am I hoping for something that will never come to pass?
      I've seen scripts between 2007 to 2009 allowing the tabs to be modified
      Reason for my question is I'm trying to make my GUI Tabs look more modern.
      Thanks in advance for reading my post.
    • Jibberish
      By Jibberish
      I am trying to get the results of a radio button selection. I have tried implementing sample scripts but to no avail.
      Can someone tell / show me what I am doing wrong?
      #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Local $bSelect1 Local $bSelect2 Local $bSelect3 SelectButton() ;The results of SelectButton is not being returned MsgBox(0,"","Select1 is "& $bSelect1 & ". Select2 is "& $bSelect2 & ". Select3 is "& $bSelect3 & ".") Func SelectButton() Local $hGUI = GUICreate("SGX4CP Tests", 300, 300) GUISetState() Local $bSelect1 = GUICtrlCreateRadio("Select 1", 10, 160) Local $bSelect2 = GUICtrlCreateRadio("Select 2", 10, 190) Local $bSelect3 = GUICtrlCreateRadio("Select 3", 10, 220) ; Set TestSelectForever as the default radio button GUICtrlSetState($bSelect1, $GUI_CHECKED) Local $idClose = GUICtrlCreateButton("Start", 120,250) Local $idMsg While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE Or $idMsg = $idClose ExitLoop Case $idMsg = $bSelect1 And BitAND(GUICtrlRead($bSelect1), $GUI_CHECKED) = $GUI_CHECKED MsgBox(0,"","Select1") Case $idMsg = $bSelect2 And BitAND(GUICtrlRead($bSelect2), $GUI_CHECKED) = $GUI_CHECKED MsgBox(0,"","Select2") Case $idMsg = $bSelect3 And BitAND(GUICtrlRead($bSelect3), $GUI_CHECKED) = $GUI_CHECKED MsgBox(0,"","Select3") ; GUICtrlRead($hGUI) EndSelect WEnd MsgBox(0,"","Select1 is "& $bSelect1 & ". Select2 is "& $bSelect2 & ". Select3 is "& $bSelect3 & ".") ; Why is this returning numbers? EndFunc  
    • jonson1986
      By jonson1986
      I'm trying to select language from drop-down menu on a webpage by _IEGetObjById but it's  not working, It mean autoit open the page but unable to select my desired value not even by matching text or by value, I'm looking for kind help...I've pastes my Autoit codes below along with source codes(using ie) of the webpage ;
      #include <IE.au3> $site = "" $oIE = _IECreate($site) $oDownloadSamples = _IEGetObjById($oIE, "language") $oDownloadSamplesSelect = _IETagNameGetCollection($oDownloadSamples, "select", "language") $oDownloadSamplesSelect.focus _IEFormElementOptionSelect($oDownloadSamplesSelect, "French", 1, "byText") Sleep (1000) _IEFormElementOptionSelect($oDownloadSamplesSelect, "2", 1, "byValue") HTML Codes using IE:
      <html> <head> <div class="form-row"> <div class="col-7"> <label>Language</label> <select name="language" class="select" id="language"> <option value="1">English</option> <option value="2">French</option> <option value="3">German</option> <option value="4">Italian</option> <option value="5">Japanese</option> <option value="6">Spanish</option> <option value="7">Russian</option> <option value="8">Hindi</option> <option value="9">Arabic</option> <option value="10">Chinese</option> <option value="11">Dutch</option> <option value="12">Finnish</option> <option value="13">Korean</option> <option value="14">Norwegian</option> <option value="15">Portuguese</option> <option value="16">Romanian</option> <option value="17">Serbian</option> <option value="18">Croatian</option> <option value="20">Polish</option> <option value="21">Afar</option> <option value="22">Abkhazian</option> <option value="23">Afrikaans</option> <option value="24">Amharic</option> <option value="25">Assamese</option> <option value="26">Aymara</option> <option value="27">Azerbaijani</option> <option value="28">Bashkir</option> <option value="29">Belarusian</option> <option value="30">Bulgarian</option> <option value="31">Bihari</option> <option value="32">Bislama</option> <option value="33">Bengali/Bangla</option> <option value="34">Tibetan</option> <option value="35">Breton</option> <option value="36">Catalan</option> <option value="37">Corsican</option> <option value="38">Czech</option> <option value="39">Welsh</option> <option value="40">Danish</option> <option value="41">Bhutani</option> <option value="42">Greek</option> <option value="43">Esperanto</option> <option value="44">Estonian</option> <option value="45">Basque</option> <option value="46">Persian</option> <option value="47">Fiji</option> <option value="48">Faeroese</option> <option value="49">Frisian</option> <option value="50">Irish</option> <option value="51">Scots/Gaelic</option> <option value="52">Galician</option> <option value="53">Guarani</option> <option value="54">Gujarati</option> <option value="55">Hausa</option> <option value="56">Hungarian</option> <option value="57">Armenian</option> <option value="58">Interlingua</option> <option value="59">Interlingue</option> <option value="60">Inupiak</option> <option value="61">Indonesian</option> <option value="62">Icelandic</option> <option value="63">Hebrew</option> <option value="64">Yiddish</option> <option value="65">Javanese</option> <option value="66">Georgian</option> <option value="67">Kazakh</option> <option value="68">Greenlandic</option> <option value="69">Cambodian</option> <option value="70">Kannada</option> <option value="71">Kashmiri</option> <option value="72">Kurdish</option> <option value="73">Kirghiz</option> <option value="74">Latin</option> <option value="75">Lingala</option> <option value="76">Laothian</option> <option value="77">Lithuanian</option> <option value="78">Latvian/Lettish</option> <option value="79">Malagasy</option> <option value="80">Maori</option> <option value="81">Macedonian</option> <option value="82">Malayalam</option> <option value="83">Mongolian</option> <option value="84">Moldavian</option> <option value="85">Marathi</option> <option value="86">Malay</option> <option value="87">Maltese</option> <option value="88">Burmese</option> <option value="89">Nauru</option> <option value="90">Nepali</option> <option value="91">Occitan</option> <option value="92">(Afan)/Oromoor/Oriya</option> <option value="93">Punjabi</option> <option value="94">Pashto/Pushto</option> <option value="95">Quechua</option> <option value="96">Rhaeto-Romance</option> <option value="97">Kirundi</option> <option value="98">Kinyarwanda</option> <option value="99">Sanskrit</option> <option value="100">Sindhi</option> <option value="101">Sangro</option> <option value="102">Serbo-Croatian</option> <option value="103">Singhalese</option> <option value="104">Slovak</option> <option value="105">Slovenian</option> <option value="106">Samoan</option> <option value="107">Shona</option> <option value="108">Somali</option> <option value="109">Albanian</option> <option value="110">Siswati</option> <option value="111">Sesotho</option> <option value="112">Sundanese</option> <option value="113">Swedish</option> <option value="114">Swahili</option> <option value="115">Tamil</option> <option value="116">Telugu</option> <option value="117">Tajik</option> <option value="118">Thai</option> <option value="119">Tigrinya</option> <option value="120">Turkmen</option> <option value="121">Tagalog</option> <option value="122">Setswana</option> <option value="123">Tonga</option> <option value="124">Turkish</option> <option value="125">Tsonga</option> <option value="126">Tatar</option> <option value="127">Twi</option> <option value="128">Ukrainian</option> <option value="129">Urdu</option> <option value="130">Uzbek</option> <option value="131">Vietnamese</option> <option value="132">Volapuk</option> <option value="133">Wolof</option> <option value="134">Xhosa</option> <option value="135">Yoruba</option> <option value="136">Zulu</option> <option value="19">Other</option> </select> </div> </main> </body> </html>