CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2007
    Posts
    20

    How to prevent the "Show Desktop" from minimizing my window?

    Hi,

    My requirement is that my application's window should not get minimized even on clicking the "Show Desktop" in quick Launch. Is there a way to handle this?

    I tried handling the WM_WINDOWPOSCHANGING and tried to set the WINDOWPOS structure's flag to SWP_SHOWWINDOW but still the window got minimized.

    Please let me know how to go about this.

    TIA.

    thanks,
    Kansana

  2. #2
    Join Date
    Dec 2004
    Location
    Poland
    Posts
    1,165

    Re: How to prevent the "Show Desktop" from minimizing my window?

    This question was asked here a few times, just do some search. But AFAIR the final conclusion was that "Show Desktop" command does not send any kind of notification to any window, so there is no straightforward way to keep your window visible when "Show Desktop" is pressed.

    Cheers
    B+!
    'There is no cat' - A. Einstein

    Use [code] [/code] tags!

    Did YOU share your photo with us at CG Members photo gallery ?

  3. #3
    Join Date
    Aug 2007
    Posts
    6

    Re: How to prevent the "Show Desktop" from minimizing my window?

    Simply call Show Desktop again. It IS a toggle button - really. (At least in vista, I seem to forget XP's mainfestation of the button).

    It would require a command line as thus "C:\Users\*\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Show Desktop.ink"

    It escapes me how to execute a command line from within a windows program, but I do know it is possible.

    -- Actually never mind --
    This may work... Yet the problem exists when trying to figure out when it is pressed. There 'should' be a way. If not a windows message then some function which escapes us. Is there a way to check if your window is the foreground window? (IsForegroundWindow()) ? maybe? If so, you could call it every pass on a real-time message loop. But that would be - perforamnce wise - in adequte. Hmm... thats a challenge --- I'll get back to you.
    Last edited by Blobmiester; August 13th, 2007 at 11:08 PM.

  4. #4
    Join Date
    May 2007
    Posts
    811

    Re: How to prevent the "Show Desktop" from minimizing my window?

    Quote Originally Posted by Kansana
    Hi,
    My requirement is that my application's window should not get minimized even on clicking the "Show Desktop" in quick Launch.

    May I ask why is that a requirement?

  5. #5
    Join Date
    Apr 1999
    Posts
    27,449

    Re: How to prevent the "Show Desktop" from minimizing my window?

    Quote Originally Posted by Kansana
    Hi,

    My requirement is that my application's window should not get minimized even on clicking the "Show Desktop" in quick Launch.
    If I had an application that didn't minimize itself, I would think there is something wrong with it, it is hung up somehow, or it's a trojan of some type, forcing me to kill the process.

    Regards,

    Paul McKenzie

  6. #6
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    894

    Re: How to prevent the "Show Desktop" from minimizing my window?

    Yeah, I agree. I'd remove your program ASAP.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured