Sign in to follow this  
Followers 0
Crazyace

[Solved] Converting from AHK to AU3 - Gui Checkbox

24 posts in this topic

#1 ·  Posted (edited)

Hello everyone,

I'm working on a rather large project for my company and we have ran in to a snag with using AutoHotKey. We use a forked version of it called AHK_L. We ran into some issues with IE8+ and we are wanting to see if AutoIT v3 will help us get past that issue. Here is a scipt that we use that causes issues for us.

What the code below does, is present you with a message box that has an input and 3 options. The option that's not working for us is the driver option. When we run our code we get COM errors in IE8+ but not in IE6 and 7.

So what I would like to do is convert this to AutoIT v3 and see how much coding it takes and what it would look like. So what I plan to do is start posting some of the code that I'm converting in small snipits to make sure that I'm on the right track. I'm not looking for someone to convert the whole script for me, becuase I won't learn anything about AutoIT. I want to thank everyone in advance for any help provided.

CoordMode, ToolTip, Screen
x:= floor(A_ScreenWidth /2)
y:= floor(A_ScreenHeight /2)
ToolTip, 1) Driver/Manual/Warranty Lookup`n2) Driver Grab`n3) PPID Lookup`n4) Diagnostics Lookup`n5) AMT Lookup`n6) Useful Info, x, y
return

1::
Numpad1::
Suspend On
ToolTip,
gui, font, bold, Verdana
Text = Shadowed
Gui -MaximizeBox -MinimizeBox
Gui, Add, Checkbox, Checked vDrivers y+10, Drivers
Gui, Add, Checkbox, vManual x+20, Manual
Gui, Add, Checkbox, vWarranty x+20, Warranty
Gui, Add, Text, y+10 xm, Service Tag#:
Gui, Add, Edit, xp+105 vTag w90
Gui, Add, Button, x60 gSubmit Default, Submit
Gui, Add, Button, xp+110, Cancel
Gui, Show, h90 w280,  System Lookup
GuiControl, Focus, Tag
return

*Lbutton::
Escape::
GuiEscape:
GuiClose:
ButtonCancel:
ExitApp

Submit:
Gui, Submit, Hide
Tag = %Tag%
if ((Drivers = 0 && Manual = 0 && Warranty = 0) || not RegExMatch(Tag, "^([a-zA-Z0-9]{4}|[a-zA-Z0-9]{6})1$"))
{
  errors =
  if not RegExMatch(Tag, "^([a-zA-Z0-9]{4}|[a-zA-Z0-9]{6})1$")
    errors = Service tag must be 5 or 7 alphanumeric characters and end with 1!
  if (Drivers = 0 && Manual = 0 && Warranty = 0)
    errors = You must choose something to look up!`n%errors%
  msgbox,, Input Errors!, %errors%
  return
}

if Drivers = 1
{
  url = http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection
  pwb :=   ComObjCreate("InternetExplorer.Application")
  ;navigates to the url
  pwb.Navigate(url)
  pwb.visible := true
  While ((pwb.readyState <> 4) || pwb.busy)
    ;Sleep, 10
  frame :=   pwb.document.all["iFramePSHost"].contentWindow
  frame.document.all["TheProductSelectorResultsModel_ServiceTagCode"].value := Tag
  frame.document.all.btnSubmit[0].click()
}

if Manual = 1
  run "http://support.dell.com/support/topics/global.aspx/support/my_systems_info/manuals?c=us&l=en&s=biz&~ck=ln&lnki=0&ServiceTag=%Tag%"
if Warranty = 1
  run http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&cs=555&l=en&s=biz&~ck=anavml&ServiceTag=%Tag%

exitapp
Edited by Crazyace

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites



Any takers on this?


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

Don't bump your thread less than 24 hours please. Have you looked at the Help file at all in the last 12 hours?


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Don't bump your thread less than 24 hours please. Have you looked at the Help file at all in the last 12 hours?

Sorry about that, I didn't recall seeing that in the rules. I'll make sure to double check them, because I was about a sleep when posting last night. I checked over the help file but it wasn't much help. One thing that I tried to figure out was how to get to the last option in the "Tooltip". I thought something like
Tooltip("1) Driver" & @CR & "2) Warranty",,,,2)
would work but it just errors. The last option allows it to be in the center of the main montior from what I understand. Edited by Crazyace

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

I mean no disrespect to the members here and your right. I'll work on this later today and post about snipets that are failing to work for me.


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

