LB Booster
Programming >> BASIC code examples >> Open With dialog
http://lbb.conforums.com/index.cgi?board=code&action=display&num=1433927503

Open With dialog
Post by Richard Russell on Jun 10th, 2015, 09:11am

Somebody asked, by email, how to display the Open With dialog in LB code. Here you go:

Code:
    file$ = DefaultDir$ + "\OpenWith.bas" ' for example
    wide$ = space$(2 * _MAX_PATH)
    struct oai, pcszFile$ as ptr, pcszClass$ as ptr, oaifInFlags as long
    calldll #kernel32, "MultiByteToWideChar", 0 as long, 0 as long, _
      file$ as ptr, -1 as long, wide$ as ptr, _MAX_PATH as long, r as long
    oai.pcszFile$.struct = wide$
    oai.oaifInFlags.struct = 4
    calldll #shell32, "SHOpenWithDialog", 0 as long, oai as struct, r as long 

Richard.