Shoutbox

GetFileOpenName problem - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: GetFileOpenName problem (/showthread.php?tid=69348)

GetFileOpenName problem by deAd on 12-10-2006 at 09:48 PM

I have managed to open an Open dialog box with the ComDlg32 function GetFileOpenName function.

However, I cannot specify a filter. They are supposed to be separated by null characters ("\0"), but Plus! stops writing the string into the databloc when it gets to the first null character.

How can I specify a filter with this limitation in place?


RE: GetFileOpenName problem by Ezra on 12-10-2006 at 09:51 PM

http://shoutbox.menthix.net/showthread.php?tid=60...d=672068#pid672068


RE: GetFileOpenName problem by Felu on 12-11-2006 at 10:45 AM

or maybe http://www.mpscripts.net/code.php?id=28


RE: GetFileOpenName problem by Spunky on 12-11-2006 at 10:58 AM

quote:
Originally posted by -!Felu!-
code:
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;
}

Will that still work in JScript or should it be 0x4 or something :S

EDIT: Pasted code twice
RE: GetFileOpenName problem by Felu on 12-11-2006 at 11:10 AM

That works [Image: msn_tongue.gif]. And you pasted the code twice [Image: msn_confused.gif].


RE: GetFileOpenName problem by Spunky on 12-11-2006 at 12:12 PM

Just want to know for my own beneift now, does that only work because it is being sent as a string rather than a number? I'm sure I tried it like that before but without the quotes


RE: GetFileOpenName problem by -dt- on 12-11-2006 at 12:18 PM

quote:
Originally posted by SpunkyLoveMuff
quote:
Originally posted by -!Felu!-
code:
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;
}

Will that still work in JScript or should it be 0x4 or something :S

EDIT: Pasted code twice

you're right its susposed to be 0x4, &H just means hex in another langauge, but in js you use 0x. Also passing "&H4" is like passing "safswdfasdf" it means nothing to the program because its the wrong type and it has not a clue what &H4 means
RE: GetFileOpenName problem by deAd on 12-11-2006 at 10:38 PM

Thanks guys, I wanted to use the GetFileOpenName version instead though for various reasons, so thanks Ezra for the link!