Thread: Status bar covering parent window....by the way, thanks Ward

  1. #1
    Unregistered
    Guest

    Status bar covering parent window....by the way, thanks Ward

    First of all, thanks Ward for responding to my last question regarding rich edit controls.

    http://www.cprogramming.com/cboard/s...?threadid=1428


    My question this time has to do with status windows....

    I created a status window using the CreateWindowEx API function

    hStatusWnd = CreateWindowEx(0, STATUSCLASSNAME,"", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, NULL, hInst, NULL);

    Works fine but it covers the bottom part of the parent window and the bottom part of the vertical scroll bar. How do I prevent the status bar from doing this?

    One last question...How do I prevent the WM_DESTROY message from being sent when Alt-F4 is pressed or when the user clicks the X at the top of the window? I want a message box to appear instead.

    Even when I got rid of the PostQuitMessage(0); function the window still closes. Any ideas??

    Thank you in advance

    Echidna

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    32
    I am not sure exactly how to stop ALT+F4, most of the time you wont get a response to this question anyways because it's unnatural. It's not supposed to be like that for a Win32 app and so most programmers will suggest not attempting to mess with the natural order of things.

    To stop the window from closing so then you can popup this dialog box or whatever you wish to popup I believe you have to also catch the WM_CLOSE message. In both cases do nothing, or popup the dialog or whatever it is you want to popup at the user for daring to close your program! Hehe, I wouldn't make too many apps that wont close though. Lots of people will get angry with you and stop using your proggies.

    Btw - I have no clue about your main topic. I just thought I'd help you out with the problem I had an idea of how to fix. I haven't tried it so it may not work.
    cerion
    Use the code Luke.

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. Creating a child window in a parent window
    By vopo in forum Windows Programming
    Replies: 8
    Last Post: 10-06-2007, 04:15 PM
  3. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. Status bar and toolbar positioning
    By SMurf in forum Windows Programming
    Replies: 3
    Last Post: 09-30-2001, 05:18 PM