T
Terry Pinnell
Is it possible to edit or somehow hack an XP shortcut so that it opens the
program at a specified size and position please?
program at a specified size and position please?
See Autohotkey's Winmove function.Is it possible to edit or somehow hack an XP shortcut so that it opens the
program at a specified size and position please?
Terry Pinnell said:Is it possible to edit or somehow hack an XP shortcut so that it opens the
program at a specified size and position please?
Anthony Buckland said:Tim Meddick said:As others have answered this topic and stated : you can specify to have
the program start "minimized", "maximized" or "normal" (restored).
However, there are many window-ed programs that retain the size of
window that they last had when that program exited!
For example open [Notepad.exe] and stretch the window to a noticeably
larger size.
Then close Notepad by clicking on the [X] in the top right-hand corner.
Open [Notepad.exe] again - you will notice that it opens in the
exact-same size as it was when it last exited!!
Google is your friend. What it told me in a fast search:
- Any program can store its window size and position, and restore them
from the stored values. Not too helpful if you are using a program but
can't modify its source and recompile it.
- There is a free open-source application called AutoHotkey which
claims to make it possible to launch and control programs (among
many other things) easily, including specifying the position and size
of their windows. Google it yourself to learn more. Caveat: I haven't
tried using it.Thus, you can set the size of future [Notepad.exe] windows...
*NB Although this works for *many* programs, it does not work for
*every* window-ed app.
==
Cheers, Tim Meddick, Peckham, London.
Terry Pinnell said:Is it possible to edit or somehow hack an XP shortcut so that it opens
the
program at a specified size and position please?
Tim Meddick said:So, what was wrong with my reply?...
I am aware it doesn't work will *all* applications, but with many, you can
re-size the window to an exact dimension...
When the program is exited, it will retain the window-size dimension data
in the registry, and will restore that window to it's last-opened size
again.
For applications that retain such window size data, you may locate that
data in the registry. For example, the [Notepad.exe] WindowsXP application
;
[HKEY_CURRENT_USER\Software\Microsoft\Notepad]
"iWindowPosX"=dword:000000db
"iWindowPosY"=dword:0000008f
If you want the [Notepad.exe] window to return each time to a specified
size, no matter how it was closed at the end of the Windows session, then
save the data above (i.e. export the key after sizing the window and
exiting the program ).
Then place a shortcut in the "Startup" folder with the following as a
command-line :
regedit /s c:\notepad.reg
...where [c:\notepad.reg] stands for the save (exported) Notepad settings
sub-key reg-file.
Anyway, I was trying to give you a solution that did not require another
third-party app! If you use a third-party app. every time you come across
a Windows configuration issue, you will soon have a private army of
third-party apps sucking up all your Window's resources!!
==
Cheers, Tim Meddick, Peckham, London.
Terry Pinnell said:Thanks for the replies. But I was asking for "...a specified size and
position". Not merely minimised, maximised or restored, which I do know
about!
After advice in alt.comp.freeware I eventually found and installed the
program AutoSizer. Basically, on using 'AutoSize Now! (Rescan)' from the
XP System Tray, all open apps that you've previously configured will
change (if necessary) to their specified positions and sizes.
So, while it won't directly do what I asked, which was to "...edit a
shortcut so that it opens the program at a specified size and
position" (unless, of course, it was previously closed at that size and
position), I can instead use AutoSize Rescan as an immediate next step to
get effectively the same result.
Terry Pinnell said:Tim Meddick said:So, what was wrong with my reply?...
I am aware it doesn't work will *all* applications, but with many, you
can
re-size the window to an exact dimension...
When the program is exited, it will retain the window-size dimension data
in the registry, and will restore that window to it's last-opened size
again.
For applications that retain such window size data, you may locate that
data in the registry. For example, the [Notepad.exe] WindowsXP
application
;
[HKEY_CURRENT_USER\Software\Microsoft\Notepad]
"iWindowPosX"=dword:000000db
"iWindowPosY"=dword:0000008f
If you want the [Notepad.exe] window to return each time to a specified
size, no matter how it was closed at the end of the Windows session, then
save the data above (i.e. export the key after sizing the window and
exiting the program ).
Then place a shortcut in the "Startup" folder with the following as a
command-line :
regedit /s c:\notepad.reg
...where [c:\notepad.reg] stands for the save (exported) Notepad settings
sub-key reg-file.
Anyway, I was trying to give you a solution that did not require another
third-party app! If you use a third-party app. every time you come
across
a Windows configuration issue, you will soon have a private army of
third-party apps sucking up all your Window's resources!!
==
Cheers, Tim Meddick, Peckham, London.
Terry Pinnell said:Thanks for the replies. But I was asking for "...a specified size and
position". Not merely minimised, maximised or restored, which I do know
about!
After advice in alt.comp.freeware I eventually found and installed the
program AutoSizer. Basically, on using 'AutoSize Now! (Rescan)' from
the
XP System Tray, all open apps that you've previously configured will
change (if necessary) to their specified positions and sizes.
So, while it won't directly do what I asked, which was to "...edit a
shortcut so that it opens the program at a specified size and
position" (unless, of course, it was previously closed at that size and
position), I can instead use AutoSize Rescan as an immediate next step
to
get effectively the same result.
Thanks for that follow-up, Tim. It does add to my knowledge and indeed
offers a new alternative approach using the registry that I'll try to
experiment with. But I currently achieve the same result in an arguably
simpler fashion using my macro program, which includes commands to move
and resize windows based on their exact or partial titles.
I appreciated your original reply too, and there was nothing 'wrong' with
it! However, as I thought I'd explained, it didn't address my specific
need. I wanted more than the (very familiar) capability of a window to
return to its last-closed size and position. As per my original post, I
want many of my windows to open from cold at a *fixed* specification. Not
the last-closed one.
Of course, if I could always rely on remembering to return an application
or folder to that required starting specification before closing it, that
would be another method. (Apart from those not infrequent occasions when
the app gets closed improperly, either crashing itself or the victim of
some other crash or freeze.) But I don't want to have to rely on that
discipline and extra effort.
For further background, take Google Earth as one of many examples. For
*most* of the time I want this at 0,0 and size 1920 x 1146. That gives me
a certain aspect ration in its main map window for image screenshots and
video captures for use in making DVDs. So I want it to open at that. But
quite frequently I might *change* this during a session, for a whole
bunch
of reasons. The most familiar one of course being to view the GE window
and one or more others simultaneously.
Best wishes,
Tim Meddick said:Alternative method for making Notepad always open at a given fixed position
(no matter where it was last closed)
Copy and paste the following into a batch-file :
------------------- copy between lines -------------------
@echo off
reg ADD HKCU\Software\Microsoft\Notepad /v iWindowPosDX /t REG_DWORD /d 630
/f
reg ADD HKCU\Software\Microsoft\Notepad /v iWindowPosDY /t REG_DWORD /d 447
/f
reg ADD HKCU\Software\Microsoft\Notepad /v iWindowPosX /t REG_DWORD /d 211
/f
reg ADD HKCU\Software\Microsoft\Notepad /v iWindowPosY /t REG_DWORD /d 135
/f
start /b notepad.exe
------------------- copy between lines -------------------
*NB The reg-commands in the above script should each be on one line but may
not appear so due to line-wrap. Please ensure that each command begins
with 'reg' and ends with '/f' apart from the last 'start' command.
Use the resulting batch-file to start notepad - create a shortcut to the
batch-file on your desktop and use that to start notepad.
(Can be potentially adapted for any application that stores it's window's
positional data in the registry)
==
Cheers, Tim Meddick, Peckham, London.
Terry Pinnell said:Tim Meddick said:So, what was wrong with my reply?...
I am aware it doesn't work will *all* applications, but with many, you
can
re-size the window to an exact dimension...
When the program is exited, it will retain the window-size dimension data
in the registry, and will restore that window to it's last-opened size
again.
For applications that retain such window size data, you may locate that
data in the registry. For example, the [Notepad.exe] WindowsXP
application
;
[HKEY_CURRENT_USER\Software\Microsoft\Notepad]
"iWindowPosX"=dword:000000db
"iWindowPosY"=dword:0000008f
If you want the [Notepad.exe] window to return each time to a specified
size, no matter how it was closed at the end of the Windows session, then
save the data above (i.e. export the key after sizing the window and
exiting the program ).
Then place a shortcut in the "Startup" folder with the following as a
command-line :
regedit /s c:\notepad.reg
...where [c:\notepad.reg] stands for the save (exported) Notepad settings
sub-key reg-file.
Anyway, I was trying to give you a solution that did not require another
third-party app! If you use a third-party app. every time you come
across
a Windows configuration issue, you will soon have a private army of
third-party apps sucking up all your Window's resources!!
==
Cheers, Tim Meddick, Peckham, London.
Thanks for the replies. But I was asking for "...a specified size and
position". Not merely minimised, maximised or restored, which I do know
about!
After advice in alt.comp.freeware I eventually found and installed the
program AutoSizer. Basically, on using 'AutoSize Now! (Rescan)' from
the
XP System Tray, all open apps that you've previously configured will
change (if necessary) to their specified positions and sizes.
So, while it won't directly do what I asked, which was to "...edit a
shortcut so that it opens the program at a specified size and
position" (unless, of course, it was previously closed at that size and
position), I can instead use AutoSize Rescan as an immediate next step
to
get effectively the same result.
Thanks for that follow-up, Tim. It does add to my knowledge and indeed
offers a new alternative approach using the registry that I'll try to
experiment with. But I currently achieve the same result in an arguably
simpler fashion using my macro program, which includes commands to move
and resize windows based on their exact or partial titles.
I appreciated your original reply too, and there was nothing 'wrong' with
it! However, as I thought I'd explained, it didn't address my specific
need. I wanted more than the (very familiar) capability of a window to
return to its last-closed size and position. As per my original post, I
want many of my windows to open from cold at a *fixed* specification. Not
the last-closed one.
Of course, if I could always rely on remembering to return an application
or folder to that required starting specification before closing it, that
would be another method. (Apart from those not infrequent occasions when
the app gets closed improperly, either crashing itself or the victim of
some other crash or freeze.) But I don't want to have to rely on that
discipline and extra effort.
For further background, take Google Earth as one of many examples. For
*most* of the time I want this at 0,0 and size 1920 x 1146. That gives me
a certain aspect ration in its main map window for image screenshots and
video captures for use in making DVDs. So I want it to open at that. But
quite frequently I might *change* this during a session, for a whole
bunch
of reasons. The most familiar one of course being to view the GE window
and one or more others simultaneously.
Best wishes,