Shoutbox

[Request] Titlebar of App -> PSM - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Request] Titlebar of App -> PSM (/showthread.php?tid=87620)

[Request] Titlebar of App -> PSM by prashker on 12-06-2008 at 06:19 PM

[Image: attachment.php?pid=939845]

Request: Specify an application. If it's open, use it's Titlebar and change your PSM to it.

PS: if you're nice you could include a /command that'll paste it in a convo (instead of displaying in PSM (a))


RE: [Request] Titlebar of App -> PSM by matty on 12-06-2008 at 08:25 PM

But what if it is a porn website you are viewing. You want the entire world to know about your midget porn fetish?


RE: [Request] Titlebar of App -> PSM by prashker on 12-06-2008 at 10:44 PM

quote:
Originally posted by matty
But what if it is a porn website you are viewing. You want the entire world to know about your midget porn fetish?

FireFox was an example :p...if I didn't want the world to know about my midget porn I wouldn't be requesting this :p
RE: [Request] Titlebar of App -> PSM by TheSteve on 12-07-2008 at 01:07 AM

From where I see it, there are three ways to implement something like this:

1. Set a timer (user customizable perhaps).  When the timer fires, call FindWindow to find the first browser for your desired browser.  Call GetWindowText/GetWindowTextLength to get the text of the window.  Set it to your PSM.
This method in theory, would be compatible with most browsers.
Browser Class List:
FireFox: MozillaUIWindowClass - The title should have "Mozilla FireFox" at the end. (Thunderbird uses this class too)
IE: IEFrame
Google Chrome: Chrome_XPFrame

2. For IE only, you could use the Registered message "WM_HTML_GETOBJECT" to get the browser control interfaces. I believe you can subscribe to events for this.

3. Write a plug-in for the desired browser. Then create an invisible window that will listen for messages from the browser plug-in  (Similar to how the "What I'm listening to" feature works)


RE: [Request] Titlebar of App -> PSM by -dt- on 12-07-2008 at 03:48 AM

quote:
Originally posted by matty
But what if it is a porn website you are viewing. You want the entire world to know about your midget porn fetish?
we already know about his anime fetish ;p
RE: [Request] Titlebar of App -> PSM by prashker on 12-07-2008 at 03:56 AM

quote:
Originally posted by TheSteve
From where I see it, there are three ways to implement something like this:
I mean for any application, FireFox was just an example. If I wanted it to show msnmsgr.exe's titlebar then it'd make my PSM "Windows Live Messenger Beta" :P!
RE: RE: [Request] Titlebar of App -> PSM by TheSteve on 12-07-2008 at 04:06 AM

quote:
Originally posted by SonicSam
I mean for any application, FireFox was just an example.
In that case, it's a just a matter of getting the window handle to your desired window by calling FindWindow, then call GetWindowText to get the actual text.
RE: [Request] Titlebar of App -> PSM by matty on 12-14-2008 at 11:22 PM

code:
function OnEvent_SigninReady(sEmail) {
    MsgPlus.AddTimer('x', 100);
}

function OnEvent_Timer(sTimerId) {
    var wintitlelength = Interop.Call('user32', 'GetWindowTextLengthW', Interop.Call('user32', 'GetForegroundWindow'));
   
    var wintitle = Interop.Allocate(wintitlelength);
    Interop.Call('user32', 'GetWindowText', Interop.Call('user32', 'GetForegroundWindow'), wintitle, wintitlelength);
   
    if (Messenger.MyPersonalMessage !== wintitlelength.ReadString(0, false)) Messenger.MyPersonalMessage = wintitlelength.ReadString(0, false);
   
    MsgPlus.AddTimer('x', 100);
}

Something like that.
RE: [Request] Titlebar of App -> PSM by DeanoLaad on 12-15-2008 at 01:39 AM

code:
function test()
{
    //were iGoogle is Chrome(bowser)'s homepage.
    var wintitlelength = Interop.Call('user32', 'GetWindowTextLengthW', Interop.Call('user32', 'FindWindowW', 'iGoogle -', ''));
    var wintitle = Interop.Allocate(wintitlelength);
    Interop.Call('user32', 'GetWindowTextW', Interop.Call('user32', 'FindWindowW', 'iGoogle -', ''), wintitle, wintitlelength);
    output = wintitlelength.ReadString(0, false);
    return output;
}
Debug.Trace(test());

Were am i going wrong?..
RE: [Request] Titlebar of App -> PSM by matty on 12-15-2008 at 01:54 AM

FindWindowW's first parameter is the Window Class the second parameter is apart of the title so change 'iGoogle -' to be the second param.


RE: [Request] Titlebar of App -> PSM by Spunky on 12-22-2008 at 03:29 AM

This script displays all window titles in your PSM. It's based on Matty's code above, but edited... (it will also hide contact's emails when talking on WLM ;))


RE: [Request] Titlebar of App -> PSM by Felu on 12-22-2008 at 03:44 AM

I don't think Sam wanted it to show the active window's title in your PSM...


RE: [Request] Titlebar of App -> PSM by prashker on 12-22-2008 at 05:08 AM

That is cool, I'll probably just use that, but what I wanted is I just specify the .exe of the program....and if it's open then set your PSM to it :p...however yours does the job just as well....maybe an ability to "exclude" programs, dunno...Whichever is easier :p

Thanks :)


RE: [Request] Titlebar of App -> PSM by Pinecone on 12-22-2008 at 07:24 AM

Is this what you wanted? It shows the name of the executable file that created the window that's currently in the foregound, however disallows showing all processes listed in the array named "Exclude".

Edit: Sorry, i didn't read the first post. This isn't what you want, but still kinda cool :p


RE: [Request] Titlebar of App -> PSM by prashker on 12-22-2008 at 04:33 PM

Rofl, thanks anyways :p


RE: [Request] Titlebar of App -> PSM by matty on 12-22-2008 at 05:41 PM

What you need to do is have a config window that shows all the running processes and you can select which you want to show the title of.

This can be done by using EnumProcesses and GetModuleFileNameExW

js code:
var aProcesses = Interop.Allocate(1024);
var bytesReturned = Interop.Allocate(4);
var szPidName = Interop.Allocate(512);
var hProcess;

Interop.Call('psapi', 'EnumProcesses', aProcesses, aProcesses.Size, bytesReturned);

for (var i=0; i<=bytesReturned.ReadDWORD(0)/4; i++) {
    hProcess = Interop.Call('kernel32', 'OpenProcess', 0x400 /* PROCESS_QUERY_INFORMATION */ | 0x10 /* PROCESS_VM_READ */, 0, aProcess.ReadDWORD(i*4));
    Interop.Call('psapi', 'GetModuleFileNameExW', hProcess, szPidName, 200, 500);
    Debug.Trace(aProcess.ReadDWORD(i*4)+' : '+szPidName.ReadString(0));
}

aProcesses.Size = 0;
bytesReturned.Size = 0;
szPidName.Size = 0;

Untested code as I am at work.
RE: [Request] Titlebar of App -> PSM by MicroWay on 12-22-2008 at 10:34 PM

Hey guys, have you seen AppMon+ (on Database)????
;)

MAYBE isn't what it have been requested exactly, but it can help you out...