What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How Can I Open Windows Explorer ?

Pages: (2): « First [ 1 ] 2 » Last »
How Can I Open Windows Explorer ?
Author: Message:
Lén
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Feb 2008
O.P. How Can I Open Windows Explorer ?
Hi,
After hours of research i've decided to post here...

So my problem is that i want to create a command that open the windows explorer like the /received command do for "My received files"  ... so if anybody knows how to do it...
02-06-2008 11:11 PM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: How Can I Open Windows Explorer ?
Something like this should work :)

code:
Interop.Call("shell32.dll", "ShellExecuteW", 0, "explore", "C:\directory", 0, 0, 1)

This post was edited on 02-06-2008 at 11:19 PM by Patchou.
[Image: signature2.gif]
02-06-2008 11:18 PM
Profile PM Web Find Quote Report
Lén
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Feb 2008
O.P. RE: How Can I Open Windows Explorer ?
I try it now
02-06-2008 11:26 PM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: How Can I Open Windows Explorer ?
You will need to use a double backslash for the path (e.g. "C:\\directory").
02-06-2008 11:27 PM
Profile PM Find Quote Report
Lén
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Feb 2008
O.P. RE: How Can I Open Windows Explorer ?
My script looks like it:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
    var explorer = '/explorer ';
        if(Message.substring(0,8)==explorer)
    {
    Interop.Call("shell32.dll", "ShellExecuteW", 0, "explore", "C:\\Documents and Settings", 0, 0, 1);
        return '';
    }
}

function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>BendeR</Name>';
            commands+='<Description>Multi-fonctions</Description>';
        commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}

function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd){
    if(MenuItemId=="enabled"){
        OriginWnd.SendMessage(OnEvent_ChatWndSendMessage("", "/explorer"));
    }
    if(MenuItemId=="about"){
        WndAbout = MsgPlus.CreateWnd("WndAbout.xml", "WndAbout");
    }
}

function OnGetScriptMenu(nLocation){
    var ScriptMenu = "<ScriptMenu>\n";
    if(nLocation===1){
        ScriptMenu    +=    "<MenuEntry Id=\"enabled\">Explorer</MenuEntry>";
        ScriptMenu    +=    "<Separator/>";
    }
    ScriptMenu    +=    "<MenuEntry Id=\"about\">À propos</MenuEntry>";
    ScriptMenu    += "</ScriptMenu>";
    return ScriptMenu;
}

But I miss something... 'cause it still not work :(

EDIT:
there isn't a /explorer in the command window, why?

This post was edited on 02-06-2008 at 11:56 PM by Lén.
02-06-2008 11:45 PM
Profile PM Find Quote Report
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
RE: RE: How Can I Open Windows Explorer ?
quote:
Originally posted by Lén
there isn't a /explorer in the command window, why?

code:
function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>BendeR</Name>';
            commands+='<Description>Multi-fonctions</Description>';
        commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}


The part in bold defines what is shown in the command window, so it needs to be

code:
commands+='<Name>explorer</Name>'

Also, after quickly looking at your code, the lines
code:
var explorer = '/explorer ';
if(Message.substring(0,8)==explorer)
should be
code:
var explorer = '/explorer';
if(Message.substring(0,9)==explorer)


Hope this helps. :)
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
02-07-2008 12:13 AM
Profile PM Find Quote Report
Lén
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Feb 2008
O.P. RE: How Can I Open Windows Explorer ?
OMG! you're great !!
All work ! thanks guys

02-07-2008 12:21 AM
Profile PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: How Can I Open Windows Explorer ?
quote:
Originally posted by fatfreechicken
Also, after quickly looking at your code, the lines

code:

var explorer = '/explorer ';
if(Message.substring(0,8)==explorer)



should be
code:

var explorer = '/explorer';
if(Message.substring(0,9)==explorer)





Hope this helps. 


I'm fairly certain it only needs 8, not 9... It's zero based
<Eljay> "Problems encountered: shit blew up" :zippy:
02-07-2008 12:23 AM
Profile PM Find Quote Report
Lén
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Feb 2008
O.P. RE: How Can I Open Windows Explorer ?
Let's Tryin'....

Biiiip !!! Wroong!


No ... it doesn't work with 8 on my script... (he is a rebel, or it is normal... who cares ^^).
02-07-2008 12:36 AM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: How Can I Open Windows Explorer ?
quote:
Originally posted by SpunkyLoveMuff
I'm fairly certain it only needs 8, not 9... It's zero based

The first parameter is zero-based because it's an offset, but the second parameter is just the length of the substring.
02-07-2008 12:44 AM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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