|  How Can I Open Windows Explorer ? | 
| Author: | 
Message: | 
Lén 
Junior Member 
  
  
  
 
Posts: 16 
36 /   /   
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 | 
 | 
  | 
Patchou 
Messenger Plus! Creator 
     
  
  
 
Posts: 8605 Reputation: 201 
44 /   /   
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.
 |   
 | 
| 02-06-2008 11:18 PM | 
 | 
  | 
Lén 
Junior Member 
  
  
  
 
Posts: 16 
36 /   /   
Joined: Feb 2008 
 | 
| 
O.P.  RE: How Can I Open Windows Explorer ?
 I try it now 
 |   
 | 
| 02-06-2008 11:26 PM | 
 | 
  | 
Eljay 
Elite Member 
     
  
  
:O
  
Posts: 2945 Reputation: 77 
– /   / – 
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 | 
 | 
  | 
Lén 
Junior Member 
  
  
  
 
Posts: 16 
36 /   /   
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 | 
 | 
  | 
pollolibredegrasa 
Full Member 
   
  
  
formerly fatfreechicken
  
Posts: 483 Reputation: 34 
36 /   /   
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 
 
  Vaccy is my thin twin! ![[Image: chickennana.gif]](http://shoutbox.menthix.net/images/smilies/chickennana.gif)   
 |   
 | 
| 02-07-2008 12:13 AM | 
 | 
  | 
Lén 
Junior Member 
  
  
  
 
Posts: 16 
36 /   /   
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 | 
 | 
  | 
Spunky 
Former Super Mod 
     
  
  
 
Posts: 3656 Reputation: 61 
37 /   /   
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"    
 |   
 | 
| 02-07-2008 12:23 AM | 
 | 
  | 
Lén 
Junior Member 
  
  
  
 
Posts: 16 
36 /   /   
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 | 
 | 
  | 
Eljay 
Elite Member 
     
  
  
:O
  
Posts: 2945 Reputation: 77 
– /   / – 
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 | 
 | 
  | 
| 
Pages: (2): 
« First
  
 [ 1 ]
 2
 
»
 
Last »
 | 
| 
 |