PC Review


Reply
Thread Tools Rate Thread

Maximized window cannot be minimized

 
 
Kai Zhang
Guest
Posts: n/a
 
      24th May 2005
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


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      24th May 2005
Kai,

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

I hope this helps,

Cor


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      24th May 2005
"Cor Ligthert" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      24th May 2005

"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


 
Reply With Quote
 
Carlos J. Quintero [.NET MVP]
Guest
Posts: n/a
 
      24th May 2005
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" <(E-Mail Removed)> escribió en el mensaje
news:u$(E-Mail Removed)...
>
> "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
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      24th May 2005
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


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      24th May 2005
Cor,

"Cor Ligthert" <(E-Mail Removed)> 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/>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      24th May 2005

"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


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      24th May 2005
"Cor Ligthert" <(E-Mail Removed)> 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/>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      24th May 2005
Herfried,

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

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Maximized" window isn't maximized asldfkj Windows XP Help 7 2nd Oct 2006 12:22 PM
Determining a windows state (Maximized, Minimized, Normal) given a Window Handle Mark Hollander Microsoft VB .NET 1 1st Nov 2005 05:52 PM
? run code if window is closed/ minimized / restored /maximized / moved / resized Dan Microsoft VB .NET 2 4th Nov 2003 09:19 AM
Re: Photo Editor window is either maximized or minimized Bob I Microsoft Windows 2000 Applications 0 23rd Oct 2003 03:05 PM
New window links open a minimized window; minimized window is bar at top lr sachs Windows XP Internet Explorer 1 17th Sep 2003 01:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:39 AM.