View previous topic :: View next topic |
Author |
Message |
Vincent. Grandmaster Cheater
Reputation: 16
Joined: 09 Nov 2007 Posts: 774
|
Posted: Tue Jun 15, 2010 3:24 pm Post subject: Windows placement on startup. |
|
|
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 |
|
 |
Haxory' Grandmaster Cheater Supreme
Reputation: 92
Joined: 30 Jul 2007 Posts: 1900
|
|
Back to top |
|
 |
PUSHEAX_PUSHEAX Grandmaster Cheater
Reputation: 72
Joined: 13 Apr 2009 Posts: 969
|
Posted: Wed Jun 16, 2010 8:36 am Post subject: |
|
|
If you maximize it, I think it stays maximized? At least that's what happens normally.
|
|
Back to top |
|
 |
Vincent. Grandmaster Cheater
Reputation: 16
Joined: 09 Nov 2007 Posts: 774
|
Posted: Wed Jun 16, 2010 8:37 am Post subject: |
|
|
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 |
|
 |
Uzeil Moderator
Reputation: 6
Joined: 21 Oct 2006 Posts: 2411
|
Posted: Wed Jun 16, 2010 9:07 am Post subject: |
|
|
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?
_________________
|
|
Back to top |
|
 |
bfsdbsdfbdsfb Grandmaster Cheater
Reputation: 54
Joined: 06 Sep 2007 Posts: 702 Location: Oh noez.
|
Posted: Wed Jun 16, 2010 9:44 am Post subject: |
|
|
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 |
|
 |
Vincent. Grandmaster Cheater
Reputation: 16
Joined: 09 Nov 2007 Posts: 774
|
Posted: Wed Jun 16, 2010 9:48 am Post subject: |
|
|
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 |
|
 |
Uzeil Moderator
Reputation: 6
Joined: 21 Oct 2006 Posts: 2411
|
Posted: Wed Jun 16, 2010 10:29 am Post subject: |
|
|
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).
_________________
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Wed Jun 16, 2010 10:33 am Post subject: |
|
|
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 |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Wed Jun 16, 2010 12:44 pm Post subject: |
|
|
Better idea: have the macro open the program, then press alt>down>enter.
|
|
Back to top |
|
 |
Vincent. Grandmaster Cheater
Reputation: 16
Joined: 09 Nov 2007 Posts: 774
|
Posted: Wed Jun 16, 2010 3:39 pm Post subject: |
|
|
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 .
|
|
Back to top |
|
 |
|