| View previous topic :: View next topic |
| Author |
Message |
Alice0725 Expert Cheater
Reputation: 11
Joined: 24 Jul 2012 Posts: 145
|
Posted: Thu Aug 02, 2012 7:16 pm Post subject: [Solved]How to launch a game with OpenDialog? |
|
|
Target: When I click on an image , an OpenFileDialog shows, then I can locate "game.exe" and run it.
ex.TCEOpenDialog Names "CEOpenDialogLauncher".
Like this ?
| Code: |
function onImageClick(sender)
openDialog_execute("CEOpenDialogLauncher")
end
|
It does not work. Please Help me:
1. How to show the Open File Dialog?
2. How to exeute "game.exe" from that dialog?
Last edited by Alice0725 on Thu Aug 02, 2012 10:10 pm; edited 1 time in total |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Thu Aug 02, 2012 9:31 pm Post subject: |
|
|
You open the openfile dialog by executing this code:
| Code: |
pathtofile=openDialog_execute(Formname_CEOpenDialogLauncher)
|
where formname is the name of the form the dialog object is part of
When that has been executed, and the user did not click cancel but actually selected a file to launch, "pathtofile" will contain the full path to that file.
You can then use shellExecute or one of the lua/os native calls to launch it.
example:
| Code: |
shellExecute(pathtofile)
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Alice0725 Expert Cheater
Reputation: 11
Joined: 24 Jul 2012 Posts: 145
|
Posted: Thu Aug 02, 2012 10:09 pm Post subject: |
|
|
| Dark Byte wrote: | You open the openfile dialog by executing this code:
| Code: |
pathtofile=openDialog_execute(Formname_CEOpenDialogLauncher)
|
where formname is the name of the form the dialog object is part of
When that has been executed, and the user did not click cancel but actually selected a file to launch, "pathtofile" will contain the full path to that file.
You can then use shellExecute or one of the lua/os native calls to launch it.
example:
| Code: |
shellExecute(pathtofile)
|
|
Thanks!
|
|
| Back to top |
|
 |
|