Open the “Open with ” Dialog ...

Windows specific forum
Axolotl
Addict
Addict
Posts: 871
Joined: Wed Dec 31, 2008 3:36 pm

Open the “Open with ” Dialog ...

Post by Axolotl »

If the user should be able to open a file and select the program himself ....

Code: Select all

Procedure OpenFileWithAppFromList(FileName.s) 
  If FileSize(FileName) > -1 
    RunProgram("Rundll32.exe", "shell32.dll,OpenAs_RunDLL "+FileName, GetPathPart(FileName)) 
  EndIf 
EndProcedure 

OpenFileWithAppFromList("C:\Temp\GX_Test_00.bmp") ; <= change this filename to an existing one.  
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Quin
Addict
Addict
Posts: 1135
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Open the “Open with ” Dialog ...

Post by Quin »

Nice, added to my Procedure collection.
Works on Windows 10 21H2 IoT. Thanks for sharing!
hdt888
User
User
Posts: 53
Joined: Sun Jul 07, 2024 8:42 am

Re: Open the “Open with ” Dialog ...

Post by hdt888 »

Axolotl ! Nice sharing.
PB 5.x + 6.x + Win10. Feel the ...Pure... Power.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5498
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Open the “Open with ” Dialog ...

Post by Kwai chang caine »

Works nice thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
Post Reply