Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

How to create multiple GUI (for newb)


  • Please log in to reply
40 replies to this topic

#1 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 24 April 2012 - 02:40 PM

For example there is a GUI window with 3buttons. When you click 1st button then opens
#include  <Crypt.au3> ; Example of hashing data and using it to authenticate password ; This is the MD5-hash of the correct password $bPasswordHash="0xCE950A8D7D367B5CE038E636893B49DC" $sPassword=InputBox("Login","Please type the correct password.","Yellow fruit that is popular among monkeys") If _Crypt_HashData($sPassword,$CALG_MD5)=$bPasswordHash Then     MsgBox(64,"Access Granted","Password correct!") Else     MsgBox(16,"Access Denied","You entered the wrong password!") EndIf
this code, i mean when you enter correct password it opens or do something.... when you click 2nd or 3rd buttons they opens other gui windows with different buttons....
I think its easy but cant find where to start as im not so good at GUI. Maybe there is any examples?







#2 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 24 April 2012 - 02:46 PM

Your best bet is to read the Wiki entry about Managing Multiple GUIs.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#3 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 24 April 2012 - 02:49 PM

Its hard to understand for me but are you sure that there is info about making gui with buttons where buttons would open new gui changing previous?

#4 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 24 April 2012 - 03:03 PM

InputBox isn't what you would call part of the 'GUI Management' functions, secondly there are plenty of examples in the Help file, Forum and Wiki (the site has been going since '03) to have 3 buttons and each one assigned a specific task. Look in the Help file for the example attached with GUICtrlCreateButton.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#5 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 24 April 2012 - 03:08 PM

Oh i found some examples. Lol I created this topic as im sooo lazy. Im going to make not so simply GUI but have to start with simpliest ones. Thanks for reply

#6 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 24 April 2012 - 03:21 PM

Glad I could help. It would have taken me 30 seconds to write a simple script, but that's not how you or others learn. Hard persistence is how one truly learns a language.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#7 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 24 April 2012 - 03:28 PM

Ok i find out how to do it. Now i can make GUI from GUI. lol Now i have to learn to make buttons work
hmmm so i used this code from wiki
AutoIt         
#include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Global $hGUI1, $hGUI2 = 9999, $hButton1, $hButton2, $hButton3 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements gui1() Func gui1()      $hGUI1 = GUICreate("Gui 1", 200, 200, 100, 100)      GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") ; Call a common GUI close function      $hButton1 = GUICtrlCreateButton("Msgbox 1", 10, 10, 80, 30)      GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function      $hButton2 = GUICtrlCreateButton("Show Gui 2", 10, 60, 80, 30)      GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function      GUISetState()      While 1          Sleep(10)      WEnd EndFunc   ;==>gui1 Func gui2()      $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350)      GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") ; Call a common GUI close function      $hButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30)      GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function      GUISetState() EndFunc   ;==>gui2 Func On_Close()      Switch @GUI_WINHANDLE ; See which GUI sent the CLOSE message          Case $hGUI1              Exit ; If it was this GUI - we exit <<<<<<<<<<<<<<<          Case $hGUI2              GUIDelete($hGUI2) ; If it was this GUI - we just delete the GUI <<<<<<<<<<<<<<<              GUICtrlSetState($hButton2, $GUI_ENABLE)      EndSwitch EndFunc Func On_Button()      Switch @GUI_CTRLID ; See which button sent the message          Case $hButton1              MessageBox(1) ; We can call a function with parameters here <<<<<<<<<<<<<<<<<<<          Case $hButton2              GUICtrlSetState($hButton2, $GUI_DISABLE)              gui2()          Case $hButton3              MessageBox(2) ; We can call a function with parameters here <<<<<<<<<<<<<<<<<<<      EndSwitch EndFunc Func MessageBox($iIndex)      MsgBox("", "MsgBox " & $iIndex, "Test from Gui " & $iIndex) EndFunc


So to make buttons work i should do something here? -->
 Func On_Button()      Switch @GUI_CTRLID ; See which button sent the message          Case $hButton1              MessageBox(1) ; We can call a function with parameters here <<<<<<<<<<<<<<<<<<<          Case $hButton2              GUICtrlSetState($hButton2, $GUI_DISABLE)              gui2()          Case $hButton3              MessageBox(2) ; We can call a function with parameters here <<<<<<<<<<<<<<<<<<<      EndSwitch


I can make func for it?

#8 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 24 April 2012 - 03:34 PM

I think you should start with the basics first, because copying the code from the wiki to here isn't learning, it's just copying. I would suggest you look at creating one GUI with a button first because that's fundamentally important, if rather basic for some.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#9 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 24 April 2012 - 03:39 PM

Nah i already changed code and got what i want. "GUI with a button" i know how to do it. But sometimes i get errors when trying to make functions for buttions. Maybe ill keep experimenting with it, adding and adding things...

#10 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 24 April 2012 - 03:40 PM

I would get it 'error free' first before you start adding additional features.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#11 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 24 April 2012 - 03:50 PM

What you mean? I already made what i wanted. There is On button functions there i can write what i want it to do. Now i made button when click on it opens screen where you have to write password and if its correct then open other gui. In that first gui is more buttons that one with password i just protected it that other people wouldn go in lol. Now i have to spend some time to make full working script. After it, if it works fine im going to make more advanced GUI with more features like scrolling, progress bar or smth.

#12 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 24 April 2012 - 04:02 PM

