|
-
Sep 8th, 2001, 01:47 AM
#1
Thread Starter
Lively Member
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
-
Sep 8th, 2001, 08:50 AM
#2
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".
-
Sep 8th, 2001, 10:58 AM
#3
Thread Starter
Lively Member
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
-
Sep 8th, 2001, 02:32 PM
#4
PowerPoster
I think that is what you want:
PHP Code:
SetWindowLong(hwnd, GWL_STYLE, WS_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"
-
Sep 9th, 2001, 07:20 PM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|