Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Open Windows File Explorer

Author
Message
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 14th Feb 2018 16:07 Edited at: 14th Feb 2018 16:08
My game lets users create art. I would like to allow users on windows to open file explorer and look at their art on their computers.

There are a lot of threads and apparent workarounds, but none of them appear to do this seemingly-simple thing.

I can open websites and run other apps, (openbrowser() , viewfile()) , but i can't figure out how to do this.

HELP?!

Attachments

Login to view attachments
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 14th Feb 2018 16:36 Edited at: 14th Feb 2018 16:39
You could try calling RunApp( "explorer", "/n,c:\temp" )

You start the explorer app and tell it what directory or file to look at.... Ive not actually tried this though and im at work so could give it a go later... Obviously, you need the path of the folder you want to look at instead of "c:\ temp" above
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Feb 2018 16:39 Edited at: 14th Feb 2018 16:46
or you can use windows api and a c++ project
this will make a dll that you can use in tier1 basic.
https://www.appgamekit.com/documentation/guides/14_plugins.htm
https://msdn.microsoft.com/library/
https://msdn.microsoft.com/de-de/library/windows/desktop/ff818516(v=vs.85).aspx
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Feb 2018 16:46 Edited at: 14th Feb 2018 16:47
Yes or you can use my plugin
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 14th Feb 2018 17:48
Hi, Madbit, I saw your plugin, but i wasn't sure which command would actually do that. And also, does it use the built-in windows file explorer, or something else (like it's own interface). I want it to be native so users can drag and drop into twitter or something.

Bengismo, RunApp( "explorer.exe", a$ ) that actually works! But it opens to "this pc/documents" . i tried several variations of the path i want, but i couldn't get it to open anywhere else.

Thanks all!

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Feb 2018 18:08
ChooseFileDialog would be the right thing. It uses the native open dialog of Windows. I don't know if you can pull something out of it by drag-and-drop.
For what you're planning to do, I think that explorer is the best idea.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 14th Feb 2018 18:39 Edited at: 14th Feb 2018 18:44
RunApp( "explorer.exe", a$ )

This works absolutely fine and WILL open in any directory you like but it needs backwards slashes in the file path c::\path\path2\path3 is fine but c:/name/name isnt!!

If you use / slashes the path isnt valid and so it defualts to the my documents folder

So...try this code



Ive managed to open any directory I want to....

Theres also GetWritePath(), GetCurrentDir() and GetDocumentsPath() to get the standard directories without having to hardcode anything

plus if you use
a$ = "/n,"+a$ - you can open multiple explorer windows
a$ = "/select,"+a$ - you can open the explorer window and even select the filename you just saved
There are other options too...

No need for plugins to do this! lol (...funny how some edits have occurred since I posted)
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 14th Feb 2018 20:09
wooo hooooo!!!

that does it for sure, thank you so much!

Login to post a reply

Server time is: 2024-04-19 23:29:14
Your offset time is: 2024-04-19 23:29:14