1. creating dialog-like windows using win32lib or CreateWindowEx
- Posted by ed_davis2 at yahoo.com Apr 14, 2004
- 1055 views
I'm trying to create a dialog box, using win32lib (or win32 API CreateWindowEx), that looks like a normal dialog: A caption/title, no system menu, a close [x] button. For instance, the notepad find dialog is like this (it also has a help button). I can nearly get this style by using the WS_EX_TOOLWINDOW. However, using this style, the title is drawn in a smaller font, and the close [x] button is very small. Anyone know how to do this?
2. Re: creating dialog-like windows using win32lib or CreateWindowEx
- Posted by Tommy Carlier < tommy.carlier at pandora.be > Apr 14, 2004
- 994 views
The closest I can get: 1. style = or_all({WS_THICKFRAME, WS_SYSMENU}), extended style = WS_EX_DLGMODALFRAME No minimize/maximize but with a system menu (is this really a problem?). 2. style = WS_THICKFRAME, extended style = WS_EX_DLGMODALFRAME No system menu, but also no close button. If you want the little [?]-button, extended style = or_all({WS_EX_DLGMODALFRAME, WS_EX_CONTEXTHELP})
3. Re: creating dialog-like windows using win32lib or CreateWindowEx
- Posted by ed_davis2 at yahoo.com Apr 14, 2004
- 998 views
Tommy Carlier wrote: >The closest I can get: 1. style = or_all({WS_THICKFRAME, >WS_SYSMENU}), extended style = WS_EX_DLGMODALFRAME No >minimize/maximize but with a system menu (is this really a >problem?). Yes it is a problem - I don't want the system menu - I want it to look like other dialogs found in other applications. >2. style = WS_THICKFRAME, extended style = WS_EX_DLGMODALFRAME >No system menu, but also no close button. If you want the little >[?]-button, extended style = or_all({WS_EX_DLGMODALFRAME, >WS_EX_CONTEXTHELP}) Thanks for the attempts. It is interesting. If you create a resource file, using the styles DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU, and load the dialog via the normal means, and call DialogBox, you get just what I would like to have. Obviously, there must be a way to do it with the Win32 API, since Windows does it. I ran spy on notepads find dialog, and its styles were: WS_POPUP, WS_VISIBLE, WS_CLIPSIBLINGS, WS_BORDER, WS_DLGFRAME, WS_SYSMENU, 0x20c4 (what is that?). Extended styles: WS_EX_DLGMODALFRAME, WS_EX_WINDOWEDGE, WS_EX_CONTEXTHELP, WS_EX_LEFT, WS_EX_LTRREADING, WS_EX_RIGHTSCROLLBAR, WS_EX_CONTROLPARENT I tried this, but it still has the system menu. I even tried to delete the system menu as a response to WM_CREATE, via GetSystemMenu/DestroyMenu, but that didn't work either. There must be a way!