Windows Develop Bookmark and Share   
 index > Windows Forms General > After "show desktop": how to maximize my app correctly? (or How to send Desktop back to bottom of z-order ?)
 

After "show desktop": how to maximize my app correctly? (or How to send Desktop back to bottom of z-order ?)

my app is borderless, ShowInTaskBar == false, running fine most of the time under XP and Vista. written in C# under .Net 2.0.
1. click on "show desktop" or [win]+D (my app is hidden, ok)
2. click on systray icon of my app, it is shown by my own click-handler (my app is shown, ok)
3. click on desktop outside of my app - OOPS:
my app vanishes behind the desktop ... why ?
what has my app to do, to simulate maximizing from Taskbar ?
After maximizing any other app from taskbar, the effect is gone!

Guess: I have to send the Desktop back to the bottom of the z-order - how can I do that programmatically ?

Thanks.
BTW: is this the right forum for that ?
  • Moved byRobert BreitenhoferMSFTWednesday, July 15, 2009 7:00 AMEnglish instead German (From:Windows Vista)
  • Moved byTaylorMichaelLMVPWednesday, July 15, 2009 2:22 PMNot IDE related (From:Visual C# IDE)
  •  
beakling  Tuesday, July 14, 2009 5:07 PM
Hi beakling,

Based on my understanding, your application form disappear when you click the desktop. Do you meet that problem on just one computer or on each computer? If only occur on one computer, could you please give me the detail information of that computer? E.g. OS version, .NET version.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Thursday, July 16, 2009 2:28 AM
Hi Kira Qian,

it is on each computer. I tried it with XP Professional and with Vista.
In the click-handler of my systray-icon i'm using the inherited methods BringToFront(), Show() and Activate().
I played around with SetWindowPos - but with no success.

There has to be something the OS is doing, when you click on a minimized app in the Taskbar. How about sending a message to the Desktop-Window ??

Sincerely,
beakling
beakling  Thursday, July 16, 2009 9:29 AM
seems as if there is no really solution.
1.) app is borderless -> it doesn't get the "minimize" from minimize all
2.) app doesn't show in taskbar -> that is a "design error", so desktop mode is not automagically switched off by maximizing...

One workaround could be to set the app to TopMost on clicking the icon - but then you need a timer to reset the TopMost.
Another could be to set showintaskbar to true and then again to false - that works, but all windows are destroyed and recreated ... ending up in flickering.

I think a proper solution would at least offer the possibility to ask the OS, whether it is in desktop mode or not.
Better, there was an event "DesktopmodeChanged" to which my app could bind to - then my app would know the mode and could behave correctly.
Then, only the possibility to switch that mode programmatically would still be missing ...

that's it. this case is closed, my app is living with this little (?) bug.

bye, beakling
beakling  Monday, September 21, 2009 4:10 PM

You can use google to search for other answers

Custom Search

More Threads

• Scrollbars do not appear when adding controls to self
• How do I create a backshadow of a line of text
• Clippping Regions in PaintEventArgs is width=0, height=0?...
• Using Reflection in Windows Forms
• Extract selected content from a web browser control?
• New and open
• Possible bug in ListView control
• How to: Provide a Progress Dialog Box for File Operations
• Non-repeating random?
• How to create an antivirus?