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();
}