Registriert seit: 1. Aug 2009
447 Beiträge
Delphi 2009 Professional
|
Re: ICQ 6.5 Away Nachricht setzen
13. Sep 2009, 17:30
lowF hat mir gestern den Code zu kommen lassen und möchte den euch nicht enthalten.
Also hier ist der Code:
(Getestet hab ichs noch nicht)
Delphi-Quellcode:
var wlist : TWindowList;
i : integer;
ICQ : hwnd;
ICQ2 : hwnd;
LongParam : integer;
lPoint : TPoint;
App : hwnd;
x : cardinal;
Document: IHTMLDocument3;
ele: IHTMLElement;
MSG : string;
begin
app := GetForegroundWindow;
wlist := TWindowList.Create;
wlist.ShowUnvisibleWindows := true;
wlist.EnumTopLevelWindows;
for i := 0 to wlist.Count-1 do
if pos('Winamp',wlist[i]) > 0 then
MSG := Copy(wlist[i],1,Pos('Winamp',wlist[i])-3);
for i := 0 to wlist.Count-1 do
if wlist[i] =('ICQ') then
ICQ := Wlist.Handles[i];
lPoint.X := 80;
lPoint.Y := 80;
LongParam := lPoint.X + lPoint.Y shl 16;
PostMessage(ICQ, WM_LBUTTONDOWN, MK_LButton,LongParam);
PostMessage(ICQ, WM_LBUTTONUP, MK_LButton, LongParam);
x := gettickcount;
repeat
Application.ProcessMessages;
until
GetTickCount - x > strtoint(Edit1.Text);
wlist.EnumTopLevelWindows;
for i := 0 to wlist.Count-1 do
if wlist[i] = 'Persönlicher Statusmanager' then
ICQ2 := wlist.Handles[i];
//Message festlegen
if length(song) > 0 then
MSG := '[b]Now playing: [/b][i]'+song+'[/i]'
else
MSG := '[b]Nothing playing right now![/b]';
wlist.EnumChildWindows(icq2);
lPoint.X := 285;
lPoint.Y := 200;
LongParam := lPoint.X + lPoint.Y shl 16;
//PostMessage(ICQ2,WM_SETFOCUS,0,0);
PostMessage(ICQ2, WM_LBUTTONDOWN, MK_LButton,LongParam);
PostMessage(ICQ2, WM_LBUTTONUP, MK_LButton, LongParam);
//Apply text
GetHTMLFromHWnd(wlist.Handles[1],Document);
try
(Document.documentElement.document AS IHTMLDocument2).body.innerHTML := MSG;
except
Edit1.Text := '200';
end;
wlist.Destroy;
lPoint.X := 285;
lPoint.Y := 350;
LongParam := lPoint.X + lPoint.Y shl 16;
//PostMessage(ICQ2,WM_SETFOCUS,0,0);
PostMessage(ICQ2, WM_LBUTTONDOWN, MK_LButton,LongParam);
PostMessage(ICQ2, WM_LBUTTONUP, MK_LButton, LongParam);
//PostMessage(App,WM_SETFOCUS,0,0);
|
|
Zitat
|