473,473 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Restore Window

Using C# 3.5 (including using System.Runtime.InteropServices) ...

.... if the window is Minimized (IsIconic) ... I would like to ...

If the window was Normal and then Minimized I would like to return it to
Normal.
If the window was Maximized and then Minimized I would like to return it to
Maximized

How can I determine for any window that is minimized if it was previously
normal or previously maximized?

.... Thom
__________________________________________________ _
Thom Little - www.tlanet.net - Thom Little Associates, Ltd.
Sep 16 '08 #1
1 2441
I found it ... finally ...

[DllImport("user32.dll")]
public static extern bool IsIconic( IntPtr hWnd );

[DllImport("user32.dll")]
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow );

public const int SW_RESTORE = 9;

if ( NativeMethods.IsIconic( hWnd ) )
NativeMethods.ShowWindowAsync( hWnd, NativeMethods.SW_RESTORE );

.... Thom
__________________________________________________ _
Thom Little - www.tlanet.net - Thom Little Associates, Ltd.
Sep 16 '08 #2

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

Similar topics

1
by: Martin Karlsson | last post by:
Hi guys, Does anyone know how I can restore a selection created with createRange()? The problem is that I have a function that opens a new window with window.open() which of course makes the...
5
by: Nicolae Fieraru | last post by:
Hi All, I use a simple function on a web site, based on this function: function goVisitSite(Site) { NewWindow1 = window.open(Site, "viewwin",...
2
by: DFS | last post by:
I inadvertently deleted all the items from the built-in Access97 Window menu: Tile Horizontally, Tile Vertically, Cascade, etc. Can I somehow get them back without reinstalling Access97 (or...
1
by: Bill Borg | last post by:
I have a simple chat application. "Host" program has a timer and listens for new requests for chat. The host user will typically minimize that window when there's nothing happening, but I'd like to...
2
by: Charles Law | last post by:
When an MDI child window is minimised its height attribute returns 24 (on my system), but when it is restored it goes back to its former height (and width). How can I get the restore height and...
6
by: Glenn | last post by:
I can determine if another instance is running, but how do I get it's minimized window to restore (in VBNET). Using the standard win32 functions is not working. Thanks
7
by: Wayne | last post by:
I have found the following code on this newsgroup that removes the Access Application minimize, restore and close buttons. Private Const GWL_EXSTYLE = (-20) Private Const GWL_STYLE = (-16) ...
4
by: lesperancer | last post by:
it looks like this will save many versions of a relationship window, but based on the fact that the same tables are displayed in the relationship window and it will restore versions of what was...
0
by: liaodrake | last post by:
Hi, This is something I having been looking for help for awhile now. and found bits and pieces that kinda work, but really dont. what I am building is a project that will Hide a command window...
3
by: aka | last post by:
Hi, I'm actually working on the migration of a DB2 unicode db (V8.2 FP 15) from a Sunfire machine with SunOS (64 bit, Big-endian) to an AIX 5.3 (64-bit, Big-endian) server located in US. The...
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...
0
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
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...

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.