Results 1 to 5 of 5

Thread: I see WS_MINIMIZEBOX and WS_MAXIMIZEBOX, but what about something like WS_CLOSEBOX?!?

  1. #1

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78

    I see WS_MINIMIZEBOX and WS_MAXIMIZEBOX, but what about something like WS_CLOSEBOX?!?

    I can't find anywhere in my lists where the window just simply adds a closebox, and that's it! No minimize or maximize boxes! No no boxes! But I want a window that just has a closebox!

    I'd also like to know how to add your own icons to windows.

    Thanks!
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

  2. #2
    jim mcnamara
    Guest
    You use the RemoveMenu api
    Code:
    long menu_hWnd = GetSystemMenu(Window_hWnd, 0L);
    RemoveMenu(menu_hWnd, 6L, MF_BYPOSITION);
    The "6" refers to the position of the box you want to remove.
    Depending on the window style you have, it could be a different number, - it's just a count from starting position (MF_BYPOSITION).

    Mess around 'til you find the button you want to remove. On a standard SDI window the "6" will remove the minimize button. & removes the "closebox".

  3. #3

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78
    Actually, that was one of the first things I tried, but it didn't remove the minimize and maximize boxes and the ability to resize the map. (I removed the Restore, Size, Minimize, and Maximize menus.) There has got to be a way to customize a form however you want, because I have seen windows of all types.

    Also, I'm still wondering how you would load your own icons for the window.
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

  4. #4
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    I think that is what you want:

    PHP Code:
        SetWindowLong(hwndGWL_STYLEWS_POPUP WS_SYSMENU WS_CAPTION WS_SIZEBOX); 
    It will change the window's style so that it only has a close box. You will still be able to resize the window.

    ----------------

    You can have an icon loaded in a resource file and then you can set the icon of your window when you are filling the structure of your window like this:

    PHP Code:
    #include "resource.h"

    //.....

    WNDCLASSEX wc;
        
    wc.hIcon         MAKEINTRESOURCE(MYICON);
        
    wc.hIconSm       MAKEINTRESOURCE(MYICON);

    //... 
    I assume that you you have loaded an icon named "MYICON" in the resource file - the header file of that named "resource.h"
    Baaaaaaaaah

  5. #5

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78
    Hey, it works now! Tnx!
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

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