What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Command Bar | [release] 1.1

Command Bar | [release] 1.1
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Command Bar | [release] 1.0
quote:
Originally posted by whiz
Known Issues
  • pressing Enter to submit the command doesn't work - you have to click the Ok button (if anyone knows how to solve this, please say - the Ok button is in the parent, but the text box is in the child)

Register the WM_KEYUP (Or WM_KEYDOWN; whatever your fancy) message and watch for the VK_RETURN key?

Javascript code:
/*
 
    Added to Main Child Window.js
 
*/
function OnWndCommandBar_CMainEvent_MessageNotification(PlusWnd, Message, wParam, lParam)
{
    if (Message == 0x100) // WM_KEYDOWN
    {
        if ( wParam === 0xD )
        {  
            OnWndCommandBar_ShellEvent_CtrlClicked( WndCommandBar_CMain , 'BtnOk' )
            return 1;
        }
    }
    return -1;
}
 
/*
 
    Added to Command Bar.js
 
*/
function OnEvent_Initialize(MessengerStart)
{
    WndCommandBar_Shell = MsgPlus.CreateWnd("Windows.xml", "WndCommandBar_Shell", 0);
    WndCommandBar_CMain = MsgPlus.CreateChildWnd(WndCommandBar_Shell, "Windows.xml", "WndCommandBar_CMain", 12, 2);
    WndCommandBar_Shell.RegisterMessageNotification(0x5, true);
    WndCommandBar_CMain.RegisterMessageNotification(0x100, true);    IntCurrentChild = 0;
    OnWndCommandBar_ShellEvent_MessageNotification(WndCommandBar_Shell, 0x5);
    if (MessengerStart || Messenger.MyStatus < 2)
    {
        Enable(true);
    }
}


Also never use the parameter from OnEvent_Initialize. It only describes how the script was started.

Instead make the code change to look something like this:

Javascript code:
function OnEvent_Initialize(MessengerStart) {
    if (Messenger.MyStatus < STATUS_INVISIBLE) return false;
 
    WndCommandBar_Shell = MsgPlus.CreateWnd("Windows.xml", "WndCommandBar_Shell", 0);
    WndCommandBar_CMain = MsgPlus.CreateChildWnd(WndCommandBar_Shell, "Windows.xml", "WndCommandBar_CMain", 12, 2);
    WndCommandBar_Shell.RegisterMessageNotification(0x5, true);
    WndCommandBar_CMain.RegisterMessageNotification(0x100, true);
    IntCurrentChild = 0;
    OnWndCommandBar_ShellEvent_MessageNotification(WndCommandBar_Shell, 0x5);
   
    Enable(true);
}
 
function OnEvent_Signin(Email)
{
    OnEvent_Initialize();
}


This post was edited on 09-16-2009 at 07:50 PM by matty.
09-16-2009 07:41 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Command Bar | [release] 1.1 - by whiz on 09-16-2009 at 07:32 PM
RE: Command Bar | [release] 1.0 - by matty on 09-16-2009 at 07:41 PM
RE: Command Bar | [release] 1.0 - by whiz on 09-16-2009 at 07:48 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