Interface Writer | [release] 3.0 | 22/08/2010 |
Author: |
Message: |
MeEtc
Patchou's look-alike
In the Shadow Gallery once again
Posts: 2200 Reputation: 60
38 / /
Joined: Nov 2004
Status: Away
|
RE: Interface Writer | [release] 2.5 | 30/01/2010
I'm getting an error when trying to launch this, and not able to show the menu..
code: Script is starting
+----------------------+
| Interface Writer 2.5 |
+----------------------+
<-- Start version check. -->
--> Checking for version registry key...
--> | Current version: 2.5
--> | Unable to retrieve previous version.
--> | | Displaying first run dialog...
--> Saving version registry key...
--> | Key saved. Value: 2.5
<-- End version check. -->
Script is now loaded and ready
Error: Invalid root in registry key "HKCU\SOFTWARE\Patchou\Messenger Plus! Live\GlobalSettings\Scripts\Interface Writer\Settings\id and email\Options\ChkDebug". (code: -2147024894)
File: FnRegistryObj.js. Line: 19.
Function OnEvent_Initialize returned an error. Code: -2147352567
Error: Invalid root in registry key "HKCU\SOFTWARE\Patchou\Messenger Plus! Live\GlobalSettings\Scripts\Interface Writer\Settings\id and email\Recent". (code: -2147024894)
File: FnRegistryObj.js. Line: 19.
Function OnGetScriptMenu returned an error. Code: -2147352567
I cannot hear you. There is a banana in my ear.
|
|
01-31-2010 02:40 AM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
Oops, didn't check for it not existing... I'll fix it later today.
Edit: I've fixed the Debug key glitch, but I can't reproduce the Recent key error. It might be because of a previous version - try uninstalling it and reinstalling the updated version on the first post.
This post was edited on 01-31-2010 at 10:46 AM by whiz.
|
|
01-31-2010 08:48 AM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
quote: Originally posted by SmokingCookie
I have a suggestion for any future update (don't rush to the next version, just add to your to-do list if you want): rename any component (like window ID, control ID, etc.) from within the list-view. Basically like renaming a file or folder in Windows Explorer. Screenshot of what I mean:
(image)
If you need any help on this, you know where to find me. You can also take a look at the code; see the link in my signature for the script.
Well, I'm guessing it's something to do with this...
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();
But I would have no idea how to implement it...
|
|
01-31-2010 04:00 PM |
|
|
SmokingCookie
Senior Member
Posts: 815 Reputation: 15
30 / /
Joined: Jul 2007
|
RE: Interface Writer | [release] 2.5 | 30/01/2010
Well, I think this is the easy part:
JScript code: Interop.Call("User32.dll","SendMessageW",PlusWnd.GetControlHandle("MyListView"),LVM_EDITLABELW,ItemToRename,0);
You should then listen for WM_NOTIFY ( = 0x004E) notifications. That's where the tricky part comes in: Along with WM_NOTIFY, an NMHDR structure is passed, which can be moved to a known location by RtlMoveMemory (see MSDN). Reading the data at position 8, you should find LVN_ENDLABELEDITW ( = LVN_FIRST - 76; LVN_FIRST = 0 - 100). You must retrieve the edit control's handle through LVM_GETEDITCONTROL ( = LVM_FIRST + 24; LVM_FIRST = 0x1000). Once you know the handle to the edit control, you can retrieve its text length and text itself with WM_GETTEXTLENGTH ( = 0x000E) and WM_GETTEXT ( = 0x000D), respectively.
Oh and the ListViewControl's AllowEdit attribute should be true in your interface XML
This post was edited on 01-31-2010 at 05:10 PM by SmokingCookie.
|
|
01-31-2010 05:04 PM |
|
|
MeEtc
Patchou's look-alike
In the Shadow Gallery once again
Posts: 2200 Reputation: 60
38 / /
Joined: Nov 2004
Status: Away
|
RE: Interface Writer | [release] 2.5 | 30/01/2010
I didn't have a previous version before now. I'll try the update when I get home.
I cannot hear you. There is a banana in my ear.
|
|
02-01-2010 12:01 AM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
quote: Originally posted by SmokingCookie
Well, I think this is the easy part:
JScript code: Interop.Call("User32.dll", "SendMessageW", PlusWnd.GetControlHandle("MyListView"), LVM_EDITLABELW, ItemToRename, 0);
I've put this in the "Rename" option's event:
js code: Interop.Call("User32.dll", "SendMessageW", WndWriterManageWindows.GetControlHandle("LstWindows"), 18, Writer.WndSel[0], 0);
But then what? Nothing happens...
quote: Originally posted by SmokingCookie
You should then listen for WM_NOTIFY ( = 0x004E) notifications. That's where the tricky part comes in: Along with WM_NOTIFY, an NMHDR structure is passed, which can be moved to a known location by RtlMoveMemory (see MSDN). Reading the data at position 8, you should find LVN_ENDLABELEDITW ( = LVN_FIRST - 76; LVN_FIRST = 0 - 100). You must retrieve the edit control's handle through LVM_GETEDITCONTROL ( = LVM_FIRST + 24; LVM_FIRST = 0x1000). Once you know the handle to the edit control, you can retrieve its text length and text itself with WM_GETTEXTLENGTH ( = 0x000E) and WM_GETTEXT ( = 0x000D), respectively.
Not sure how to do this... I've registered the event:
js code: WndWriterManageWindows.RegisterMessageNotification(78);
But there are messages appearing for all sorts!
quote: Originally posted by SmokingCookie
Oh and the ListViewControl's AllowEdit attribute should be true in your interface XML
Done that.
|
|
02-02-2010 06:34 PM |
|
|
SmokingCookie
Senior Member
Posts: 815 Reputation: 15
30 / /
Joined: Jul 2007
|
RE: Interface Writer | [release] 2.5 | 30/01/2010
Kinda forgot that you'd replied, I'm sorry!
When you receive the WM_NOTIFY message, the lParam is important: it contains an NMHDR structure. You can access this structure using RtlMoveMemory() in Kernel32.dll as follows:
JScript code: var NMHDR = Interop.Allocate(52);
Interop.Call("Kernel32.dll","RtlMoveMemory",NMHDR.DataPtr,lParam,52);
Reading byte 8 from the NMHDR structure, you should be able to filter the LVN_ENDLABELEDITW value. You should then perform the actions I described above.
This post was edited on 02-10-2010 at 07:32 PM by SmokingCookie.
|
|
02-10-2010 07:32 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
Ok, I've managed to make the rename box appear (since it wasn't working, I checked the Schema Documentation - it was "AllowEditText"). I've currently got this:
js code: function OnWndWriterManageWindowsEvent_MessageNotification(objWnd, Message, wParam, lParam)
{
if (Message === 78) // WM_NOTIFY
{
var NMHDR = Interop.Allocate(52);
Interop.Call("kernel32", "RtlMoveMemory", NMHDR.DataPtr, lParam, 52);
if (NMHDR.ReadString(8) === -176) // LVN_ENDLABELEDITW
{
Debug.Trace("Renamed!");
}
}
}
But I'm assuming that the NMHDR structure doesn't actually return the actual number at position 8... how should I do it?
|
|
02-11-2010 08:03 PM |
|
|
SmokingCookie
Senior Member
Posts: 815 Reputation: 15
30 / /
Joined: Jul 2007
|
RE: Interface Writer | [release] 2.5 | 30/01/2010
You shouldn't use NMHDR.readSTRING(8), but NMHDR.readDWORD(8)
Besides, you can always check the value read from a position in a DataBloc object:
JScript code: var Byte1 = DataBloc.readDWORD(0);
var Bute2 = DataBloc.readSTRING(0);
Debug.Trace(Byte1);
Debug.Trace(Byte2);
Then check if the output is what you expect.
This post was edited on 02-12-2010 at 08:38 AM by SmokingCookie.
|
|
02-12-2010 08:34 AM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: Interface Writer | [release] 2.5 | 30/01/2010
Ok, that bit works. I've now got:
js code: function OnWndWriterManageWindowsEvent_MessageNotification(objWnd, Message, wParam, lParam)
{
if (Message === 78)
{
var TmpNMHDR = Interop.Allocate(52);
Interop.Call("kernel32", "RtlMoveMemory", TmpNMHDR.DataPtr, lParam, 52);
if (TmpNMHDR.ReadDWORD(8) === -176)
{
var TmpEditHandle = WndWriterManageWindows.SendControlMessage("LstWindows", 4120, 0, 0);
var TmpEditLength = WndWriterManageWindows.SendControlMessage("LstWindows", 13, 0, 0);
var TmpEditText = Interop.Allocate(TmpEditLength);
var TmpEditCopied = WndWriterManageWindows.SendControlMessage("LstWindows", 14, TmpEditLength, TmpEditText.DataPtr);
AlertDialog("Message: " + Message + "\nNMHDR: " + TmpNMHDR.ReadDWORD(8) + "\n\nwParam: " + wParam + "\nlParam: " + lParam + "\n\nText: " + TmpEditText + "\nLength: " + TmpEditLength + "\nCopied: " + TmpEditCopied + "\nHandle: " + TmpEditHandle);
}
}
}
But the alert gives me this:
code: Message: 78
NMHDR: -176
wParam: 8133
lParam: 457340
Text:
Length: 0
Copied: 0
Handle: 984598
The text value returns "" (an empty string).
|
|
02-12-2010 07:41 PM |
|
|
Pages: (14):
« First
«
3
4
5
6
[ 7 ]
8
9
10
11
»
Last »
|
|
|