Discussion:
I need a script to launch Whatsap.exe in automatic execution and iconofied windows
(too old to reply)
Marco Saraceno
2017-02-11 12:49:21 UTC
Permalink
Can you help me? Please...
JJ
2017-02-11 13:24:19 UTC
Permalink
Post by Marco Saraceno
Can you help me? Please...
Define "automatic" in that context.
Marco Saraceno
2017-02-11 15:00:50 UTC
Permalink
i mean automatically launch Whatapp.exe at Startup (but iconofied)
R.Wieser
2017-02-11 15:08:59 UTC
Permalink
Marco,
Post by Marco Saraceno
i mean automatically launch Whatapp.exe at Startup (but iconofied)
What about creating a shortcut from it and dropping that into the Startup
folder ? No script(ing) needed for that.

Regards,
Rudy Wieser
Evertjan.
2017-02-11 15:13:54 UTC
Permalink
Post by R.Wieser
Post by Marco Saraceno
i mean automatically launch Whatapp.exe at Startup (but iconofied)
What about creating a shortcut from it and dropping that into the Startup
folder ? No script(ing) needed for that.
That would work, but what the hell is "iconofied".
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dave "Crash" Dummy
2017-02-11 15:29:56 UTC
Permalink
Post by Evertjan.
Post by R.Wieser
Post by Marco Saraceno
i mean automatically launch Whatapp.exe at Startup (but iconofied)
What about creating a shortcut from it and dropping that into the Startup
folder ? No script(ing) needed for that.
That would work, but what the hell is "iconofied".
(Note spelling)
https://www.google.com/search?q=iconified
--
Crash

“What is a weed? A plant whose virtues have not yet been discovered.”
~ Ralph Waldo Emerson ~
Evertjan.
2017-02-11 20:56:39 UTC
Permalink
Post by Dave "Crash" Dummy
Post by Evertjan.
Post by R.Wieser
Post by Marco Saraceno
i mean automatically launch Whatapp.exe at Startup (but iconofied)
What about creating a shortcut from it and dropping that into the Star
tup
Post by Evertjan.
Post by R.Wieser
folder ? No script(ing) needed for that.
That would work, but what the hell is "iconofied".
(Note spelling)
I rather did.
Post by Dave "Crash" Dummy
https://www.google.com/search?q=iconified
Even so, what would be an iconified launch?

Something Greek orthodox?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mayayana
2017-02-11 21:58:22 UTC
Permalink
"Evertjan." <***@inter.nl.net> wrote

| Even so, what would be an iconified launch?
|

The Taskbar indicator is sort of an icon. Maybe
the Italian translation of minimized is iconified.
Evertjan.
2017-02-12 10:27:29 UTC
Permalink
Post by Mayayana
| Even so, what would be an iconified launch?
|
The Taskbar indicator is sort of an icon. Maybe
the Italian translation of minimized is iconified.
Ah yes, that is quite possible.

Could we use "minified"?

Oh no, that is already reserved:

<https://en.wikipedia.org/wiki/Minification_(programming)>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mayayana
2017-02-11 15:14:02 UTC
Permalink
"Marco Saraceno" <***@gmail.com> wrote

|i mean automatically launch Whatapp.exe at Startup (but iconofied)

Iconofied? Do you mean you want the window minimized
to the Taskbar? Maybe that's iconified, though I've never
heard either term.

If you want it minimized it might work to use Rudy's idea:
Put a shortcut in the Startup folder. Then write a short script
something like the following, and also put that in the Startup
folder.

Dim ShAp
WScript.Sleep 5000
Set ShAp = CreateObject("Shell.Application")
ShAp.MinimizeAll
Set ShAp = Nothing

What that does is to minimize all open windows, after waiting
5 seconds. (Your program needs to be open before it can
be minimized.) You might need to play around with the
Sleep time.
R.Wieser
2017-02-11 16:03:12 UTC
Permalink
Mayayana,
Post by Mayayana
Put a shortcut in the Startup folder. Then write a short script
something like the following, and also put that in the Startup
folder.
Thats not needed. The shortcut itself has got an option to start the
program minimized (or maximized).

