dividing windows

This is a discussion on dividing windows within the Windows Programming forums, part of the Platform Specific Boards category; hi, Say I wanted to divide a window into 2 halves, which would be the most efficent method to get ...

  1. #1
    manics
    Guest

    dividing windows

    hi,
    Say I wanted to divide a window into 2 halves, which would be the most efficent method to get a grey dividing bar across the window?
    I've tried varoius ways like drawing grey rectangles and creating long, thin grey windows without caption bars. But these methods are pretty clumsy, especially when it comes to resizing.
    Im just using the API at the moment so MFC is out, any suggestions would be greatly appreciated.
    thanks.

  2. #2
    Registered User
    Join Date
    Jan 2003
    Posts
    7
    Hmm, how about two windows? Just have WM_SIZE messages align them. You know, have one WS_OVERLAPPED and another WS_THICKFRAME. Two functions to look into: ClientToScreen and MoveWindow.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    I would use HDC's. Unless the two 'panes' required more windows functionality (ie menu, lots of controls ect)

    Create a compatible HDC for each 'pane' in the main window, as well as the HDC for the frame buffer (as the app starts).

    Paint the whole background grey, then paint each 'pane' over this grey background.

    Send this HDC to be drawn in response to a WM_PAINT msg.

    Delete the created HDC's on close.

    this way you can update seperate 'panes' independantly.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    if your using MFC, take a look at CSplitterWnd
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  5. #5
    Registered User
    Join Date
    Dec 2002
    Posts
    119
    Put this in your WM_PAINT handler. hWnd is your window's handle and hdc is an HDC to that window.
    Code:
    RECT rect;
    GetClientRect(hWnd, &rect);
    rect.left = rect.right / 2;
    DrawEdge(hdc, &rect, EDGE_BUMP, BF_LEFT);
    -Futura

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Anyone using Windows 7?
    By Sharke in forum General Discussions
    Replies: 60
    Last Post: 07-12-2009, 08:05 AM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM

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