Jump to content

Ask about the buttons and interface


Recommended Posts

I have a script to buttons. But when I insert links into buttons are not. The problem is there. Please help. Thanks!
 

#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
HotKeySet("{Esc}","_Exit") ;->Exit


$Gui = GUICreate("Test", 800, 600) ;Fenster erstellen
_SkinGUI("X2FL.dll", "X2FL Skin.skf", $Gui) ;Skin setzen










GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") ;-Exit




If @OSArch = "X64" Then DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
Local $sl, $Gui
main()
Func main()
$button1 = GUICtrlCreateButton("Web 1", 40, 48, 100, 33)
$button2 = GUICtrlCreateButton("Web 2", 180, 48, 100, 33)






GUISetState(@SW_SHOW, $Gui)
    While 1
        $msg = GUIGetMsg()
        Switch $msg
            Case $button1
                ShellExecute("https://facebook.com")
            Case $button2
                ShellExecute("http://sinhvienit.net")
        EndSwitch
    WEnd
EndFunc








while 1 ;Warte-Schleife
Sleep(100)
wend




Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle) 
   $Dll = DllOpen($SkincrafterDll) 
   DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "SKINCRAFTER", "wstr", "SKINCRAFTER.COM", "wstr", "support@skincrafter.com", "wstr", "DEMOSKINCRAFTERLICENCE") 
   DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1) 
   DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin) 
   DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25) 
   DllCall($Dll, "int:cdecl", "ApplySkin")
   
EndFunc






func _exit()
Exit
 EndFunc

http://upfile.vn/IgFQNTBC7ajm/x2fl-skin-skf.html
http://upfile.vn/_TBC7ajmImIg/x2fl-dll.html
 

 

 

 

5.au3

Link to comment
Share on other sites

Remove the following lines from your script.
 

Opt("GUIOnEventMode", 1)


GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") ;-Exit

And change your Switch statement to this:

Switch $msg
            Case $button1
                ShellExecute("https://facebook.com")
            Case $button2
                ShellExecute("http://sinhvienit.net")
            Case $GUI_EVENT_CLOSE ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                Exit
        EndSwitch

You can NOT use OnEvent mode and messageloop mode in the same script without some coding gymnastics.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Remove the following lines from your script.

 

Opt("GUIOnEventMode", 1)


GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") ;-Exit

And change your Switch statement to this:

Switch $msg
            Case $button1
                ShellExecute("https://facebook.com")
            Case $button2
                ShellExecute("http://sinhvienit.net")
            Case $GUI_EVENT_CLOSE ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                Exit
        EndSwitch

You can NOT use OnEvent mode and messageloop mode in the same script without some coding gymnastics.

 

Thanks !  There is a further problem. After compiling the Skin can not run the file-copy 5.exe out desktop.

Help me, please!!!

Link to comment
Share on other sites

I'm guessing you're not getting help because,  unfortunately, your question isn't clear. What exactly is the problem you're having?

If you're having problems describing it in English, post in your native language and we'll try and translate it. Hopefully that will help.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

If you want the GUI to be skinned, you need to include the DLL and the skin file with the compiled exe. The easiest way to do that is to use the FileInstall function to add them to the compiled script.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...