Regards,
Rudy Wieser
Post by Mayayana
|i mean automatically launch Whatapp.exe at Startup (but iconofied)
Iconofied? Do you mean you want the window minimized
to the Taskbar? Maybe that's iconified, though I've never
heard either term.
Put a shortcut in the Startup folder. Then write a short script
something like the following, and also put that in the Startup
folder.
Dim ShAp
WScript.Sleep 5000
Set ShAp = CreateObject("Shell.Application")
ShAp.MinimizeAll
Set ShAp = Nothing
What that does is to minimize all open windows, after waiting
5 seconds. (Your program needs to be open before it can
be minimized.) You might need to play around with the
Sleep time.
Mayayana
2017-02-11 19:07:30 UTC
Permalink
"R.Wieser" <***@not.available> wrote

| Thats not needed. The shortcut itself has got an option to start the
| program minimized (or maximized).
|

Maybe, but it doesn't always work. The directive is
not sent in the command line to the process. So if
a program does anything at startup to adjust its
window it may bypass that action.
R.Wieser
2017-02-11 20:11:59 UTC
Permalink
Mayayana,
Post by Mayayana
Maybe, but it doesn't always work.
So, first try if it does (and it mostly will), and if not try to find a
solution for it.
Post by Mayayana
The directive is not sent in the command line to the process.
I'm sorry, but why should it be provided by the program that way ? It
already received it (IIRC by way of its "startupinfo" record. Why provide
it twice ?
Post by Mayayana
So if a program does anything at startup to adjust its
window it may bypass that action.
If-and-when that happens than whomever created that program should get a
quick kick-to-the-behind, as he's interfering with the expected standard
behaviour.

Also, you definitily can resize and/or move a minimized programs window
*without* it un-minimizing.

Regards,
Rudy Wieser
Post by Mayayana
| Thats not needed. The shortcut itself has got an option to start the
| program minimized (or maximized).
Maybe, but it doesn't always work. The directive is
not sent in the command line to the process. So if
a program does anything at startup to adjust its
window it may bypass that action.
Mayayana
2017-02-11 22:45:52 UTC
Permalink
"R.Wieser" <***@not.available> wrote

| It
| already received it (IIRC by way of its "startupinfo" record.

The program receives it if it calls GetStartupInfo at
startup. It could then act according to the received info
if that's deemed relevant. If there's reason to think
someone might be loading your software from another
process and might want to control the window size/position
at startup, then you might want to check that.
Personally I've never made a call to GetStartupInfo. I
typically record the window position at close so that it
can open where the person probably likes it to be. With
single-window freeware I usually just show a fixed-size
window center-screen. I don't write software that people
want to be minimized at open, and I see no reason to
code a lot of window positioning functionality for software
that will never need it.... especially if no one is paying
me for that.

A quick check on my system shows that many programs
do call GetStartupInfo and act accordingly. Paint Shop Pro 5,
IrfanView and Filzip all started minimized. On the other hand,
VLC media player, Regmon and Sumatra PDF reader did not.
(The author of Regmon, Mark Russinovich, is a top Windows
programmer who lectures at Microsoft seminars.)

So you can rant about how they don't follow what you
think the rules should be, or you can deal with the real world
situation.

| > So if a program does anything at startup to adjust its
| > window it may bypass that action.
|
| If-and-when that happens than whomever created that program should get a
| quick kick-to-the-behind, as he's interfering with the expected standard
| behaviour.

I'd generally agree, but this is hardly standard behavior.
It would be very rare for people to even know they can set
window size in a shortcut. Even when they do, it would
be very rare for that functionality to be relevant. What's
much more relevant for most people is to open in the way
the program was closed.
R.Wieser
2017-02-12 10:22:16 UTC
Permalink
Mayayana,
Post by Mayayana
Personally I've never made a call to GetStartupInfo.
Neither do I, as, as I mentioned, you can change the size of the window
*without* changing its current minimized (or maximized) state.

Im other words: you (as the programmer) need to *explicitily override* the
windows current state (minimized for our story) to get the problem your
script attempts to fix.
Post by Mayayana
I don't write software that people want to be minimized at open,
Wrong attitude I'm afraid. Its not *your* choice what "the people want",
its *theirs*. A user starting your program by way of a shortcut and
selecting it to be minimized (or maximized) should be honored, not ignored.
Post by Mayayana
So you can rant about how they don't follow what you
think the rules should be, or you can deal with the real
world situation.
Your "real world situation" consists outof dealing with programmers who
willfully disregard the behaviour thats selected -- by the user! -- in
favour of whatever they, as the programmers, think should *always* happen.

I agree that its possible that some programmer will let his arrogance get
the better of him (or simply not thinking further than his nose is long) and
he includes code to do just that. but to go live your life as if that
behaviour is standard instead of the deviation isn't the way to go. You're
just needlessly making solutions much more complex than called for (which
was all I initially tried to convey).

I just checked VLC player, and it indeed disregards my selection to either
start minimized or maximized. Nice. That means that when you use it to
play a (background) song you *always* have to minimize that window. I don't
think the programmer ever thought of that situation. So much for the "I
know what the real world needs" attitude of that programmer I guess .... :-D
Post by Mayayana
I'd generally agree, but this is hardly standard behavior.
lol. Its the same for all versions of windows, and you need to *activily
override it* inside your program to get a different one. I don't know
about you, but for me that looks to be a good definition of "standard",
don't you think ?
Post by Mayayana
It would be very rare for people to even know they can set
window size in a shortcut.
You're trying to argue that beause, according to you, not many users know
that there is a possibility to change the startup style of a program it
isn't can't be regarded to be a default behaviour ? Really ? :-|
Post by Mayayana
What's much more relevant for most people is to open in the
way the program was closed.
My, my. You aren't trying to refer to some *default behaviour*, are you ?
I mean, you made it rather clear that you do not believe in such a thing
.... :-D

And no, you're wrong (as you probably well know). Minimize (or maximize)
a program and than close it. Its *default behaviour* is to open windowed
the next time you (double-)click the executable (and no, a programmers
choice to override that default behaviour doesn't make it less default).


And I do not know if you are aware of it, but you've been talking about two
things in the same thread, withouth even an indication of if you are aware
of it:

1) is there a default behaviour and should a programmer be allowed to
override it (and if you think so, why -- hint: see my VLC example.).

2) should a programmer (be allowed to) just ignore a users explicite
settings (As far as I'm concerned, no).

Regards,
Rudy Wieser
Post by Mayayana
| It
| already received it (IIRC by way of its "startupinfo" record.
The program receives it if it calls GetStartupInfo at
startup. It could then act according to the received info
if that's deemed relevant. If there's reason to think
someone might be loading your software from another
process and might want to control the window size/position
at startup, then you might want to check that.
Personally I've never made a call to GetStartupInfo. I
typically record the window position at close so that it
can open where the person probably likes it to be. With
single-window freeware I usually just show a fixed-size
window center-screen. I don't write software that people
want to be minimized at open, and I see no reason to
code a lot of window positioning functionality for software
that will never need it.... especially if no one is paying
me for that.
A quick check on my system shows that many programs
do call GetStartupInfo and act accordingly. Paint Shop Pro 5,
IrfanView and Filzip all started minimized. On the other hand,
VLC media player, Regmon and Sumatra PDF reader did not.
(The author of Regmon, Mark Russinovich, is a top Windows
programmer who lectures at Microsoft seminars.)
So you can rant about how they don't follow what you
think the rules should be, or you can deal with the real world
situation.
| > So if a program does anything at startup to adjust its
| > window it may bypass that action.
|
| If-and-when that happens than whomever created that program should get a
| quick kick-to-the-behind, as he's interfering with the expected standard
| behaviour.
I'd generally agree, but this is hardly standard behavior.
It would be very rare for people to even know they can set
window size in a shortcut. Even when they do, it would
be very rare for that functionality to be relevant. What's
much more relevant for most people is to open in the way
the program was closed.
Mayayana
2017-02-12 14:25:29 UTC
Permalink
"R.Wieser" <***@not.available> wrote

| > Personally I've never made a call to GetStartupInfo.
|
| Neither do I, as, as I mentioned, you can change the size of the window
| *without* changing its current minimized (or maximized) state.
|
| Im other words: you (as the programmer) need to *explicitily override* the
| windows current state (minimized for our story) to get the problem your
| script attempts to fix.
|

I think you misunderstood. I've never called
GetStartupInfo from my own software. GetStartupInfo
is not something a script might call and startup info is
not something that Windows somehow applies to
software when starting up. If I resize my software
program window at startup I'm not going against an
action by Windows. GetStartupInfo is an API function
that a software programmer can call at startup, and
must call if they want to know about your special
shortcut in order to respond to it. In other words,
minimizing doesn't happen passively. Windows sets
any window preference data and a program can access
that data if the programmer wants to write such a
function.
Like setting the window to where it was when it was
last closed, it's functionality that a programmer can
add to their software but that doesn't happen by
itself.
So if I want to respect the custom request from the
shortcut I have to write an extra function to check that.
Thus, the likelihood of someone using such a shortcut is
very much relevant.

| > I don't write software that people want to be minimized at open,
|
| Wrong attitude I'm afraid.

That's an easy thing for you to say, given that
you're not the one who has to write the code. I
doubt that anyone has ever tried to start any
of my software minimized. There'd be no point. In
fact, out of consideration I code to avoid that.
If the program was closed when minimized I make
the window open to where it last was before being
minimized, because I can safely assume that's what
people want. I don't respect rules merely for the
sake of it.

I'm happy to change my software for you, though.
If you're willing to pay for my time I'll write you a
special version of any of my freeware. :)

| I just checked VLC player, and it indeed disregards my selection to either
| start minimized or maximized. Nice. That means that when you use it to
| play a (background) song you *always* have to minimize that window. I
don't
| think the programmer ever thought of that situation. So much for the "I
| know what the real world needs" attitude of that programmer I guess ....
:-D

And VLC works well. And it's free. Maybe you'd also
like to pay for that programmer's time to make you
a "compliant" version of VLC. On the other hand, it's
also open source. So if you feel so strongly and want
to "look a gift horse in the mouth" then you really
owe it to yourself to fork the code and write
a new version of VLC that behaves "properly".
R.Wieser
2017-02-12 16:39:32 UTC
Permalink
Mayayana,
Post by Mayayana
I think you misunderstood.
Lets hope so.
Post by Mayayana
If I resize my software program window at startup I'm not
going against an action by Windows.
If you by now do not realize that you indeed are doing so than me keep
trying to explain to you that you are would be, at best, wasted time. So I
won't.

Besides, you are purposely evading the other point, in that such an action
goes against the users explicite settings (as set in a shortcut). That
alone makes me suspect your intentions.
Post by Mayayana
Like setting the window to where it was when it was
last closed, it's functionality that a programmer can
add to their software but that doesn't happen by
itself.
I can *again* mention that you can chane the size *without* altering the
state, but seeing that you have ignored that the last few times I mentioned
it I don't think that that will do any good either.
Post by Mayayana
That's an easy thing for you to say, given that
you're not the one who has to write the code.
1) Wrong argument. 2) What makes you believe that I don't ?