This might make it simpler for you

Quoting the help file

To skip an optional parameter, leaving its default value intact, use the Default keyword.

Also be sure to re-read the last option where you have the 2. That centers the tip in relation to x and y; not in relation to the screen.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Updated my OP. Right now I'm working on the check box gui with an input. Here is the code that I have so far.

GUICreate("Drivers/Manuals/Warranty", 280, 110)
GUISetState(@SW_SHOW)

$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
GUICtrlCreateButton("Submit", 40, 70, 50)
GUICtrlCreateButton("Cancel", 150, 70, 50)

Sleep(30000)

Here is what I have so far of my gui and I have a few questions below.

  • How can I have the driver box auto checked when the gui is launched?
  • If Driver is checked and the user inputs a service tag into the input box how can I have it fire this

    url = [url="http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection"]http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection[/url]
              pwb :=   ComObjCreate("InternetExplorer.Application")
              ;navigates to the url
              pwb.Navigate(url)
              pwb.visible := true
              While ((pwb.readyState <> 4) || pwb.busy)
                ;Sleep, 10
              frame :=   pwb.document.all["iFramePSHost"].contentWindow
              frame.document.all["TheProductSelectorResultsModel_ServiceTagCode"].value := $input
              frame.document.all.btnSubmit[0].click()
I'm going to guess that my COM code from AHK won't work here, but it's just to show what I'm trying to do. Edited by Crazyace

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

I'm working on the check box gui with an input. Here is the code that I have so far.

GUICreate("Drivers/Manuals/Warranty", 280, 110)
GUISetState(@SW_SHOW)

$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
GUICtrlCreateButton("Submit", 40, 70, 50)
GUICtrlCreateButton("Cancel", 150, 70, 50)

Sleep(30000)

Here is what I have so far of my gui and I have a few questions below.

  • How can I have the driver box auto checked when the gui is launched?
  • If Driver is checked and the user inputs a service tag into the input box how can I have it fire this

    url = [url="http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection"]http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection[/url]
        pwb := ComObjCreate("InternetExplorer.Application")
        ;navigates to the url
        pwb.Navigate(url)
        pwb.visible := true
        While ((pwb.readyState <> 4) || pwb.busy)
        ;Sleep, 10
        frame := pwb.document.all["iFramePSHost"].contentWindow
        frame.document.all["TheProductSelectorResultsModel_ServiceTagCode"].value := $input
        frame.document.all.btnSubmit[0].click()
I'm going to guess that my COM code from AHK won't work here, but it's just to show what I'm trying to do.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Hello Crazyace,

#1) Use GUICtrlSetState() to set the state of controls.

;This will set the checkbox control to checked
GUICtrlSetState( $Driver, $GUI_CHECKED )
;just as this example will set it's state as unchecked.
GUICtrlSetState( $Driver, $GUI_UNCHECKED )

Embedded with your code, you will get this:

$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
GUICtrlSetState( -1, $GUI_CHECKED )
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
GUICtrlCreateButton("Submit", 40, 70, 50)
GUICtrlCreateButton("Cancel", 150, 70, 50)

#2) You will want to use GUICtrlGetState() to retrieve the state of a control

GUICtrlGetState($Driver)

to perform a _Function() when this is checked you would:

If GUICtrlGetState($Driver) = $GUI_CHECKED Then _Function()

Sorry to verify, but you are right that your AHK com code will not work properly with AutoIt. However, and on a brighter side, if you read up on IE.au3 UDF in your help file, I am certain you will find it moderately easy to convert your AHK code to better interact with AutoIt.

Some functions that may help are:

_IECreate() ;To create com object with Internet Explorer
_IENavigate() ;Navigates
_IELoadWait() ;Sleep function while the page loads

Good Luck & Happy Coding!

Realm

Edited by Realm
1 person likes this

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Realm,

Thanks so much for your kind reply. I'm going to check out the IE.au3 file for sure. When the submit button is clicked how can I fire the code?

I had updated to this

#include <GUIConstantsEx.au3>
GUICreate("Drivers/Manuals/Warranty", 280, 110)
GUISetState(@SW_SHOW)
$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
GUICtrlSetState(-1, $GUI_CHECKED)
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
$Submit = GUICtrlCreateButton("Submit", 40, 70, 50)
$Exit = GUICtrlCreateButton("Cancel", 150, 70, 50)
Edited by Crazyace

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Crazyace,

