Jump to content
c0smyn

[Borland Delphi] Yahoo! Tricks

Recommended Posts

Posted

Minimize/Maximize/Restore/Hide/Show Yahoo! Messenger:

---


var
YahooHandle: HWND;
begin
YahooHandle := FindWindow('YahooBuddyMain',nil); [color=green]// or FindWindow('YahooBuddyMain','Yahoo! Messenger'); [/color]

if YahooHandle <> 0 then
begin
ShowWindow(YahooHandle,sw_minimize); [color=green]// Minimize[/color]

ShowWindow(YahooHandle,sw_maximize); [color=green]// Maximize[/color]

ShowWindow(YahooHandle,sw_restore); [color=green]// Restore[/color]

ShowWindow(YahooHandle,sw_hide); [color=green]// Hide[/color]

ShowWindow(YahooHandle,sw_show); [color=green]// Show[/color]
end;
end;

---

Change Yahoo! Messenger caption:

---


var
YahooHandle: HWND;
begin
YahooHandle := FindWindow('YahooBuddyMain',nil);

if YahooHandle <> 0 then
SetWindowText(YahooHandle,Pchar('New Caption'));
end;

---

Start Yahoo! Messenger:

---

Adaugati sus la Uses, ShellApi

Puneti aceasta functie sub {$R *.dfm}


function GetYahooPath: string;
begin
if fileexists('C:\Program Files\Yahoo!\Messenger\YahooMessenger.exe') then
result := 'C:\Program Files\Yahoo!\Messenger\YahooMessenger.exe'
else
if fileexists('D:\Program Files\Yahoo!\Messenger\YahooMessenger.exe') then
result := 'D:\Program Files\Yahoo!\Messenger\YahooMessenger.exe'
else
if fileexists('E:\Program Files\Yahoo!\Messenger\YahooMessenger.exe') then
result := 'E:\Program Files\Yahoo!\Messenger\YahooMessenger.exe'
else
ShowMessage('Nu se poate gasi Yahoo!Messenger.exe');
end;

Acum pentru a porni Yahoo! Messenger folositi urmatorul cod:


ShellExecute( 0, 'open', PChar(GetYahooPath),nil, nil, SW_SHOW );

---

Close Yahoo! Messenger:

---


begin
winexec('taskkill /f /im YahooMessenger.exe',sw_hide);
winexec('taskkill /f /im YAHOOM~1.exe',sw_hide);
end;

---

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...