Member Avatar for wtzolt

Hi,

What I'm trying to do is to write a script which would open an application only in process list. Meaning it would be "hidden". I don't even know if its possible in python.

If not, there has to be a function would allow for a program to be opened with python in a minimized state like "wsMinimized" from Delphi, something like this:

import subprocess def startProgram(): subrpocess.minimize(subprocess.Popen('C:\test.exe')) ??? I know this is wrong but you get the idea... startProgram()

Any ideas?

Oh and the programs that i want to hide are the ones that don't have the option to be minimized into tray so that's sort of a compromise.

Member Avatar for vegaseat

WAG, try to give your program a .pyw extension.

Member Avatar for wtzolt

If only it was that simple...

Member Avatar for bvdet

I used this answer on another forum.

Try the following. It may not work on child windows spawned by the process.

import subprocess info = subprocess.STARTUPINFO() info.dwFlags = 1 info.wShowWindow = 0 subprocess.Popen("notepad.exe", startupinfo=info)
Member Avatar for wtzolt

It works for notepad but doesn't work for other programs for some reason

Member Avatar for Pupo

Hi.
Notepad is on your PATH, inside Windows directory. For other programs to be launched, i guess you should call them with the complete path, like c:/Program\ files/Program/My_program.exe
I don't use Windows, so I'm guessing.

Member Avatar for jcao219

Hi.
Notepad is on your PATH, inside Windows directory. For other programs to be launched, i guess you should call them with the complete path, like c:/Program\ files/Program/My_program.exe
I don't use Windows, so I'm guessing.

almost,
Windows is weird with backslashes (and also case insensitive)
"C:\Program Files\Program\my_program.exe"

Member Avatar for wtzolt

:) Nah the problem was that the program that i was trying to hide was written in delphi and it well..
anyways i made the thing hide in c++ so it doesn't mater anymore.
thanks guys anyways.

Member Avatar for vegaseat

:) Nah the problem was that the program that i was trying to hide was written in delphi and it well..
anyways i made the thing hide in c++ so it doesn't mater anymore.
thanks guys anyways.

If only the author of the Delphi program would have added a commandline arg to minimize or hide it.
There is probably something in the win32 extension package for Python to do it too.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.