warrus

Help me find the error GUI

22 posts in this topic

I was a novice , I want to create a GUI with buttons you need to press the button when the GUI did not disappear , please help

123.au3

Share this post


Link to post
Share on other sites



  1. #include <ButtonConstants.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <WindowsConstants.au3>
  4.  
  5. #Region ### START Koda GUI section ### Form=
  6. $Form1 = GUICreate("Панель управления ОТС", 615, 438, 224, 123)
  7. $Button1 = GUICtrlCreateButton("интра", 16, 24, 201, 25)
  8. $Button2 = GUICtrlCreateButton("Button1", 16, 72, 201, 25)
  9. $Button3 = GUICtrlCreateButton("Button1", 16, 120, 201, 25)
  10. $Button4 = GUICtrlCreateButton("Button1", 16, 168, 201, 25)
  11. $Button5 = GUICtrlCreateButton("Button1", 16, 216, 201, 25)
  12. $Button6 = GUICtrlCreateButton("Button1", 16, 264, 201, 25)
  13. GUISetState(@SW_SHOW)
  14. #EndRegion ### END Koda GUI section ###
  15.  
  16.  
  17. While 1
  18.     $nMsg = GUIGetMsg()
  19.     Switch $nMsg
  20.         Case $GUI_EVENT_CLOSE
  21.             Exit
  22.  
  23.         Case $Button3
  24.     EndSwitch
  25. WEnd
 
 
 
I want to do when you click on the button? exe file run admissible 
or being downloaded site

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

