quote:
Originally posted by -!Felu!-
Errm... how about editing Email Tooltip script by -dt-?
quote:
Originally posted by saralk
I have edited dt's script
no offense to -dt- at all, but why using such a complicated over the top bloated script while all you need todo is calling 1 simple API....
see one of my posts about manipulating the tray icon.
this is all you need:
code:
function ChangeTooltip(newtext) {
// Some needed variables
var NIM_MODIFY = 0x1;
var NIF_TIP = 0x4;
// Get handle to hidden window which is responsible for the messenger tray icon (polygamy safe!)
var tIDCurrent = Interop.Call('Kernel32', 'GetCurrentThreadId');
var hWnd = 0;
while (hWnd = Interop.Call('User32', 'FindWindowExW', 0, hWnd, 'MSNHiddenWindowClass', 0))
if (Interop.Call('User32', 'GetWindowThreadProcessId', hWnd, 0) === tIDCurrent) break;
if (hWnd !== 0) {
// Create the datablock structure (v2)
var NOTIFYICONDATA = Interop.Allocate(488);
// Fill in some needed parameters
with (NOTIFYICONDATA) {
WriteDWORD(0, NOTIFYICONDATA.Size); //DWORD cbSize
WriteDWORD(4, hWnd); //HWND hWnd
WriteDWORD(8, 40046); //UINT uID
WriteDWORD(12, NIF_TIP); //UINT uFlags
WriteString(24, newtext.substring(0, 127), false); //WCHAR szTip[128]
}
// Call the API
Interop.Call('shell32.dll', 'Shell_NotifyIconA', NIM_MODIFY, NOTIFYICONDATA);
}
}