Thread: Docking a Window to screen

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    2

    Docking a Window to screen

    Hello,
    I have an HWND and I want to dock it to the screen like this:
    Dock example with Google Desktop Sidebar

    Stuff to know:
    Maximized windows won't cover the docked window's area.
    Desktop icons will move a bit to the right so they won't be covered by the docked window. (If it's docked to the left and icons are aligned to the left)
    Desktop icons will move a bit down if the window is docked to the top.
    Docked windows can be docked to top, bottom, left and right.
    The Taskbar is a window that is docked to the bottom.

    I tried searching for codes to do that, but none of them worked or did what I want.
    Can someone give me an example code to dock an HWND like that?

    Thanking in advance,
    LIJI.

  2. #2
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    I believe SystemParametersInfo() is the function you're looking for, specifically the SPI_(SET/GET)WORKAREA flags. Googling SPI_SETWORKAREA turns up some code, but the MSDN docs should be enough. Remember to set the desktop back when you're done.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  3. #3
    Registered User
    Join Date
    Jun 2007
    Posts
    2
    Thank you very much, I'll try it tomorrow.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C or C++
    By AcerN30 in forum Game Programming
    Replies: 41
    Last Post: 05-30-2008, 06:57 PM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  4. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM
  5. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM