Open the “Open with ” Dialog ...

Windows specific forum
Axolotl
Addict
Addict
Posts: 832
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: 1132
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!
Post Reply