And in that regard, how the heck do you think that I know that you can
change a windows size without changing its state ? Do you think I sucked
that outof my thumb or something ?

I'm going to end our conversation here. Do whatever you please, its not
likely that I will ever encounter one of your prodects, right ? Goodbye.

Regards,
Rudy Wieser
Post by Mayayana
| > Personally I've never made a call to GetStartupInfo.
|
| Neither do I, as, as I mentioned, you can change the size of the window
| *without* changing its current minimized (or maximized) state.
|
| Im other words: you (as the programmer) need to *explicitily override* the
| windows current state (minimized for our story) to get the problem your
| script attempts to fix.
|
I think you misunderstood. I've never called
GetStartupInfo from my own software. GetStartupInfo
is not something a script might call and startup info is
not something that Windows somehow applies to
software when starting up. If I resize my software
program window at startup I'm not going against an
action by Windows. GetStartupInfo is an API function
that a software programmer can call at startup, and
must call if they want to know about your special
shortcut in order to respond to it. In other words,
minimizing doesn't happen passively. Windows sets
any window preference data and a program can access
that data if the programmer wants to write such a
function.
Like setting the window to where it was when it was
last closed, it's functionality that a programmer can
add to their software but that doesn't happen by
itself.
So if I want to respect the custom request from the
shortcut I have to write an extra function to check that.
Thus, the likelihood of someone using such a shortcut is
very much relevant.
| > I don't write software that people want to be minimized at open,
|
| Wrong attitude I'm afraid.
That's an easy thing for you to say, given that
you're not the one who has to write the code. I
doubt that anyone has ever tried to start any
of my software minimized. There'd be no point. In
fact, out of consideration I code to avoid that.
If the program was closed when minimized I make
the window open to where it last was before being
minimized, because I can safely assume that's what
people want. I don't respect rules merely for the
sake of it.
I'm happy to change my software for you, though.
If you're willing to pay for my time I'll write you a
special version of any of my freeware. :)
| I just checked VLC player, and it indeed disregards my selection to either
| start minimized or maximized. Nice. That means that when you use it to
| play a (background) song you *always* have to minimize that window. I
don't
| think the programmer ever thought of that situation. So much for the "I
| know what the real world needs" attitude of that programmer I guess ....
:-D
And VLC works well. And it's free. Maybe you'd also
like to pay for that programmer's time to make you
a "compliant" version of VLC. On the other hand, it's
also open source. So if you feel so strongly and want
to "look a gift horse in the mouth" then you really
owe it to yourself to fork the code and write
a new version of VLC that behaves "properly".
Mayayana
2017-02-12 17:39:12 UTC
Permalink
"R.Wieser" <***@not.available> wrote

