What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » help with GetOpenFileName

help with GetOpenFileName
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: help with GetOpenFileName
Well, it seems like you first have to construct an OPENFILENAME structure, but I found something which is easier to use in my opinion.
code:
Original code by -!Felu!-, posted at the MP!L Script Developers Rescource
function BrowseForFile(InitialDir){
BrowseFilter = "Text Files (*.txt)|*.txt|All Files|*.*";
  var BrowseDialog = new ActiveXObject("UserAccounts.CommonDialog")
  BrowseDialog.Filter = BrowseFilter;
  BrowseDialog.InitialDir = InitialDir;
  BrowseDialog.Flags = "&H4";
  BrowseDialog.ShowOpen();
  return BrowseDialog.FileName;
}
Just call the function with a initial directory path (e.g.: "C:\") and it'll open a dialog and returns the chosen path.

NOTE: This object is only available since Windows XP, but because Windows Live Messenger and Messenger Plus! Live only support XP or higher, there's no need to think of supporting pre-XP. ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
02-24-2007 09:34 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
help with GetOpenFileName - by Dennis Mike on 02-24-2007 at 02:21 AM
RE: help with GetOpenFileName - by Matti on 02-24-2007 at 09:34 AM
RE: help with GetOpenFileName - by Felu on 02-24-2007 at 11:59 AM
RE: help with GetOpenFileName - by Matti on 02-24-2007 at 12:27 PM
RE: help with GetOpenFileName - by Dennis Mike on 02-24-2007 at 05:37 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On