473,624 Members | 2,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open a program with python minimized or hidden.

6 New Member
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 its not possible, I would settle for even a function that would allow for a program to be opened with python in a minimized state like "wsMinimize d" from Delphi, something like this:

Expand|Select|Wrap|Line Numbers
  1. import subprocess
  2. def startProgram():
  3.     subrpocess.minimize(subprocess.Popen('C:\test.exe')) #  I know this is wrong but you get the idea...
  4. startProgram()
Any ideas?
Feb 23 '10 #1
6 7771
bvdet
2,851 Recognized Expert Moderator Specialist
There is a way on Windows using win32com.client . Example
Expand|Select|Wrap|Line Numbers
  1. import win32com.client
  2. wordapp = win32com.client.Dispatch("Word.Application")
  3. wordapp.Visible=0
Feb 23 '10 #2
wtzolt
6 New Member
@bvdet
Yes the problem is that the program that i want to lounch and hide doesn't have
a COM server registered under the name.
Its just a simple number crunching program outputting the results onto desktop.

There has to be a way to do this using subprocess...
Feb 23 '10 #3
bvdet
2,851 Recognized Expert Moderator Specialist
Try the following. It may not work on child windows spawned by the process.
Expand|Select|Wrap|Line Numbers
  1. import subprocess
  2.  
  3. info = subprocess.STARTUPINFO()
  4. info.dwFlags = 1
  5. info.wShowWindow = 0
  6. subprocess.Popen("notepad.exe", startupinfo=info)
Feb 23 '10 #4
wtzolt
6 New Member
Not working...
Had no idea such a simple thing to do was so awkward.
Feb 23 '10 #5
Glenton
391 Recognized Expert Contributor
Perhaps it can be done with threads?
Feb 24 '10 #6
wtzolt
6 New Member
Never worked with threads so can't really imagine where to even begin to be honest.
Feb 24 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

13
35522
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
4
5012
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 PYQT. But memory use still big. But but but when I minimize the windows to taskbar, a fantasy something happened. memory use very very low when windows minimize.
40
10810
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not defaulting the the first active window. How do I make a hyperlink point to the active window? I don not want the hyperlink to default to the same page. I do want a second window but only a second window and not multiple pages.
1
1790
by: yan martin | last post by:
Hi, I am using this script "function openFullscreen(page) { var yes = 1; var no = 0; windowprops = "width=" + (screen.width-10) + ",height=" + (screen.height-50) + ",top=0,left=0"; windowprops += (menubar ? ",menubars" : "") +
0
2084
by: cemal eroglu | last post by:
Hi, I don't use CreateNoWindow=True since I would like to see this application on the task manager (as an application) and I should be able to end the task (and its child processes etc). So I used process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized However my dos window is still maximized. Here is the code snippe ----------------------- process = new Process() process.StartInfo.UseShellExecute = false...
1
1114
by: nassar | last post by:
I want to know how i can make my program always get the messages sent by keyboard even when its window is hidden, minimized, or not in focus? i know that the usual message handlers like: void CMyclass::OnKeyDown(UINT nChar,...) won't work when the program doesn't have the focus, so what i can do? thanx..
2
9761
by: Mads Westen | last post by:
Hi, I need to run a batch file wich I would like to run minimized. The batchfile runs a exe file with some arguments, and deletes af file, and remanes another. How can I do that minimized? I know I can make a vbs file, and use the following line to minimize: Set WSHShell = Nothing But can I do the same thing in C#?
1
2550
by: Sorin Schwimmer | last post by:
Hi, I tried for the first time a Tix Tree, so, if my question is naive, I apologize upfront. The following code: <code> from Tix import * r=Tk()
9
9956
by: jvdb | last post by:
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!
1
4383
by: setori88 | last post by:
Hi guys this script i downloaded from here, http://win32com.goermezer.de/index.php?option=com_content&task=view&id=193&Itemid=274 I copied this script and setup and instance of open office writer. created a .doc file and a copied it making a change to that file. here is the code
0
8251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8688
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7178
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6115
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1496
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.