I am sorry I didn't fully explore your code last time, and just went directly to answering your questions. I have modified your code a bit so that it will perform more to your needs. I noticed from your original post you had a large sleep function at the bottom to keep your GUI open. When a button is pressed during sleep mode, it will not perform your needs. You need to create a loop after your gui creation to watch for user input and activity. Hope this helps a bit.

#include <GUIConstants.au3>

GUICreate("Drivers/Manuals/Warranty", 280, 110)

$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
GUICtrlSetState(-1, $GUI_CHECKED)
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
$Submit = GUICtrlCreateButton("Submit", 40, 70, 50)
$Exit = GUICtrlCreateButton("Cancel", 150, 70, 50)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Submit
            $serv_tag = GUICtrlRead($Input)
            If GUICtrlGetState($Driver) = $GUI_CHECKED Then _Fire($serv_tag)
        Case $msg = $Exit
            ExitLoop
    EndSelect
WEnd

Exit 0

Func _Fire($sServiceTag)
    ;IE functin that will handle $sServiceTag that is the passed input read from control $Input
EndFunc

Realm

Edit: If you are using Scite, this only works for the AutoIt version that was included with the standard Install, to create your scripts, you may also type 'setupgui' then press space and it will create a basic template shell of a gui window code for you, including the while loop.

Edited by Realm
1 person likes this

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

Crazyace,

I am sorry I didn't fully explore your code last time, and just went directly to answering your questions. I have modified your code a bit so that it will perform more to your needs. I noticed from your original post you had a large sleep function at the bottom to keep your GUI open. When a button is pressed during sleep mode, it will not perform your needs. You need to create a loop after your gui creation to watch for user input and activity. Hope this helps a bit.

#include <GUIConstants.au3>

GUICreate("Drivers/Manuals/Warranty", 280, 110)

$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
GUICtrlSetState(-1, $GUI_CHECKED)
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
$Submit = GUICtrlCreateButton("Submit", 40, 70, 50)
$Exit = GUICtrlCreateButton("Cancel", 150, 70, 50)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Submit
            $serv_tag = GUICtrlRead($Input)
            If GUICtrlGetState($Driver) = $GUI_CHECKED Then _Fire($serv_tag)
        Case $msg = $Exit
            ExitLoop
    EndSelect
WEnd

Exit 0

Func _Fire($sServiceTag)
    ;IE functin that will handle $sServiceTag that is the passed input read from control $Input
EndFunc

Realm

Edit: If you are using Scite, this only works for the AutoIt version that was included with the standard Install, to create your scripts, you may also type 'setupgui' then press space and it will create a basic template shell of a gui window code for you, including the while loop.

Thanks for the info that's what I needed just a great example. I'm going to start working on the COM stuff with the IE.Au3 file and I'll keep you updated ;)

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

I have merged your two topics. Do not post multiple times regarding the same issue.

1 person likes this

Share this post


Link to post
Share on other sites

Realm,

I tried this but it didn't work correctly.

#include <GUIConstants.au3>
#include <IE.au3>
GUICreate("Drivers/Manuals/Warranty", 280, 110)
$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
GUICtrlSetState(-1, $GUI_CHECKED)
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
$Submit = GUICtrlCreateButton("Submit", 40, 70, 50)
$Exit = GUICtrlCreateButton("Cancel", 150, 70, 50)
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Submit
            $serv_tag = GUICtrlRead($Input)
            If GUICtrlGetState($Driver) = $GUI_CHECKED Then _Fire($serv_tag)
        Case $msg = $Exit
            ExitLoop
    EndSelect
