Jump to content

Recommended Posts

Posted (edited)

Hello, i need your help guys, i have creat a program that when i hit click on a button to open me a program, the problem is that when i hit that button the only program i could run is notepad....i dont know why but i cant run any program beside notepad, i want to open a program like photoshop, so when i run my program and click the button to run Photoshop, could someone help me with this? here is the code

#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
Global $ExitID
_Main()
Func _Main()
Local $Ctl, $NoID
GUICreate("CWelcome",600, 600)
GUICtrlCreateLabel("Click pe numele tau pentru a putea accesa conturile", 200, 10)
$Ctl = GUICtrlCreateButton("Ctl", 10, 50, 50, 20)
GUICtrlSetOnEvent($Ctl, "OnCtl")
$ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
GUICtrlSetOnEvent($ExitID, "OnExit")
GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit")
GUISetState() ; display the GUI
While 1
  Sleep(1000)
WEnd
EndFunc   ;==>_Main
;--------------- Functions ---------------
Func OnCtl()
Run("notepad.exe")
EndFunc  
Func OnExit()
If @GUI_CtrlId = $ExitID Then
  MsgBox(0, "You clicked on", "Exit")
Else
  MsgBox(0, "You clicked on", "Close")
EndIf
Exit
EndFunc
Edited by ctl
Posted

Hello, i need your help guys, i have creat a program that when i hit click on a button to open me a program, the problem is that when i hit that button the only program i could run is notepad....i dont know why but i cant run any program beside notepad, i want to open a program like photoshop, so when i run my program and click the button to run Photoshop, could someone help me with this? here is the code

#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
Global $ExitID
_Main()
Func _Main()
Local $Ctl, $NoID
GUICreate("CWelcome",600, 600)
GUICtrlCreateLabel("Click pe numele tau pentru a putea accesa conturile", 200, 10)
$Ctl = GUICtrlCreateButton("Ctl", 10, 50, 50, 20)
GUICtrlSetOnEvent($Ctl, "OnCtl")
$ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
GUICtrlSetOnEvent($ExitID, "OnExit")
GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit")
GUISetState() ; display the GUI
While 1
  Sleep(1000)
WEnd
EndFunc   ;==>_Main
;--------------- Functions ---------------
Func OnCtl()
Run("notepad.exe")
EndFunc   ;==>OnYes
Func OnExit()
If @GUI_CtrlId = $ExitID Then
  MsgBox(0, "You clicked on", "Exit")
Else
  MsgBox(0, "You clicked on", "Close")
EndIf
Exit
EndFunc

search the help file on how to use the run command...

Using it the way you are now, the run command will only look for anyfile named notepad.exe in the windows directory, home drive base and current script directory, try including the full path to the file.

Posted

Ohh you mean like Run("photoshop.exe" C:/program files/Adobe) ?

close, more like Run(filegetshortname("C:/program files/Adobe/photoshop.exe"))

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
×
×
  • Create New...