471,339 Members | 1,193 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,339 software developers and data experts.

How to hide a program?

Hi all,

I've created a program that receives files and opens the corresponding
program (for example adobe acrobat). However, when started, i would
like to see nothing of the running program. I only want to see the
program that will be opened.
Is it possible to start a program 'hidden' or minimized to at least
the system tray? And, if yes., could some one help me on this?

Thanks already!

Jeroen

Jun 20 '07 #1
9 9024
jvdb wrote:
Hi all,

I've created a program that receives files and opens the corresponding
program (for example adobe acrobat). However, when started, i would
like to see nothing of the running program. I only want to see the
program that will be opened.
Is it possible to start a program 'hidden' or minimized to at least
the system tray? And, if yes., could some one help me on this?
I'm not exactly sure what you mean here, but I guess you want the
command-window suppressed. You can do so by naming your scripts *.pyw,
which will invoke pythonw.exe instead. That has no command-window.

Diez
Jun 20 '07 #2
On 20 jun, 15:59, "Diez B. Roggisch" <d...@nospam.web.dewrote:
jvdb wrote:
Hi all,
I've created a program that receives files and opens the corresponding
program (for example adobe acrobat). However, when started, i would
like to see nothing of the running program. I only want to see the
program that will be opened.
Is it possible to start a program 'hidden' or minimized to at least
the system tray? And, if yes., could some one help me on this?

I'm not exactly sure what you mean here, but I guess you want the
command-window suppressed. You can do so by naming your scripts *.pyw,
which will invoke pythonw.exe instead. That has no command-window.

Diez
Hi Diez,

I forgot to mention that i have created a Windows executable of the
script.
What i want is to run the application minimized in the system tray or
totally hidden.

regards,
Jeroen

Jun 20 '07 #3
jvdb wrote:
Hi all,

I've created a program that receives files and opens the corresponding
program (for example adobe acrobat). However, when started, i would
like to see nothing of the running program. I only want to see the
program that will be opened.
Is it possible to start a program 'hidden' or minimized to at least
the system tray? And, if yes., could some one help me on this?

Thanks already!

Jeroen
You can do this with:

import win32process

STARTUPINFO=win32process.STARTUPINFO()
STARTUPINFO.dwX=0
STARTUPINFO.dwY=0
STARTUPINFO.dwXSize=800
STARTUPINFO.dwYSize=600
execute_target="enter program to run here"
commandLine=None
processAttributes=None
threadAttributes=None
bInheritHandles=0
dwCreationFlags=0
currentDirectory=None
#
# Start the program
#
win32process.CreateProcess(execute_target,
commandLine,
processAttributes,
threadAttributes,
bInheritHandles,
dwCreationFlags,
newEnvironment,
currentDirectory,
STARTUPINFO)
-Larry Bates
Jun 20 '07 #4
On 20 jun, 17:05, Larry Bates <larry.ba...@websafe.comwrote:
jvdb wrote:
Hi all,
I've created a program that receives files and opens the corresponding
program (for example adobe acrobat). However, when started, i would
like to see nothing of the running program. I only want to see the
program that will be opened.
Is it possible to start a program 'hidden' or minimized to at least
the system tray? And, if yes., could some one help me on this?
Thanks already!
Jeroen

You can do this with:

import win32process

STARTUPINFO=win32process.STARTUPINFO()
STARTUPINFO.dwX=0
STARTUPINFO.dwY=0
STARTUPINFO.dwXSize=800
STARTUPINFO.dwYSize=600
execute_target="enter program to run here"
commandLine=None
processAttributes=None
threadAttributes=None
bInheritHandles=0
dwCreationFlags=0
currentDirectory=None
#
# Start the program
#
win32process.CreateProcess(execute_target,
commandLine,
processAttributes,
threadAttributes,
bInheritHandles,
dwCreationFlags,
newEnvironment,
currentDirectory,
STARTUPINFO)

-Larry Bates
Hi Larry,

The thing is, i don't want to see anything of my program, just the
launched program.
I already have the program working. But when i create an executable of
it with py2exe and start it, i don't want to see that it is running,
perhaps just in the systemtray. That is my problem.

thanks!
Jeroen

Jun 20 '07 #5
* jvdb (Wed, 20 Jun 2007 08:22:01 -0700)
The thing is, i don't want to see anything of my program, just the
launched program.
I already have the program working. But when i create an executable of
it with py2exe and start it, i don't want to see that it is running,
perhaps just in the systemtray. That is my problem.
http://www.ntwind.com/software/utilities/hstart.html
Jun 20 '07 #6
On 6/20/07, jvdb <st***********@gmail.comwrote:
The thing is, i don't want to see anything of my program, just the
launched program.
I already have the program working. But when i create an executable of
it with py2exe and start it, i don't want to see that it is running,
perhaps just in the systemtray. That is my problem.
Try renaming your main script to have a .pyw extension as Diez said,
or use the --windows option when running py2exe.

http://mail.python.org/pipermail/pyt...er/241319.html

-- David
Jun 20 '07 #7
En Wed, 20 Jun 2007 11:26:09 -0300, jvdb <st***********@gmail.com>
escribió:
On 20 jun, 15:59, "Diez B. Roggisch" <d...@nospam.web.dewrote:
>jvdb wrote:
Is it possible to start a program 'hidden' or minimized to at least
the system tray? And, if yes., could some one help me on this?

I'm not exactly sure what you mean here, but I guess you want the
command-window suppressed. You can do so by naming your scripts *.pyw,
which will invoke pythonw.exe instead. That has no command-window.

I forgot to mention that i have created a Windows executable of the
script.
How did you create it? Using py2exe? Use windows=your_program.py instead
of console=... in your setup script.

--
Gabriel Genellina

Jun 20 '07 #8
Hi all,

thanks very much! it was indeed how i compiled to .exe
After using the windows= , my issue was solved. Thanks to all who took
the time on helping me.

Jeroen

Jun 21 '07 #9
On Jun 20, 10:43 am, Thorsten Kampe <thors...@thorstenkampe.dewrote:
* jvdb (Wed, 20 Jun 2007 08:22:01 -0700)
http://www.ntwind.com/software/utilities/hstart.html
I'm not the OP but this looks very useful to me.

Thanks.
....
Jay Graves
Jun 21 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by King W.Wang | last post: by
2 posts views Thread by Dung Ping | last post: by
4 posts views Thread by G. van den Broek | last post: by
3 posts views Thread by meska | last post: by
4 posts views Thread by Matthew | last post: by
2 posts views Thread by Terry Olsen | last post: by
4 posts views Thread by Blaine | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.