WEnd
Exit 0
Func _Fire($serv_tag)
   _IECreate("[url="http://support.dell.com/support/topics/global.aspx/support/my_systems_info/manuals?c=us&l=en&s=biz&~ck=ln&lnki=0&ServiceTag"]http://support.dell.com/support/topics/global.aspx/support/my_systems_info/manuals?c=us&l=en&s=biz&~ck=ln&lnki=0&ServiceTag[/url]=" & $Input, 1, 1,0)
EndFunc

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Crazyace,

When you see brackets, '[' ']', in the parameter explanations within the helpfile, these are not meant to be used inside the actual code, they are merely symbolic for the parameter is optional.

$input is the variable pointer to your GUICtrlCreateInput() control.

When 'Submit' is pressed, it will read the user input from that control into the variable $serv_tag. Afterwhich it will pass $serv_tag to the function _Fire(). If you look at function _Fire(), you will see that it accepts 1 parameter that will be assigned to variable $sServiceTag. This is the variable that now holds the user's input to which can be used within function _Fire().

I highly recommend reading The first section of the Help file, to get a better understanding of how AutoIt works, especially with Functions.

I am not sure why you have the url pasted twice in your post. You don't need tags either. _IECreate() will also return an object variable that points to InternetExplorer.Applicaton (the controls behind the browswer your attempting to open). So give it a variable to return to, so you have a way to manipulate the window further.

$oIE = _IECreate("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/manuals?c=us&l=en&s=biz&~ck=ln&lnki=0&ServiceTag=" & $sServiceTag)
_IENavigate($oIE, $another_url)

I did not test this example, however and in theory providing the url is correct as you have posted, this should work for you. Remove the _IENavigate(), I added that so you could visualize how the object handling will be performed.

Realm

Edited by Realm
1 person likes this

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

Realm,

Thanks for the reply. When looking at my post, the forums messed up and put in the hyperlink and the URL. The help file now that I know how to use it has been a great help and I now understand gui's much better. At first I was really confused by the $msg = GUIGetMsg() part but now I understand that all GUI's will be a Msg loop or event loop.

#include <GUIConstants.au3>
#include <IE.au3>

GUICreate("Drivers/Manuals/Warranty", 280, 110)

$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
GUICtrlSetState(-1, $GUI_CHECKED)
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
$Submit = GUICtrlCreateButton("Submit", 40, 70, 50)
$Exit = GUICtrlCreateButton("Cancel", 150, 70, 50)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Submit
            $serv_tag = GUICtrlRead($Input)
            If GUICtrlGetState($Driver) = $GUI_CHECKED Then _Fire($sServiceTag)
        Case $msg = $Exit
            ExitLoop
    EndSelect
WEnd

Exit 0

Func _Fire($sServiceTag)
   $oIE = _IECreate("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/manuals?c=us&l=en&s=biz&~ck=ln&lnki=0&ServiceTag=" & $sServiceTag,1 ,1 ,0)
EndFunc

With the code above the Submit button fails to fire the function and I can't understand why. I looked at the help file and everything looks fine. Do I need to put the function in the top of the file?


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

Share this post


Link to post
Share on other sites

#include <GUIConstants.au3>
#include <IE.au3>

GUICreate("Drivers/Manuals/Warranty", 280, 110)

$Driver = GUICtrlCreateCheckbox("Drivers", 10, 10)
GUICtrlSetState(-1, $GUI_CHECKED)
$Manual = GUICtrlCreateCheckbox("Manual", 80, 10)
$Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10)
GUICtrlCreateLabel("Service Tag #:", 10, 45)
$Input = GUICtrlCreateInput("", 90, 40)
$Submit = GUICtrlCreateButton("Submit", 40, 70, 50)
$Exit = GUICtrlCreateButton("Cancel", 150, 70, 50)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Submit
            $serv_tag = GUICtrlRead($Input)
            If IsChecked($Driver) Then _Fire($serv_tag)
        Case $msg = $Exit
            ExitLoop
    EndSelect
WEnd

Exit 0

Func _Fire($sServiceTag)
   $oIE = _IECreate("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/manuals?c=us&l=en&s=biz&~ck=ln&lnki=0&ServiceTag=" & $sServiceTag,1 ,1 ,0)
EndFunc

Func IsChecked($control)
    Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc

Share this post


Link to post
Share on other sites

Zedna,

Thanks for the help that works perfect. May I ask why we added

