What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Interface Writer | [release] 3.0 | 22/08/2010

Pages: (14): « First « 4 5 6 7 [ 8 ] 9 10 11 12 » Last »
2 votes - 5 average   Interface Writer | [release] 3.0 | 22/08/2010
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Interface Writer | [release] 2.5 | 30/01/2010
That's weird..

Could you try:

JScript code:
var length = (Interop.Call("User32.dll","SendMessageW",Edit,WM_GETTEXTLENGTH,0,0) + 1);
var Buffer = Interop.Allocate((length + 1) * 2);
var lResult = Interop.Call("User32.dll","SendMessageW",Edit,WM_GETTEXT,length,Buffer.DataPtr);
// MessageBox is a class in my script; use your AlertDialog instead
//MessageBox.Show("Copied\t: " + lResult + "\nLength\t: " + length);

Works for me.

Nb: the length variable contains (GetTextLengthResult + 1)!

This post was edited on 02-13-2010 at 08:49 AM by SmokingCookie.
02-13-2010 08:49 AM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
quote:
Originally posted by SmokingCookie
That's weird..

Could you try:

JScript code:
var length = (Interop.Call("User32.dll","SendMessageW",Edit,WM_GETTEXTLENGTH,0,0) + 1);
var Buffer = Interop.Allocate((length + 1) * 2);
var lResult = Interop.Call("User32.dll","SendMessageW",Edit,WM_GETTEXT,length,Buffer.DataPtr);
// MessageBox is a class in my script; use your AlertDialog instead
//MessageBox.Show("Copied\t: " + lResult + "\nLength\t: " + length);

Works for me.

Nb: the length variable contains (GetTextLengthResult + 1)!
Didn't work at first - said "Edit" was undefined.  I assumed that was the handle of the ListViewControl - WndWriterManageWindows.SendControlMessage("LstWindows", 4120, 0, 0); - but I end up with the following message:
code:
Copied    : 11
Length    : 1
The "Copied" value is actually the length, and "Length" always returns "1" (a number, not a string - a boolean, maybe?).  Any more ideas?
02-14-2010 10:50 AM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Interface Writer | [release] 2.5 | 30/01/2010
quote:
Originally posted by MSDN
Return Value

    The return value is the length of the text in TCHARs, not including the terminating null character.

(see http://msdn.microsoft.com/en-us/library/ms632628%28VS.85%29.aspx)

It should return the visible length (that is, text you can read)... *-)

But you more or less have it working now: Buffer.readSTRING(0); should return the new filename/control ID or whatever you want to rename this way.

Oh and don't forget to collect garbage: always destroy DataBloc objects (if possible), by setting its size to zero:

JScript code:
var Buffer = Interop.Allocate(123);

Buffer.Size = 0;

There are just a few situations in which you cannot destroy memory blocks instantly, but I don't think you'll be in any of those.
02-14-2010 11:01 AM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
js code:
AlertDialog("Copied\t: " + lResult + "\nLength\t: " + length + "\n\nValue\t: " + Buffer.readSTRING(0) + " (" + Buffer.readSTRING(0).length + ")");
code:
Copied    : 11
Length    : 1

Value    :  (0)
:S
02-14-2010 11:22 AM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Interface Writer | [release] 2.5 | 30/01/2010
Could you post the entire OnWindowIdEvent_MessageNotification(...); function?
02-14-2010 12:53 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
Actually, don't worry.  I've worked it out: I had WM_GETTEXT and WM_GETTEXTLENGTH the wrong way round...  :P

Just one last question: how can I trigger the rename box to appear, other than clicking on the entry in the ListViewControl (for example, through a right-click menu or button)?
02-14-2010 01:41 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Interface Writer | [release] 2.5 | 30/01/2010
Yeah, that makes a whole lot of difference :P

The menu thingy is gonna be very complex. If you want an example, look at my code again. Search for "OnWndSettings_LanguageEvent_LstViewRClicked" in the same file you found the message notification event. If there's anything you need explained, I'm here.

As for the button: that'll be easier:

JScript code:
function OnWindowIdEvent_CtrlClicked(PlusWnd,ControlId) {
    if(ControlId === "BtnRename") {
        Interop.Call("User32.dll",
        "SendMessageW",
        PlusWnd.GetControlHandle("MyListView"),
        LVM_EDITLABELW,ItemToRename,0);
    }
}

You can get the ItemToRename value by declaring a global variable and assigning it in each list-view event. Be sure to assign it -1 when the window is destroyed.

This post was edited on 02-14-2010 at 01:50 PM by SmokingCookie.
02-14-2010 01:44 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
quote:
Originally posted by file "Video Converter Plus! \ WndSettings_Language.js"
To stop the page extending, I've hidden the code in this post.  :)
Spoiler:
js code:
if(Cache.Languages["Array"][Cache["LanguageSelection"]] === "English.xml") return ScriptLanguage.DisplayAlert(PlusWnd.Handle,"AlertEnglishRequired");
>>>Interop.Call("User32.dll","SendMessageW",PlusWnd.GetControlHandle("vLstLanguages"),LVM_EDITLABELW,Cache["LanguageSelection"],0);<<<
for(var i in Cache[PlusWnd.WindowId].Hotkeys) Cache[PlusWnd.WindowId].Hotkeys[i].Unregister();
break;

js code:
Interop.Call("User32.dll", "SendMessageW", WndWriterManageWindows.GetControlHandle("LstWindows"), 4214, Writer.WndSel[0], 0);
It works!  :P  Thanks for all your help!

Edit: check your reputation...  ;)

This post was edited on 02-16-2010 at 02:59 PM by whiz.
02-14-2010 02:00 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Interface Writer | [release] 2.5 | 30/01/2010
You're welcome :)

Oh, and in what windows will you be implementing this?
02-14-2010 02:04 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
quote:
Originally posted by SmokingCookie
You're welcome :)

Oh, and in what windows will you be implementing this?
I'll probably use it with the window, control and element managers (all the ones with a ListViewControl).  :D
02-14-2010 02:12 PM
Profile E-Mail PM Find Quote Report
Pages: (14): « First « 4 5 6 7 [ 8 ] 9 10 11 12 » 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