Docking a window to Side of Screen

This is a discussion on Docking a window to Side of Screen within the Windows Programming forums, part of the Platform Specific Boards category; Im trying to get my program window to dock on the side or bottom of the screen kind of like ...

  1. #1
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195

    Docking a window to Side of Screen

    Im trying to get my program window to dock on the side or bottom of the screen kind of like what ICQ does. It takes up that part of the screen so that every other window that tries to maximize only maximizes to my windows' border. Does anyone know how this is done??
    Founder and avid member of the Internationsl Typo Associateion

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    greatly possible windows api returns correct coordinates

    one approach determine coordinates via maximize

    Kuphryn

  3. #3
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    The only way I know of would be to call SystemParametersInfo(), passing SPI_GETWORKAREA to get the work area for the screen. (Screen area - taskbar obscured area) Change the RECT returned based on your windows width, then pass the result back to SystemParametersInfo() with SPI_SETWORKAREA. Then move your window outside the workarea (to the screen edge). Be sure to reset the work area when your program closes, etc.
    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)

  4. #4
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195
    Ok great, thnx for the quick reply. Also i have a follow up question. I have an app that is rather large, can I specify a smaller area smaller then my app window) and just make that my work area? I dont want my whole window 'docking', maybe just part of it?
    Founder and avid member of the Internationsl Typo Associateion

  5. #5
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195
    I have implemented what you guys mentioned and it works great. my problem now is that none of my applications that are maximized are resized to this new area. I tried sending out a global message to all windows that the area was changed:

    SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETWORKAREA, 0);

    Is there any way to notify windows so thier size changes based on this new work area?
    Founder and avid member of the Internationsl Typo Associateion

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. input/output
    By dogbert234 in forum Windows Programming
    Replies: 11
    Last Post: 01-26-2005, 06:57 AM
  4. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 05:10 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21