Func IsChecked($control)
    Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.""Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience"

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
      Hello,
      I have used this forum to get help many times. I thought it was time to (hopefully) help others.
      I created a script that reads a text file with a list of videos, displays the videos in a GUI with checkboxes next to the names, and displays the selected videos. This will become a part of a larger script I am creating to test a video player. The tough part for me was creating the GUI and Dynamic list of videos. I had a lot of trouble finding samples to help me, but finally found one  written by Melba23. The link is in the code, so he gets credit for helping! I also have not used arrays much and they are very picky about looping through the arrays without getting the dreaded error " Array variable has incorrect number of subscripts or subscript dimension range exceeded."  However diligence paid off!
      To run this code, take the video names commented below and create a videos.txt file in your script execution directory. You can put however many video names in this list. Thus the dynamic features of the code.
      Cheers!
      Jibberish
      #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <array.au3> #include <File.au3> #include <GUIConstantsEx.au3> Local $sMediaFile = @ScriptDir & "\videos.txt" ;~ Videos in videos.txt are: ;~ bbb_1080_60s.mp4 ;~ bbb_1080_60s_1.mp4 ;~ bbb_1080_60s_2.mp4 ;~ tos_4K_60s_HEVC.mp4 ;~ tos_4K_60s_HEVC_1.mp4 ;~ tos_4K_60s_HEVC_2.mp4 ;~ ;~ Additional videos can be added to this list. The functions are Dynamic. Dim $aMediaManifest Local $aArrayFile Local $aVideos Local $sVideoName Local $i ; MAIN ; Put the Video File Names into an Array _FileReadToArray($sMediaFile, $aArrayFile) Local $iVideoCount = UBound($aArrayFile) -1 ; Get the number of videos - 1 to prevent errors _ArrayDelete($aArrayFile, 0) ;Counter just gets in the way ; Move backwards through the array deleting the blank lines For $i = $iVideoCount - 1 To 0 Step -1 If $aArrayFile[$i] = "" Then _ArrayDelete($aArrayFile, $i) EndIf Next $aVideos = DisplayVideos($aArrayFile) $iVideoCount = UBound($aArrayFile) -1 _ArrayDisplay($aVideos) ; Display the checked videos ;~ End of MAIN ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; GUI to display Videos in checkboxes ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Func DisplayVideos($aArrayFile) Local $iTop = -1 Local $iLeft = -1 Local $iWidth Local $iHeight = $iVideoCount * 30 Local $iL = 10 Local $iT = 10 Local $iRow = 0 Local $aVideo Local $iA = 0, $iB = 0 Local $sFill = "" $iMMCount = UBound($aArrayFile) $iMMNewCount = $iMMCount - 1 Local $aGUICheckbox[$iMMCount] Local $aCheckedVideos[$iMMCount] ; Put the Video File Names into an Array $hGUI = GUICreate("Video Checkbox", $iLeft, $iTop, $iWidth, $iHeight) GUICtrlCreateLabel("Videos", 180, $iT) $iT = $iT + 30 ; This is a great example of using arrays to create GUI check boxes or radio buttons For $i = 0 To $iMMNewCount Step 1 $sMP4Text = $aArrayFile[$i] $aGUICheckbox[$i] = GUICtrlCreateCheckbox($sMP4Text, 30, $iT) $iT += 30 Next $idClose1 = GUICtrlCreateButton("Start", $iL, $iT) GUISetState(@SW_SHOW) ; This section reads the checkboxes and puts the video names in an array in their original position ; in case this is important (as it is to me) ; This was the toughest part to code, and I found no samples online until I saw Melba23's sample here: ; https://www.autoitscript.com/forum/topic/119843-dynamic-gui-problem/#comment-832672 ; I got this working with only a little modification. THANK YOU MELBA23 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idClose1 For $i = 0 To $iMMNewCount Step 1 Switch GUICtrlRead($aGUICheckbox[$i]) Case $GUI_CHECKED $aCheckedVideos[$i] = $aArrayFile[$i] Case $GUI_UNCHECKED EndSwitch Next ExitLoop EndSwitch WEnd GUIDelete($hGUI) Return $aCheckedVideos EndFunc ;==>DisplayVideos  
    • Jibberish
      By Jibberish
      Hi,
      I am maybe an intermediate AutoIt script writer, but have no experience creating GUIs.
      I have a script with two functions. One for Checkboxes and another with radio buttons. Each function creates it's own window.
      I'd like to use one window with both checkboxes and radio buttons.
      I pulled samples from AutoIt Help and other places and worked it into this: (RadioCheck still uses the example Case and MsgBoxes. I will clean this up soon)
      Func CheckOptions() ; Create a GUI with various controls. Local $hGUI = GUICreate("SGX4CP Options", 275, 250) ; Create a checkbox control. Local $iLoopCheckbox = GUICtrlCreateCheckbox("Loop", 10, 10, 185, 25) Local $iFullScreenCheckbox = GUICtrlCreateCheckbox("Fullscreen", 10, 40, 185, 25) Local $iRestartPlaybackCheckbox = GUICtrlCreateCheckbox("Restart Playback from Sleep", 10, 70, 185, 25) GUICtrlSetState($iRestartPlaybackCheckbox, $GUI_CHECKED) Local $iDisableSleepCheckbox = GUICtrlCreateCheckbox("Disable Sleep", 10, 100, 185, 25) Local $iLogCheckbox = GUICtrlCreateCheckbox("Show Log", 10, 130, 185, 25) GUICtrlSetState($iLogCheckbox, $GUI_CHECKED) Local $idClose = GUICtrlCreateButton("Next", 110, 220, 85, 25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop Case $iLoopCheckbox If _IsChecked($iLoopCheckbox) Then $bLoopChecked = True Else $bLoopChecked = False EndIf Case $iFullScreenCheckbox if _IsChecked($iFullScreenCheckbox) Then $bFullScreenChecked = True Else $bFullScreenChecked = False EndIf Case $iRestartPlaybackCheckbox if _IsChecked($iRestartPlaybackCheckbox) Then $bRestartPlaybackChecked = True Else $bRestartPlaybackChecked = False EndIf Case $iDisableSleepCheckbox if _IsChecked($iDisableSleepCheckbox) Then $bDisableSleepChecked = True Else $bDisableSleepChecked = False EndIf Case $iLogCheckbox if _IsChecked($iLogCheckbox) Then $bLogChecked = True Else $bLogChecked = False EndIf EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc Func RadioCheck() GUICreate("Select Test",300,180) ; will create a dialog box that when displayed is centered Local $idRadio1 = GUICtrlCreateRadio("Loop Forever", 10, 10) Local $idRadio2 = GUICtrlCreateRadio("Play each video 3 times", 10, 40) Local $idRadio3 = GUICtrlCreateRadio("Play each video separately", 10, 70) GUICtrlSetState($idRadio1, $GUI_CHECKED) Local $idClose = GUICtrlCreateButton("Start Test", 120,100) GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE ExitLoop Case $idMsg = $idRadio1 And BitAND(GUICtrlRead($idRadio1), $GUI_CHECKED) = $GUI_CHECKED MsgBox($MB_SYSTEMMODAL, 'Info:', 'The app will run forever, playing each video once, then looping back to the first video.') $bTestSelectForever = True Case $idMsg = $idRadio2 And BitAND(GUICtrlRead($idRadio2), $GUI_CHECKED) = $GUI_CHECKED MsgBox($MB_SYSTEMMODAL, 'Info:', 'Each video will loop 3 times then move to the next video.') $bTestSelect3Times = True Case $idMsg = $idRadio3 And BitAND(GUICtrlRead($idRadio2), $GUI_CHECKED) = $GUI_CHECKED MsgBox($MB_SYSTEMMODAL, 'Info:', 'Player opens, first video plays, player closes. Player opens, second video plays, player closes, etc.') $bTestSelectSingleVideo = True EndSelect WEnd EndFunc I would like to combine the checkbox "Loop" and the radio button $idRadio2. Radio2 requires Loop to be checked.
      I planned to remove the Loop checkbox and only enable it if Radio2 is selected.
      Can I combine these two functions into one with one window with both Checkboxes and Radio Buttons?
      Thanks
      Jibberish
    • amphoric
      By amphoric
      Good Morning,
      I hope someone can help, below is a stripped down version of my current .au3 file and there is a few bits I just cant for the life of me get to work;
      1. I would like the 'Allow Edit' checkbox once checked to allow the user to edit the contents of the 'AD Group Name' input box
      2. I would like the 'Other / Internal Use' radio button if checked to show the '$OtherInternalGroup' group of radio buttons
      My current code.....
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIShellEx.au3> #include <FileConstants.au3> #include <WinAPIFiles.au3> #include <WinAPI.au3> ; used for Lo/Hi word ; Declare Global variables for WM_COMMAND and '_GetAppName()' function. Global $__iComboWrite = 9999, $__iInputValue = 9999, $__iInputWrite = 9999 #Region ### START GUI section ### $Form1_1 = GUICreate("Packaging Wrapper", 435, 545, -1, -1) GUISetIcon("C.ico", -1) GUISetBkColor(0xFFFFFF) Global $ApplicationNameInput = GUICtrlCreateInput("", 24, 168, 385, 21) GUICtrlSetTip(-1, "EG: Corel_WinZip_21.0_0.1") $ADGroupNameInput = GUICtrlCreateInput("", 24, 224, 385, 21) $AllowEditChk = GUICtrlCreateCheckbox("Allow Edit", 344, 200, 65, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_RIGHT)) GUICtrlSetBkColor(-1, 0xE3E3E3) $ApplicationTypeGroup = GUICtrlCreateGroup("", 24, 272, 185, 113) $CatalogueAppChk = GUICtrlCreateRadio("Catalogue Application", 32, 288, 137, 17) GUICtrlSetBkColor(-1, 0xE3E3E3) $NonCatalogueAppChk = GUICtrlCreateRadio("Non-Catalogue Application", 32, 320, 161, 17) GUICtrlSetBkColor(-1, 0xE3E3E3) $OtherAppChk = GUICtrlCreateRadio("Other / Internal Use", 32, 352, 137, 17) GUICtrlSetBkColor(-1, 0xE3E3E3) GUICtrlCreateGroup("", -99, -99, 1, 1) ; $OtherInternalGroup = GUICtrlCreateGroup("", 216, 272, 193, 113) $OSCoreApplicationChk = GUICtrlCreateRadio("OS Core Application", 224, 288, 129, 17) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlSetBkColor(-1, 0xE3E3E3) $InternalOnlyChk = GUICtrlCreateRadio("Internal ONLY Application", 224, 320, 161, 17) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlSetBkColor(-1, 0xE3E3E3) GUICtrlCreateGroup("", -99, -99, 1, 1) $OtherInternalLabel = GUICtrlCreateLabel("Other / Internal Use", 216, 256, 118, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) GUICtrlSetBkColor(-1, 0xE3E3E3) $ConfirmGroup = GUICtrlCreateGroup("", 24, 392, 385, 89) $Confirm = GUICtrlCreateCheckbox("I confirm all details are correct, and I wish to proceed", 48, 456, 329, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX, $BS_CENTER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0xE3E3E3) $ConfirmDesc = GUICtrlCreateEdit("", 32, 408, 361, 41, 0, 0) GUICtrlSetData(-1, StringFormat("Please confirm that all entered information is correct, and the you wish to \r\nproceed with the creation of the " & Chr(39) & "Application Toolkit Wrapper" & Chr(39) & ".")) GUICtrlSetBkColor(-1, 0xE3E3E3) GUICtrlCreateGroup("", -99, -99, 1, 1) $ProceedBtn = GUICtrlCreateButton("Proceed", 128, 488, 75, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x008000) $CancelBtn = GUICtrlCreateButton("Cancel", 240, 488, 75, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0000) $CapitaLogo = GUICtrlCreatePic("Logo.jpg", 24, 8, 159, 33) $PackagingWrapperLabel = GUICtrlCreateLabel("Packaging Wrapper", 224, 8, 187, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $CreatedByLabel = GUICtrlCreateLabel("...", 16, 528, 405, 15, $SS_CENTER) GUICtrlSetFont(-1, 7, 400, 0, "MS Serif") $VerLabel = GUICtrlCreateLabel("Ver. 1.0 ALPHA", 328, 40, 79, 17) $Step1Label = GUICtrlCreateLabel("Please Enter The Following Information", 24, 80, 274, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlSetBkColor(-1, 0xE3E3E3) $Graphic3 = GUICtrlCreateGraphic(16, 72, 404, 452, BitOR($GUI_SS_DEFAULT_GRAPHIC, $SS_SIMPLE)) GUICtrlSetColor(-1, 0xE3E3E3) GUICtrlSetBkColor(-1, 0xE3E3E3) $ApplicationNameDesc = GUICtrlCreateEdit("", 24, 128, 393, 33, 0, 0) GUICtrlSetData(-1, StringFormat("Must be in the following format: Manufacturer_AppName_AppVersion_Rev\r\nEG: Corel_WinZip_21.0_01")) GUICtrlSetBkColor(-1, 0xE3E3E3) $ADGroupNameLabel = GUICtrlCreateLabel("AD Group Name", 24, 200, 95, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) GUICtrlSetBkColor(-1, 0xE3E3E3) $ApplicationNameLabel = GUICtrlCreateLabel("Application Name", 24, 112, 103, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) GUICtrlSetBkColor(-1, 0xE3E3E3) $ApplicationTypeLabel = GUICtrlCreateLabel("Application Type", 24, 256, 99, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) GUICtrlSetBkColor(-1, 0xE3E3E3) GUISetState(@SW_SHOW) #EndRegion ### END GUI section ### ;GLOBAL VARIABLES Global $ApplicationName, $adstring1 Global $ADGroupName = $adstring1 Global $envSystemDrive = EnvGet("systemdrive") Global $PackagingDirectory = "Packaging\???_Apps" Global $FullDir = $envSystemDrive & "\" & $PackagingDirectory & "\" & $ApplicationName Global $currentDate = @MDAY &"-"& @MON &"-"& @YEAR Global $currentTime = @HOUR &":"& @MIN &":"& @SEC ; Register the WM_COMMAND to intercept when the value in the first input's value is changed. GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND') While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $CancelBtn Exit Case $ProceedBtn ;Check Application Name Validity $ApplicationNameInputValid = StringSplit(GUICtrlRead($ApplicationNameInput), "_") If $ApplicationNameInputValid[0]<> 4 Then ConsoleWrite("Application Name - NOT Valid" & @CRLF) $ApplicationNameInputValidYes = 0 MsgBox(0,"Are The Details Correct?", "Application Name NOT Valid.") GUICtrlSetState($ApplicationNameInput,$GUI_FOCUS) Elseif $ApplicationNameInputValid[0]= 4 Then ConsoleWrite("Application Name - Valid" & @CRLF) $ApplicationNameInputValidYes = 1 EndIf ;Is Confirm Checkbox 'Checked' if GUICtrlRead($Confirm) = $GUI_CHECKED Then ConsoleWrite("$Confirm - ticked" & @CRLF) $ConfirmYes = 1 Else $ConfirmYes = 0 ConsoleWrite("$Confirm - NOT ticked" & @CRLF) MsgBox(0,"Are The Details Correct?", "Please complete confirmation.") EndIf ;Is $CatalogueAppChk 'Checked' if GUICtrlRead($CatalogueAppChk) = $GUI_CHECKED Then ConsoleWrite("$CatalogueAppChk - ticked" & @CRLF) $CatalogueAppChkYes = 1 Else ConsoleWrite("$CatalogueAppChk - NOT ticked" & @CRLF) $CatalogueAppChkYes = 0 EndIf ;Is $NonCatalogueAppChk 'Checked' if GUICtrlRead($NonCatalogueAppChk) = $GUI_CHECKED Then ConsoleWrite("$NonCatalogueAppChk - ticked" & @CRLF) $NonCatalogueAppChkYes = 1 Else ConsoleWrite("$NonCatalogueAppChk - NOT ticked" & @CRLF) $NonCatalogueAppChkYes = 0 EndIf ;Is $OtherAppChk 'Checked' if GUICtrlRead($OtherAppChk) = $GUI_CHECKED Then ConsoleWrite("$OtherAppChk - ticked" & @CRLF) $OtherAppChkYes = 1 Else ConsoleWrite("$OtherAppChk - NOT ticked" & @CRLF) $OtherAppChkYes = 0 EndIf ConsoleWrite(@CRLF & "##### COMPLETED #####" & @CRLF) EndSwitch WEnd ;Check for 'Application Name' update Func _GetAppName() $adString = StringReplace(GUICtrlRead($ApplicationNameInput), "_", " ",2) $adstrings = StringSplit($adString, "_") Global $adString1 = $adstrings[1] Global $ApplicationName = GUICtrlRead($ApplicationNameInput) GUICtrlSetData($ADGroupNameInput, $adstring1) EndFunc ;WM_COMMAND Function used for Auto Input of fields Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Local $iHiWord = _WinAPI_HiWord($wParam) ; Control identification code. Local $iLoWord = _WinAPI_LoWord($wParam) ; Control identifier. Switch $iHiWord Case $EN_CHANGE ; When a change event is intercepted. Switch $iLoWord ; Retrieve the controlid. Case _GetAppName() ; If it matches the first input then call the custom function _GetInput. ConsoleWrite("Debug: value was changed." & @CRLF) _GetAppName() EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND I hope all this makes sense.
      Thanks in advance
    • jannikrendl
      By jannikrendl
      Hey guys,
      I would like to learn how the whole GUI stuff is working so I try to understand it step by step...
      First of all I created a GUI with a single button. My goal is to activate an infinite while loop as soon as the checkbox is checked and to deactive the infinite while loop as soon as I uncheck the checkbox, but I don't understand how... I read various threads but couldn't find a good example etc...
      Thanks in advance 
    • Terenz
      By Terenz
      Hello,
      I have searched everywhere but on the forum there isn't an example of a combobox with checkbox. I think is a very useful control but require subclassing. Several example in C++, one of this:
      CheckComboBox Control
      If somone has some time to check it out. If need i can provide the source code. Thanks