Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Delphi]Minimize Another application *SOLVED*

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sat Sep 29, 2007 10:17 am    Post subject: [Delphi]Minimize Another application *SOLVED* Reply with quote

Hey, i've tryed myself using:

Code:

var
h: hWnd;
begin
h:= FindWindowA(nil,'Window Caption'); //doesn't matter wich
if h<>0 then
SendMessageA(h,SC_MINIMIZE,0,0);


To a certain game, but it wont minimize, i've tryed (to be sure) to see if it returns value to make it ShowMessage('Hi'); and it did, but when i try Send/PostMessageA on it, it wont work, any idea ?

thanks.


Last edited by DeletedUser14087 on Sat Sep 29, 2007 11:22 am; edited 1 time in total
Back to top
View user's profile Send private message
Cx
Master Cheater
Reputation: 0

Joined: 27 Jul 2007
Posts: 367

PostPosted: Sat Sep 29, 2007 10:52 am    Post subject: Reply with quote

Though you say "doesn't matter wich", it does matter.
Is it hooked?

_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Sat Sep 29, 2007 11:06 am    Post subject: Reply with quote

Code:
procedure TForm1.Button1Click(Sender: TObject);
VAR LOLHANDLE : THANDLE;
begin
 LOLHANDLE := FINDWINDOW(NIL,'Untitled - Notepad');
 if LOLHANDLE <> 0 then
  BEGIN
    POSTMESSAGE(LOLHANDLE, WM_SYSCOMMAND, SC_MINIMIZE, 0);
    SHOWMESSAGE('LOL MINIMIZED.');
  END;
end;


LOLCAPS.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sat Sep 29, 2007 11:07 am    Post subject: Reply with quote

i tryed this:

Code:

function MinimizeApp(const sCapt: PChar) : boolean;
  var AppHandle:THandle;
begin
  AppHandle:=FindWindow(Nil, sCapt) ;
  Result:=PostMessage(AppHandle, SC_MINIMIZE, 0, 0) ;
end;

procedure TMainForm.Button1Click(Sender: TObject);
Begin
MinimizeApp(pchar(Edit1.Text));
end;
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Sat Sep 29, 2007 11:11 am    Post subject: Reply with quote

Wouldn't work, incorrect parameters for PostMessage!

Code:
POSTMESSAGE(APPHANDLE, WM_SYSCOMMAND, SC_MINIMIZE, 0);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites