Jump to content

I need help with a button.....


Samir90
 Share

Go to solution Solved by Morthawt,

Recommended Posts

Here is the script
 
#include <GUIconstants.au3>
$fraps = GUICreate("Open",298,152,516,409)
$button = GUICtrlCreateButton("open",72,16,153,49)
GUISetState(@SW_SHOW)
 
While 1
$nmsg = GUIGetMsg()
Switch $nmsg
Case $gui_event_close
Exit
Case $button
Run ("C:UsersMyNameDesktoptest.txt")
EndSwitch
WEnd
#RequireAdmin
 
 
I dont know why this script don't open the text.txt when I press the "open" button
If someone could help me will be great
 
Thx in advance
 
 
 
 
Link to comment
Share on other sites

  • Solution

Replace Run with ShellExecute

Run is for an actual program while with ShellExecute you can open websites, text files etc.

Also on a side note, you have set specific coordinates for your GUI to display at. If instead you set the last two parameters to -1 the GUI will always show on the screen in the centre of the screen no matter the resolution.

Edited by Morthawt
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...