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 


Force Active Window

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
John
Grandmaster Cheater
Reputation: 1

Joined: 07 Aug 2006
Posts: 524

PostPosted: Mon May 04, 2009 1:19 pm    Post subject: Force Active Window Reply with quote

Anyone know of a program that forces a window to be active like some games? So, when you click out the game it stays active and always on top.

Thanks.

_________________
Back to top
View user's profile Send private message
Drkgodz
Flash moderator
Reputation: 2

Joined: 17 Jul 2006
Posts: 2997
Location: Houston

PostPosted: Mon May 04, 2009 1:58 pm    Post subject: Reply with quote

Someone in the General Programming section could probably make a program for you. It's pretty simple I think.
_________________
Back to top
View user's profile Send private message
Jorg hi
I post too much
Reputation: 7

Joined: 24 Dec 2007
Posts: 2276
Location: Minnesota

PostPosted: Mon May 04, 2009 2:21 pm    Post subject: Reply with quote

Its really easy I'll make one later. http://www.freevbcode.com/ShowCode.asp?ID=526
_________________
CEF will always stay alive.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon May 04, 2009 3:23 pm    Post subject: Reply with quote

Code:
SetWindowPos(FindWindow(_T("GameClassName"), _T("OrGameWindowName")), (HWND)HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);


That's all you need.

Edit:

You could also just add it to its ExStyle:

Code:

HWND hWnd;
DWORD dwExStyle;

hWnd = FindWindow(_T("ClassName"), _T("OrWindowName"));
if (hWnd != NULL)
{
    dwExStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE);
    dwExStyle |= WS_EX_TOPMOST;
    SetWindowLongPtr(hWnd, GWL_EXSTYLE, dwExStyle);
}


Edit 2:

You might also be able to use these functions:
SetActiveWindow
SetFocus
SetForegroundWindow

_________________
Back to top
View user's profile Send private message
John
Grandmaster Cheater
Reputation: 1

Joined: 07 Aug 2006
Posts: 524

PostPosted: Mon May 04, 2009 4:56 pm    Post subject: Reply with quote

Thanks, too bad my VB teacher at school is an angry old lady.
_________________
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