#Include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("?????? ?????????? ???", 615, 438, 224, 123)
$Button1 = GUICtrlCreateButton("?????", 16, 24, 201, 25)
$Button2 = GUICtrlCreateButton("Button2", 16, 72, 201, 25)
$Button3 = GUICtrlCreateButton("Button3", 16, 120, 201, 25)
$Button4 = GUICtrlCreateButton("Button4", 16, 168, 201, 25)
$Button5 = GUICtrlCreateButton("Button5", 16, 216, 201, 25)
$Button6 = GUICtrlCreateButton("Button6", 16, 264, 201, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run('Something.exe')
            ConsoleWrite('Something.exe ' & @MSEC & @CRLF)
        Case $Button2
            Run('C:\Program Files (x86)\Mozilla Firefox\firefox.exe www.google.com')
            ConsoleWrite('A site ' & @MSEC & @CRLF)
        Case $Button3
            Run('AnotherSomething.exe')
    EndSwitch
WEnd

I think you get the picture

Edited by careca
Typo
1 person likes this

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites
#Include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("?????? ?????????? ???", 615, 438, 224, 123)
$Button1 = GUICtrlCreateButton("?????", 16, 24, 201, 25)
$Button2 = GUICtrlCreateButton("Button2", 16, 72, 201, 25)
$Button3 = GUICtrlCreateButton("Button3", 16, 120, 201, 25)
$Button4 = GUICtrlCreateButton("Button4", 16, 168, 201, 25)
$Button5 = GUICtrlCreateButton("Button5", 16, 216, 201, 25)
$Button6 = GUICtrlCreateButton("Button6", 16, 264, 201, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run('Something.exe')
            ConsoleWrite('Something.exe ' & @MSEC & @CRLF)
        Case $Button2
            Run('C:\Program Files (x86)\Mozilla Firefox\firefox.exe www.google.com')
            ConsoleWrite('A site ' & @MSEC & @CRLF)
        Case $Button3
            Run('AnotherSomething.exe')
    EndSwitch
WEnd

I think you get the picture

The friend you are my savior, our heartfelt thanks to you, Happy New Year !!!

Share this post


Link to post
Share on other sites
#Include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("ОТС", 615, 438, 224, 123)
$Button1 = GUICtrlCreateButton("Интра", 16, 24, 201, 25)
$Button2 = GUICtrlCreateButton("Button2", 16, 72, 201, 25)
$Button3 = GUICtrlCreateButton("Button3", 16, 120, 201, 25)
$Button4 = GUICtrlCreateButton("Button4", 16, 168, 201, 25)
$Button5 = GUICtrlCreateButton("Button5", 16, 216, 201, 25)
$Button6 = GUICtrlCreateButton("Button6", 16, 264, 201, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run('C:\Users\ruslan\Desktop\autoit\444.xlsx')
            ConsoleWrite('C:\Users\ruslan\Desktop\autoit\444.xlsx ' & @MSEC & @CRLF)
        Case $Button2
            Run('C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.com')
            ConsoleWrite('A site ' & @MSEC & @CRLF)
        Case $Button3
            Run('AnotherSomething.exe')
        Case $Button4
            Run('AnotherSomething.exe')
        Case $Button5
            Run('AnotherSomething.exe')


    EndSwitch
WEnd
Run('C:\Users\ruslan\Desktop\autoit\444.xlsx')
            ConsoleWrite('C:\Users\ruslan\Desktop\autoit\444.xlsx ' & @MSEC & @CRLF)
 
can`t run the file exel, can be an example , please

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hi, try to remove the space after the filename

autoit\444.xlsx ' &
autoit\444.xlsx' &

If it doesn't run like that you probably have to run excel with import parameter as stated HERE

excel.exe "c:\My Folder\book1.xlsx"

If the excel file is in the same folder as the script:

Run('Excel.exe '&'"'&@ScriptDir&'\444.xlsx"')

;If still doesn't work, you should include the path to the Excel exe.

Run('C:\programfiles\officeblahblah\Excel.exe '&'"'&@ScriptDir&'\444.xlsx"')
Edited by careca
1 person likes this

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites
 
Thank you very much this way of working that's Run ('C: \ Program Files (x86) \ Microsoft Office \ Office14 \ Excel.exe' & '"' & @ ScriptDir & '\ 444.xlsx"') and even a little unclear to me why this line ? ConsoleWrite ('A site' &MSEC &CRLF)

Share this post


Link to post
Share on other sites

ConsoleWrite lines are only to show information in the autoit wrapper/output, it's like messagebox, used for debug, you can delete all ConsoleWrite lines.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites
Thank you good man)

Share this post


Link to post
Share on other sites
 
how to make a background in the graphical interface , that does not work $Form2 = GuiCtrlCreatePic("logo.png",120,100)
 
#Include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Excel.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("ОТС", 615, 438, 224, 123)
$Form2 = GuiCtrlCreatePic("logo.png",120,100)
$Button1 = GUICtrlCreateButton("Интра", 16, 24, 201, 25)
$Button2 = GUICtrlCreateButton("Button2", 16, 72, 201, 25)
$Button3 = GUICtrlCreateButton("Button3", 16, 120, 201, 25)
$Button4 = GUICtrlCreateButton("Button4", 16, 168, 201, 25)
$Button5 = GUICtrlCreateButton("Button5", 16, 216, 201, 25)
$Button6 = GUICtrlCreateButton("Button6", 16, 264, 201, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run('C:\Program Files (x86)\Microsoft Office\Office14\Excel.exe '&'"'&@ScriptDir&'\444.xlsx"')
            ConsoleWrite('excel ' & @MSEC & @CRLF)
        Case $Button2
            Run('C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.com')
            ConsoleWrite('A site ' & @MSEC & @CRLF)
        Case $Button3
            Run('AnotherSomething.exe')
        Case $Button4
            Run('AnotherSomething.exe')
        Case $Button5
            Run('AnotherSomething.exe')


    EndSwitch
WEnd
$Form1 = GUICreate("ОТС", 615, 438, 224, 123)
$Form2 = GuiCtrlCreatePic("logo.png",120,100)
 

Share this post


Link to post
Share on other sites

Put
$Form2 = GuiCtrlCreatePic("ABC.JPG",10,10, 500, 500) ;BMP JPG or GIF not animated

after

$Form1 = GUICreate("?????? ?????????? ???", 615, 438, 224, 123)

1 person likes this

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites
 
understood, in reference autoit on this team , supported formats include BMP, JPG, GIF ( no animation ) . Thank you

Share this post


Link to post
Share on other sites
 
Is it possible to somehow make to the Picture ?

Share this post


Link to post
Share on other sites

 

Questions disappear understood )

Share this post


Link to post
Share on other sites

@warrus in the future please learn how to use the Edit feature rather than three posts in quick succession, and follow the forum etiquette of not bumping your threads without waiting 24 hours.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I didn't get your question, what do you mean

 
Is it possible to somehow make to the Picture ?

make what to the picture?


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

@warrus in the future please learn how to use the Edit feature rather than three posts in quick succession, and follow the forum etiquette of not bumping your threads without waiting 24 hours.

Good

Share this post


Link to post
Share on other sites

I didn't get your question, what do you mean

make what to the picture?

Hi , I have figured out with images

 

Share this post


Link to post
Share on other sites

huh, so everything solved?

best regards.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites
Hello there was a question , you need to file my script was copied to a folder of the script regardless of the location of the script
#Include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("GPU", 250, 250, 224, 123)
$Form2 = GuiCtrlCreatePic("logo.jpg",100,10,45,38)
$Form3 = GUICtrlCreateLabel("Нажмите Read на эталонной машине:",17,55,300,15)
$Form4 = GUICtrlCreateLabel("Нажмите Write на целевом ПК:",17,105,300,15)
$Button1 = GUICtrlCreateButton("Read",16, 74, 200, 25)
$Button2 = GUICtrlCreateButton("Write", 16, 122, 201, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run('C:\Users\ruslan\Desktop\Новая папка\gpuread.bat ')
            ConsoleWrite('excel ' & @MSEC & @CRLF)
        Case $Button2
            Run('C:\Users\ruslan\Desktop\Новая папка\gpwrite.bat')
            ConsoleWrite('A site ' & @MSEC & @CRLF)



    EndSwitch
WEnd
It is necessary that the file c: \ security_settings.inf Copy to Folder script

Новая папка.rar

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

  • Similar Content

    • Skeletor
      By Skeletor
      MS Splash Screens
      The office 2016/17 office suite has made many people turn heads with its functions and especially their splash screen.
      I now present to you, the MS Style Splash Screen. For Rookies, Novices and anyone who wants a ready made splash screen for your gui application.

      You can now download it and also try it out yourself.
      You have three colors to choose from:
      Blue
      Red
      Green
      All three colours are from the famous programs.
      I also included the KODA form to you can have freedom with this splash screen.
      Note: the KODA form does not have the three colours as well as the correct blue. 

      Have fun and enjoy.
      Note:
      I will update the splash to add the automated 3 dots animation at a later stage. 
       
       
    • Skeletor
      By Skeletor
      A gui splash screen. Themed after the famous MS Office Suite.
      Three colours to choose from, Red, Blue and Green.
      You can change the labels to your own application.

      Also bundled with this is the KODA form. So you can open up and see the basic structure of this splash screen.
       
      Splash Screen GUI.zip
    • BlazerV60
      By BlazerV60
      Hello all,
      I've been trying to figure out how to launch Google Chrome in the background (hidden) but it doesn't seem possible. I've tried the following methods:
      ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "", "", "", @SW_HIDE) Also I've tried:
      ShellExecute(@ComSpec, "/c start chrome.exe","","",@SW_HIDE) Lastly I tried:
      RunWait('"'&@ProgramFilesDir&'\Google\Chrome\Application\chrome.exe" --silent-launch',@ScriptDir)  
      But all of them launch my chrome browser without hiding it. Does anyone know a workaround for this or if AutoIT just can't Chrome? 
      Bonus points if you know how to make it launch chrome hidden and make it go to https://www.autoitscript.com
       
      Thank you,
      Brian
    • SteveJM
      By SteveJM
      I have a working program currently driven largely through menu selections. I would like to add a toolbar where most of the tollbar button actions are basically the same as menu items, but quicker to access. I have been wading around in toolbar examples, MSDN pages etc, it's clearly going to be a bit of a slog to get everything right, including tooltips etc. I thought I would start with something simple to prove the principle.
      Using bits from the help file examples I have a small program that successfully displays a toolbar. However, what seemed like the most elegant way to deal with the button commands does not seem to work. My understanding was that a toolbar button fires a WM_COMMAND message, with the command Id set by the second parameter in the call to
      _GUICtrlToolbar_AddButton ( $hWnd, $iID, $iImage)
      so I though it would be a good idea to set this Id to the same value as my menu item Id; then it would run the same task which is what I wanted. This did not work. I am using message loop mode and would like to stick with this because some of my scripts run hardware at the same time as the gui; it is easier if I don't have to worry about code being interrupted with the hardware in an unknown state . So I added a handler for WM_COMMAND, with some cribbed display code to try and see why. The toolbar button defintely fired a WM_COMMAND message and the Id looked the same, so no explanation there.
      I guess the issue is with GUIGetMsg() which may be constructed to ignore all but a limited number of control handles, i.e. those made with the GuiCtrlCreate... commands; this is speculation.
      I would dearly love to find a tidy way to get around this. Having some controls handled in the message loop and some in a WM_COMMAND handler, performing the same task, feels ugly. I would be very grateful for further insight from someone experienced with handling a toolbar. Perhaps I should be trying to fire the menu item. I have attached a code snippet to try and illustrate the issue.
       
       
       
      ToolbarTrial.au3
    • XinYoung
      By XinYoung
      Hello all,
      I've been working on 4 standalone scripts. They each have their own GUI and are now independent .exe's. But instead of having 4 separate icons on my computer, is it possible to put them all together into one .exe?
      What I want is one interface with tabs. Each script's GUI would be on their own respective tab. Is this possible?
      The different scripts don't need to communicate with one another. I just want them all in one .exe.
      I can't find this anywhere... Any help would be greatly appreciated. Thank you!