1 more problem, cant find how to make something work after aces granted/password correct. Need to do something with variables?
 Example of hashing data and using it to authenticate password ; This is the MD5-hash of the correct password $bPasswordHash="0xCE950A8D7D367B5CE038E636893B49DC" $sPassword=InputBox("Login","Please type the correct password.","Yellow fruit that is popular among monkeys") If _Crypt_HashData($sPassword,$CALG_MD5)=$bPasswordHash Then     MsgBox(64,"Access Granted","Password correct!") ; <-------- or maybe write code here? Else     MsgBox(16,"Access Denied","You entered the wrong password!") EndIf



EDIT. Yes, "<-------- or maybe write code here?" code have to be here. Or func... I always write before i check it lol

Edited by Edgaras, 24 April 2012 - 04:05 PM.


#13 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 24 April 2012 - 05:54 PM

Why are you using InputBox when you can use GUICtrlCreateInput?

Edited by guinness, 24 April 2012 - 05:55 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#14 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 24 April 2012 - 06:15 PM

This code is not mine. What difference from imputbox and GUICtrlCreateInput? Oh you mean making this on GUI window? This code opens new bow/window i think its better than making other GUI window

#15 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 24 April 2012 - 07:42 PM

InputBox is an easy option when you quickly need to display a GUI for input only. Using GUICtrlCreateInput and the GUI management functions provide a lot more flexibility.

Some free code for you: (Question: Can you do this with the InputBox function? Answer: No)
AutoIt         
#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Example() Func Example()     Local $hGUI = GUICreate('', 200, 70)     Local $iEdit = GUICtrlCreateInput('', 5, 5, 200 - 10, 20)     Local $iDisplay = GUICtrlCreateButton('Toggle', 200 - 90, 70 - 30, 85, 25)     _DisplayPassword($hGUI, $iEdit)     GUISetState(@SW_SHOW, $hGUI)     While 1         Switch GUIGetMsg()             Case $GUI_EVENT_CLOSE                 ExitLoop             Case $iDisplay                 _DisplayPassword($hGUI, $iEdit)         EndSwitch     WEnd     GUIDelete($hGUI) EndFunc   ;==>Example Func _DisplayPassword($hHandle, $iControlID)     Local Const $EM_GETPASSWORDCHAR = 0xD2, $EM_SETPASSWORDCHAR = 0xCC     Local $aControlGetPos, $iPasswordCharacter, $tRect     Switch GUICtrlSendMsg($iControlID, $EM_GETPASSWORDCHAR, 0, 0)         Case 0             $iPasswordCharacter = 9679 ; GUICtrlSendMsg($iControlID, $EM_GETPASSWORDCHAR, 0, 0)         Case Else             $iPasswordCharacter = 0     EndSwitch     GUICtrlSendMsg($iControlID, $EM_SETPASSWORDCHAR, $iPasswordCharacter, 0)     $aControlGetPos = ControlGetPos($hHandle, "", $iControlID) ; GUICtrlSetState($iControlID, $GUI_FOCUS)     $tRect = DllStructGetPtr("int " & $aControlGetPos[0] & ";int " & $aControlGetPos[1] & ";int " & $aControlGetPos[0] + $aControlGetPos[2] & ";int " & $aControlGetPos[1] + $aControlGetPos[3] & ";")     _WinAPI_InvalidateRect($hHandle, $tRect, False)     Return Number($iPasswordCharacter = 0) EndFunc   ;==>_DisplayPassword

Edited by guinness, 24 April 2012 - 07:43 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#16 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 25 April 2012 - 03:00 PM

Oh, it cant but i dont need this. Now, how i can make GUI for example there is main gui lets call it "home" and there is menu for example i choose 1st button and after click i want it to open new GUI in same place where "home" was but there is no "home" left lol

#17 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 25 April 2012 - 03:05 PM

Use WinGetPos of the first GUI and then use the x & y co-ordinates to position the second, either by using WinMove or when you create the second GUI.

Edited by guinness, 25 April 2012 - 03:05 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#18 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 25 April 2012 - 04:50 PM

where to write that code if i want to get position? for example there
Func Home()      $hGUI1 = GUICreate("homet", 200, 200, 100, 100)   $pos = WinGetPos("[active]") ;<--- idk if its right never used this only mouse get pos      GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close_Main") ; Run this function when the main GUI [X] is clicked      $hButton1 = GUICtrlCreateButton("button1", 10, 10, 80, 30)      GUICtrlSetOnEvent(-1, "On_Button1")      $hButton2 = GUICtrlCreateButton("button2", 10, 60, 80, 30)      GUICtrlSetOnEvent(-1, "On_Button2")      GUISetState()      While 1          Sleep(10)      WEnd EndFunc   ;==>gui1


and for exmpl other gui
 Func Demobot()      $hGUI2 = GUICreate("other gui", ;and here i have to use these coordinates? $pos[0],$pos[1] or something?)      GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close_Secondary") ; Run this function when the secondary GUI [X] is clicked      $hButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30)      GUICtrlSetOnEvent(-1, "On_Button3")      GUISetState() EndFunc   ;==>gui2


using examples from help and wiki as my scripts are split up in tones different files as im still experimenting and trying it. Thanks for your fast replies

Edited by Edgaras, 25 April 2012 - 04:52 PM.


#19 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,708 posts

Posted 25 April 2012 - 05:17 PM

Edgaras,

What exactly are you creating? A bot? If so read the Forum Rules or explain.

Edited by guinness, 25 April 2012 - 05:19 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#20 EmptySpace

EmptySpace

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 294 posts

Posted 25 April 2012 - 05:25 PM

Hahaha one guy was asking me for creating bot but im not creating it. I want to learn GUI firstly making GUI like a browser where i could store/browse important things. if u saw this "Demobot" its sheet of pictures name lol im playing strategy game online where is important to have winnig screenshots i have few sheets of it in my pc and cant find something when i need, so im decided to make like browser where i make tabs and other things.

Edited by Edgaras, 25 April 2012 - 05:28 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users