| > That's an easy thing for you to say, given that
| > you're not the one who has to write the code.
|
| 1) Wrong argument. 2) What makes you believe that I don't ?
|

If you wrote VLC then I owe you an apology. :)
If you didn't then it's a bit bratty to complain
that a free media player doesn't provide the option
to start minimized.

| And in that regard, how the heck do you think that I know that you can
| change a windows size without changing its state ?

The only point I was trying to clarify was that it takes
work to follow a shortcut's minimize directive. Windows
doesn't do that. The starting program has to check for it.

Let me step through this. The program starts. I look up
the settings I saved for the last window position. Using
those, I size and position my window, if necessary. Then
I show my window.

If I want to do as you think I should, then before
sizing/positioning my window, and before looking up any
settings I saved, I would make an API call to GetStartupInfo.
If that specifies a min or max window then I'd skip the sizing
and positioning, and just set the window state. If the spec
was to show the window normal then I'd probably assume
the person has *not* specifically chosen that in the shortcut
settings, and would therefore ignore the startupinfo
and stick with my own saved settings from last time the
window was open.

Whether I went with my own settings, or GetStartupInfo,
any sizing/positioning would happen before showing the
window and *would only be relevant if the window state
will be "normal"*. If the window state will be minimized or
maximized I have no sizing/positioning to do until it's
changed to normal.

