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 


Windows placement on startup.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Computer Talk
View previous topic :: View next topic  
Author Message
Vincent.
Grandmaster Cheater
Reputation: 16

Joined: 09 Nov 2007
Posts: 774

PostPosted: Tue Jun 15, 2010 3:24 pm    Post subject: Windows placement on startup. Reply with quote

Hello,
I am trying to make a macro for a program called System Locker, it's part of Net Tools. My problem is that the position of the program is different every time I launch it. Is it possible to automatically position it at the same place on my screen?
Back to top
View user's profile Send private message
Haxory'
Grandmaster Cheater Supreme
Reputation: 92

Joined: 30 Jul 2007
Posts: 1903

PostPosted: Wed Jun 16, 2010 8:35 am    Post subject: Reply with quote

Look here: http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_23556188.html
It's called a RELATIVE position that you should use.

_________________
you and me baby ain't nothing but mammals so lets do it like they do on the discovery channel
Back to top
View user's profile Send private message
PUSHEAX_PUSHEAX
Grandmaster Cheater
Reputation: 72

Joined: 13 Apr 2009
Posts: 969

PostPosted: Wed Jun 16, 2010 8:36 am    Post subject: Reply with quote

If you maximize it, I think it stays maximized? At least that's what happens normally.
Back to top
View user's profile Send private message
Vincent.
Grandmaster Cheater
Reputation: 16

Joined: 09 Nov 2007
Posts: 774

PostPosted: Wed Jun 16, 2010 8:37 am    Post subject: Reply with quote

Haxory' wrote:
Look here: http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_23556188.html
It's called a RELATIVE position that you should use.

I Have read it all, but I still have no idea how to solve my problem.

Edit, xenor, the program can't be maximized.
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Wed Jun 16, 2010 9:07 am    Post subject: Reply with quote

I can't say I understand the problem. Why does it matter in this case that it keeps popping up in different positions? And are you developing the binary or are you trying to make a macro to externally change it's window position at start-up?
_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
bfsdbsdfbdsfb
Grandmaster Cheater
Reputation: 54

Joined: 06 Sep 2007
Posts: 704
Location: Oh noez.

PostPosted: Wed Jun 16, 2010 9:44 am    Post subject: Reply with quote

Uzeil wrote:
I can't say I understand the problem. Why does it matter in this case that it keeps popping up in different positions? And are you developing the binary or are you trying to make a macro to externally change it's window position at start-up?

He wants to make it so that he can just press one button on his mouse/keyboard and then it does w/e he wants with the program. The problem is that every time he starts up this program the position of the program on his screen changes thus he can't make an accurate mouse-movement macro.

_________________
bsdfbdsfb
Back to top
View user's profile Send private message
Vincent.
Grandmaster Cheater
Reputation: 16

Joined: 09 Nov 2007
Posts: 774

PostPosted: Wed Jun 16, 2010 9:48 am    Post subject: Reply with quote

Uzeil wrote:
I can't say I understand the problem. Why does it matter in this case that it keeps popping up in different positions? And are you developing the binary or are you trying to make a macro to externally change it's window position at start-up?


I'll try to explain it.
When I leave my pc, i use a program that locks my screen (so my brother can't access my pc). This is a screenshot of the program:


As you can see I must first click Options in order to select the "Lock Screen" mode. Lets assume I want to mace a macro which automatically locks my screen, and I want it to happen when i press the '+' key.
In the macro creator I put in an 'open file' first, so it will open the System locker. After that I want to automatically place my mouse above the 'Options' button in the system locker program. At this point I'm stuck, because every time I start up the System Locker, it gets placed on a different position on my screen. For example:

first start up: The System locker screen gets placed in the upper left corner of my screen.

Second start up: The system locker screen gets placed in the lower right corner of my screen.


Is my problem more understandable now?


Edit: Yeah, the above poster understands my problem.
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Wed Jun 16, 2010 10:29 am    Post subject: Reply with quote

Well I guess it depends on what you're using to make the mouse macro, but you can set window positions using SetWindowPos()

http://msdn.microsoft.com/en-us/library/ms633545(VS.85).aspx

That or you can use GetWindowRect() to get it's window rect and use the top left corner to determine where that menu is going to be. If you're using a mouse macro program that doesn't let you do anything other than move/click the mouse you're screwed(though this wouldn't explain how you're opening the program from your macro program).

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Jun 16, 2010 10:33 am    Post subject: Reply with quote

If you create it with CreateProcess() instead of something like ShellExecute() you can actually specify the start coordinates in STARTUPINFO after setting the STARTF_USEPOSITION flag.
Back to top
View user's profile Send private message
Cryoma
Member of the Year
Reputation: 198

Joined: 14 Jan 2009
Posts: 1821

PostPosted: Wed Jun 16, 2010 12:44 pm    Post subject: Reply with quote

Better idea: have the macro open the program, then press alt>down>enter.
Back to top
View user's profile Send private message
Vincent.
Grandmaster Cheater
Reputation: 16

Joined: 09 Nov 2007
Posts: 774

PostPosted: Wed Jun 16, 2010 3:39 pm    Post subject: Reply with quote

Thanks, I used stone's method because the other ones you guys advised me are a bit to complex for me, but thanks anyway!

Problem solved Wink.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Computer Talk 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites