473,327 Members | 1,952 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,327 software developers and data experts.

Minimize or restore a window via a small application

I have an application that will look at other Windows applications that are
currently running. In a listbox I have the names of these applications and
their Windows ID. When the user clicks one of the application names in the
listbox I want to either minimize or restore that application's window to the
desktop. Can someone show me how this is done in VS2008 C# and .NET 3.5?

--
-----------
Thanks,
Steve
Jan 16 '08 #1
3 8433
Hi Steve,

If you already have the handle to those windows (hwnd), then you can use
P/Invoke to call win32 api ShowWindow() to restore or minimize them:

#ShowWindow Function ()
http://msdn2.microsoft.com/en-us/lib...48(VS.85).aspx
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 17 '08 #2
#pinvoke.net: ShowWindow (user32)
http://www.pinvoke.net/default.aspx/...howWindow.html

Jan 17 '08 #3
Hi. Thanks for the example. I've implemented the calls and the routines are
running, but my windows will not "restore" to the desktop. I start them via
StartInfo minimized and then my small app wants to display a list of these
minimized windows to open the selected one.

The example says this "The first time an application calls ShowWindow, it
should use the WinMain function's nCmdShow parameter as its nCmdShow
parameter."

What does this mean? How do I do this?

--
-----------
Thanks,
Steve
""Walter Wang [MSFT]"" wrote:
#pinvoke.net: ShowWindow (user32)
http://www.pinvoke.net/default.aspx/...howWindow.html

Jan 17 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Erik Bethke | last post by:
Hello All, I now have a wx.NO_BORDER frame that I have written dragging code for... I like my window this way as it looks sleeker and I am now installing some image buttons. Now I would like...
8
by: Programatix | last post by:
Hi, I'm working on a project which includes XML WebServices and Windows Form application. The Windows Form application will call the XML WebServices to retrieve data from database. The data...
1
by: manoj | last post by:
hi, Can some one tell how to minimize a window. I want to create a custom button to which i want to connect minimize function.I couldn't find any such function. thank you, pradeep
4
by: scarred wind | last post by:
I'm currently doing a window service application in C#. I'm using a simple timer to run everytime i boot up the PC. the timer is running well, but the problem is, i can't register it in my Services...
1
by: Kueishiong Tu | last post by:
I have a .net window form application but I have to get data from various web sites. How do I make Http request (preferrably via post method) from a window form to get the data from those web...
2
by: Nikki | last post by:
Hi, I m working on a windows application using c#.NET. Using borderless non-rectangular forms. Can anybody tell me how to minimize / restore that application from taskbar. (I m already using...
2
by: Kueishiong Tu | last post by:
I have a window form application. My program generates a report. I want to invoke the window notepad program to show the report. How do I do that?
1
by: vidhyapriya | last post by:
when i minimize child window the parent window should be minimize...how it possible..i need code in vb.net anyone tell me
1
by: Anarki | last post by:
I use gcc & g++ in Cygwin to build my programs in Windows Xp. I would like to know how to develop a simple window based application(just a simple window with close button). Also i don't like...
1
by: yu83thang | last post by:
Hi, May I know how to declare a Class in C++ window application form? Below is my code and error as shown below as well. here is my class declaration: ref class CLoadObj { public:
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.