* All of that is up to me. At no point does Windows step
in to size the window, regardless of anything like
shortcut settings or commandline options. Windows
doesn't control that.*

(Interesting trivia there: I don't know if it's still true, but
it used to be that one could identify a minimized window in
the Shell.Application windows collection by checking for
the Left coordinate (each window being an IE object) to
see whether it was a very high number.)

|
| its not
| likely that I will ever encounter one of your prodects, right ?

Let's hope not. I don't have time for all that tech support. :)

Marco Saraceno
2017-02-11 18:22:01 UTC
Permalink
Thank you so much Mayayana. The script is absolutely perfect. It works fine. Sorry for the wrong term iconized (i've found it on the net), i'm italian. I like VBS. I want to learn it. :) :) :)
Mayayana
2017-02-11 19:09:48 UTC
Permalink
Post by Marco Saraceno
I like VBS. I want to learn it.
You might find some useful stuff here:

http://www.jsware.net/jsware/scripts.php5

VBS is officially "deprecated", but it's far more
widely supported than newer tools like .Net. It's
also well adapted to Windows and can be used
to do just about anything when used in combination
with COM objects. I use it almost daily.
Dave "Crash" Dummy
2017-02-11 20:51:59 UTC
Permalink
Post by Mayayana
Post by Marco Saraceno
I like VBS. I want to learn it.
http://www.jsware.net/jsware/scripts.php5
VBS is officially "deprecated", but it's far more widely supported
than newer tools like .Net. It's also well adapted to Windows and can
be used to do just about anything when used in combination with COM
objects. I use it almost daily.
My whole system is tailored with scripts! One of the main things that
keeps me from Linux is the absence of VBS. I use it for everything,
especially the HTA version.

I haven't found a need to learn .net, so I haven't.
--
Crash

"I am not young enough to know everything."
~ Oscar Wilde ~
Mayayana
2017-02-11 21:56:11 UTC
Permalink
"Dave "Crash" Dummy" <***@invalid.invalid> wrote

| My whole system is tailored with scripts! One of the main things that
| keeps me from Linux is the absence of VBS. I use it for everything,
| especially the HTA version.
|
Me, too. Last time I experimented with Linux,
a few years back, I was able to install WSH under
WINE and run scripts. It worked pretty well. But
it's still, of course, a convoluted approach compared
to Windows. And nothing under WINE is certain to
be without glitches.
Loading...