473,387 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 9898
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: King W.Wang | last post by:
Hi Java gurus, I've copied the following program from the book "Java by Examples". It compiles well with javac. But it does not run as expected. EXPECTED: It is expected that, when you input...
4
by: ulysses | last post by:
hi, I'm working in python 5 months. I think it's very cool language. I do a p2p python program GUI. First I make a software by wxpython. But I find wxpython use many many memory. Second I use...
2
by: Dung Ping | last post by:
Some time ago someone on this forum helped me with the attached coding. The page is in: www.pinyinology.com/keys/keys2.html When clicking the ok, the letters will change one by one. I like...
4
by: G. van den Broek | last post by:
Does anyone know how to hide a c# application from the process list (Win 2k, XP etc.)? Or if this is 'impossible', how can I let my application automatically restart when it gets killed?
3
by: meska | last post by:
Is there a way in c# to hide program , that it would show in alt+tab ?
4
by: Matthew | last post by:
The following code does not hide the form. Any ideas why? Also, is there a workaround? I have VB.NET 2003. I have a system tray icon, and want to have that be the only thing showing when the...
2
by: Terry Olsen | last post by:
Using the below code, If I use Me.WindowState=Minimized the program runs fine, but you have the taskbar showing the program running. If I use Me.Hide instead, the program immediately exits. If...
4
by: Blaine | last post by:
Does anyone know how I can hide a form from the TaskManager? I've set the ShowInTaskbar to False, but when using Alt-TAB to switch between applications, it appears as a blank icon. I can set it...
1
by: sewid | last post by:
Hi there! I've got a problem with no solution, I hope you might help me. I am writing a small tool with many buttons. Every button starts a thread and this thread starts something else, in the...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.