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

Maximized window cannot be minimized

In my application, I used

SetForegroundWindow hwnd

to bring the background window to front of desktop. It works fine in most of
the case. However, if the targeted background window is minimized, after
executing SetForegroundWindow hwnd to maximize this window, this window
cannot be minimized any longer(nothing happens when click the minimize
button on top-right corner of the window title bar)

I also tried this function:

ShowWindow hwnd, SW_SHOWMAXIMIZED

Same thing happens, can anyone give me some hint to make the minimize button
work again?

Thanks,

Kai
Nov 21 '05 #1
11 1758
Kai,

Why do you not use just TopMost
http://msdn.microsoft.com/library/de...pmosttopic.asp

I hope this helps,

Cor
Nov 21 '05 #2
"Cor Ligthert" <no************@planet.nl> schrieb:
Why do you not use just TopMost


.... because it's something entirely different...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

"Herfried K. Wagner [MVP]"
Why do you not use just TopMost


... because it's something entirely different...

I did not know that you was asking your question in this newsgroup with
another pseudo, however can you explain to me what is different?

Cor
Nov 21 '05 #4
Hi Cor,

Herfried may provide a better explanation, but AFAIK, TopMost establishes a
window in your app that will be always on top of the others, while
SetForegroundWindow is used to bring a normal window to the foreground, to
call the user's attention over it, if the OS allows it (because it can be
annoying, see
http://msdn.microsoft.com/library/de...oundwindow.asp)

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Cor Ligthert" <no************@planet.nl> escribió en el mensaje
news:u$**************@tk2msftngp13.phx.gbl...

"Herfried K. Wagner [MVP]"
Why do you not use just TopMost


... because it's something entirely different...

I did not know that you was asking your question in this newsgroup with
another pseudo, however can you explain to me what is different?

Cor

Nov 21 '05 #5
Carlos,

Thanks,

However, in my idea can I by directly after each other setting topmost to
true and false doing this process. I have the idea that everybody thinks
this is a designer option.

However, if I see this wrong, I gladly like to know what I miss.

Cor
Nov 21 '05 #6
Cor,

"Cor Ligthert" <no************@planet.nl> schrieb:
However, in my idea can I by directly after each other setting topmost to
true and false doing this process. I have the idea that everybody thinks
this is a designer option.


It doesn't work as expected. The form keeps standing in the foreground even
if you reset 'TopMost' and clicking another window won't bring this window
to front.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7

"Herfried K. Wagner [MVP]" > "
However, in my idea can I by directly after each other setting topmost to
true and false doing this process. I have the idea that everybody thinks
this is a designer option.


It doesn't work as expected. The form keeps standing in the foreground
even if you reset 'TopMost' and clicking another window won't bring this
window to front.

I tested this of course in advance before I wrote this with a timer.

:-)

Cor
Nov 21 '05 #8
"Cor Ligthert" <no************@planet.nl> schrieb:
However, in my idea can I by directly after each other setting topmost
to true and false doing this process. I have the idea that everybody
thinks this is a designer option.


It doesn't work as expected. The form keeps standing in the foreground
even if you reset 'TopMost' and clicking another window won't bring this
window to front.

I tested this of course in advance before I wrote this with a timer.


Well, I used a timer, but it still doesn't work as expected on my Windows XP
Professional SP2.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #9
Herfried,

Show me the code maybe I do than understand what you mean?

Cor
Nov 21 '05 #10
This is my code

\\\
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
Me.TopMost = True
Me.TopMost = False
Timer1.Enabled = False
End Sub
///

When the form shows I click on another program to give the front focus when
the Timer fires the form is showed.

Cor
Nov 21 '05 #11
Cor,

"Cor Ligthert" <no************@planet.nl> schrieb:
This is my code

\\\
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
Me.TopMost = True
Me.TopMost = False
Timer1.Enabled = False
End Sub
///

When the form shows I click on another program to give the front focus
when the Timer fires the form is showed.


I use exactly the same code. Start the VB.NET application, bring OE into
the front, then wait until the VB.NET form appears. Then click onto one of
the messages in OE. The VB.NET application remains on top and OE won't be
put into the foreground.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #12

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

Similar topics

3
by: Bob | last post by:
I am trying to create a popup page (to act as a menu) from a parent page. When the parent page (index.jsp) calls my popup function (see below) it will properly open the correct size browser window...
7
by: Colleyville Alan | last post by:
I have an app that uses Access to grab various PowerPoint slides using the followhyperlink command. I have set the PPT window to run in a minimized state: FollowHyperlink link Set oPres =...
2
by: Dan | last post by:
Hello, I am just now converting from the world of DOS. Making simple VB.NET apps was easier than I expected. Now I need some control over the window that the app is running in. Can a VB.NET...
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: Mark Hollander | last post by:
Hi All, I have a window handle and I need to know if the window (External Windows to VB) is minimized, maximized or normal (Restored). Can anyone help me out as to which api call I must make and...
4
by: jeremiah johnson | last post by:
Hi all. I'm writing a small utility that can move a window from one of my monitors to the other, when a system hotkey is pressed. I want to keep the windowstate (maximized or normal) when the...
3
by: Tom | last post by:
I am having a serious issue with my MDI child windows. This is with a large VB.NET application that I ported over to VS 2005 from VS 2003. The problem is that, if the child window is maximized and...
1
by: Marc the Demi-Programmer | last post by:
I am overriding WncProc to make sure my form's location stays within specified parameters. Basically, it has to stay at the top of the screen and not be off to either of the sides. All that works...
4
by: =?Utf-8?B?cGV0ZTE5Njk=?= | last post by:
I want to have an application window be always maximized (or minimized) but never in normal state. If I take away the maximize button in the form and start the application in maximized mode the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.