Jump to content

How to open anything from a folder?


Chimaera
 Share

Recommended Posts

Im trying to make a customizable gui that end user can add his stuff to.

Its just basic buttons etc and a folder structure that the user can put his files into with an image and it works from the button.

Now ive added an ini so they can set the files that need to run, which works with exes text files shortcuts but i cant get it to open webpages ..

Normal button works like this

Case $hButton1
                Local $ExeTest_1 = IniRead($IniFile, 'Button_1', 'button_1_filename', 'Error')
                ShellExecute(@ScriptDir & '\settings\button_1\' & $ExeTest_1)

Ini like this

; ---------------------------
[Button_1]
button_1_filename=CCleaner.exe
button_1_tooltip=CCleaner
button_1_icon=ccleaner.bmp
; ---------------------------
[Button_2]
button_2_filename=test.txt
button_2_tooltip=My TextFile
button_2_icon=textfile.bmp
; ---------------------------
[Button_3]
button_3_filename=
button_3_website=http://www.bbc.co.uk
button_3_tooltip=BBC Website
button_3_icon=bbc.bmp
; ---------------------------

As you can see ive added a weblink but it throws an error that it cant find the folder structure and file as it thinks its a file not a webpage

This works for webpages fine

Case $hButton4
                ShellExecute('http://www.bbc.co.uk')

Is there a simple way to detect whats in the folder and make it just start it with shellexecute?

The ini started off being a good idea but is starting to get complicated

I just want it to open what ever is placed in the folder shortcut/webpage/program etc etc

Any thoughts?

Link to comment
Share on other sites

Years ago i had the same idea. My solution uses Listviews, where the user can drop EXE's, MP3's, etc. and start them by Doubleclick: https://autoit.de/index.php/Attachment/76266-AutoStarter74-zip/.

I used simple file to store the data:

I think your problem with Website's is that the parameter for Shellexecute  isn't 'http://www.bbc.co.uk' . So just use ConsoleWrite to output the parameter and you's see what you have to change.

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...