What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Testing] CViewer (Version 1.0)

[Testing] CViewer (Version 1.0)
Author: Message:
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
RE: [Testing] CViewer (Version 1.0)
It's really useful (Y), but when your script is initialized for first time an error is shown in the Scripting Debugging window and sometimes, one of the applications suddenly crashed ending with a #51 error.
code:
Script is starting
Script is now loaded and ready
Function called: OnEvent_Initialize
Error: Raíz no válida en la clave del registro "HKCU\SOFTWARE\Patchou\Messenger Plus! Live\GlobalSettings\Scripts\CViewer\Settings\Last_Text". (code: -2147024894)
       File: CViewer.js. Line: 86.
Function OnEvent_Initialize returned an error. Code: -2147352567
I've just taken a look at the source and made some changes for personal usage.
code:
var WM_DRAWCLIPBOARD = 0x308;
var CF_TEXT = 1;
var CF_OEMTEXT = 7;
var CF_UNICODETEXT = 13;

function OnEvent_Initialize(){
    wnd = MsgPlus.CreateWnd('Interface.xml', 'WndHistory');
    wnd.RegisterMessageNotification(WM_DRAWCLIPBOARD);
   
    Interop.Call('user32', 'SetClipboardViewer', wnd.Handle);
    MakeWndTransparent(wnd.Handle, trans);
}


function OnWndHistoryEvent_MessageNotification(PlusWnd, Message, wParam, lParam){
    switch (Message)    {
    case WM_DRAWCLIPBOARD:
        Interop.Call('user32', 'OpenClipboard', PlusWnd.Handle);
        if (Interop.Call('user32', 'IsClipboardFormatAvailable', CF_TEXT | CF_OEMTEXT ))
        {
            var handle=    Interop.Call('user32', 'GetClipboardData', CF_UNICODETEXT);
            var size    =    Interop.Call('kernel32', 'GlobalSize', handle);
            var str    =    Interop.Allocate(2 * (size + 1));
            Interop.Call('kernel32', 'RtlMoveMemory', str, handle, size);
            PlusWnd.LstView_AddItem('history', str.ReadString(0));
            str.Size=0;
        }
        Interop.Call('user32', 'CloseClipboard');   
    break;
    }
}
so you won't need to use any timer, or read/write data from/into the windows registry... anymore :)
02-03-2008 04:40 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Testing] CViewer (Version 1.0) - by Spunky on 02-02-2008 at 08:55 PM
RE: [Testing] CViewer (Version 1.0) - by felipEx on 02-03-2008 at 04:40 PM
RE: [Testing] CViewer (Version 1.0) - by Spunky on 02-04-2008 at 07:33 AM
RE: [Testing] CViewer (Version 1.0) - by felipEx on 02-05-2008 at 10:40 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