What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » UserAccounts.CommonDialog alternative for Vista

UserAccounts.CommonDialog alternative for Vista
Author: Message:
Guena
Full Member
***

Avatar

Posts: 102
Reputation: 5
43 / Male / Flag
Joined: Nov 2008
O.P. UserAccounts.CommonDialog alternative for Vista
First of all my Script is made to allow anybody to add his own picture to backgrounds available in my Skin "Avalon Concept 2009"

I use the following code to browse for a file: (come from the script "Backround Adder" and used with authorisation)

code:
function OnBackgroundWndenEvent_CtrlClicked(pPlusWnd, sControlId) {
    var FSO = new ActiveXObject("Scripting.FileSystemObject");
    var sourceFile = pPlusWnd.GetControlText('EdtFrom').replace(/(^\s*)|(\s*$)/g, '');
    switch (sControlId) {
        case 'BtnLoc':
            var oOpenDlg = new ActiveXObject('UserAccounts.CommonDialog');
            oOpenDlg.FileName = sourceFile;
            oOpenDlg.Filter =    'All Pictures|*.BMP;*.DIB;*.EMF;*.GIF;*.ICO;*.JPG;*.JPEG;*.JPE;*.JFIF;*.JIF;*.PNG;*.RLE;*.TIF;*.TIFF;*.WMF;|'
                        +    'All Files (*.*)|*.*|'
                        +    'Bitmaps (*.BMP)|*.BMP|'
                        +    'JPEG (*.JPG;*.JPEG)|*.JPG;*.JPEG|'
                        +    'Portable Network Graphics (*.PNG)|*.PNG|';
            oOpenDlg.FilterIndex = (oOpenDlg.FileName === '' || oOpenDlg.Filter.indexOf("." + FSO.GetExtensionName(oOpenDlg.FileName).toUpperCase() + ';') !== -1) ? 1 : 2;
            oOpenDlg.Flags = 0x1000 | 0x800 | 0x4;
            oOpenDlg.ShowOpen();
            pPlusWnd.SetControlText('EdtFrom', (oOpenDlg.FileName === '') ? '' : FSO.GetAbsolutePathName(oOpenDlg.FileName));
            break;
        case 'BtnOk':
            AddBackground(sourceFile);   
            pPlusWnd.Close(1);
            break;
        case 'BtnAbout':
            MsgPlus.CreateWnd('BackgroundAdder.xml', 'AboutWnden');
            pPlusWnd.Close(1);
            break;
    }
}

but it works only on XP not on vista, could someone please help me?

Thanks

This post was edited on 01-19-2009 at 11:43 PM by Guena.
01-19-2009 11:21 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
UserAccounts.CommonDialog alternative for Vista - by Guena on 01-19-2009 at 11:21 PM
RE: UserAccounts.CommonDialog alternative for Vista - by ArkaneArkade on 01-20-2009 at 08:32 PM
RE: UserAccounts.CommonDialog alternative for Vista - by matty on 01-20-2009 at 09:01 PM
RE: RE: UserAccounts.CommonDialog alternative for Vista - by Guena on 01-22-2009 at 12:11 AM
RE: UserAccounts.CommonDialog alternative for Vista - by CookieRevised on 11-07-2009 at 03:55 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