pub struct WindowMainOpts {
pub class_name: String,
pub class_style: CS,
pub class_icon: Icon,
pub class_cursor: Cursor,
pub class_bg_brush: Brush,
pub title: String,
pub size: (i32, i32),
pub style: WS,
pub ex_style: WS_EX,
pub menu: HMENU,
pub accel_table: Option<DestroyAcceleratorTableGuard>,
pub process_dlg_msgs: bool,
}
gui
only.Expand description
Options to create a WindowMain
programmatically
with WindowMain::new
.
Fields§
§class_name: String
Window class name to be registered.
Defaults to an auto-generated string.
class_style: CS
Window class styles to be registered.
Defaults to co::CS::DBLCLKS
.
class_icon: Icon
Window main icon to be registered.
Defaults to gui::Icon::None
.
class_cursor: Cursor
Window cursor to be registered.
Defaults to gui::Cursor::Idc(co::IDC::ARROW)
.
class_bg_brush: Brush
Window background brush to be registered.
Defaults to gui::Brush::Color(co::COLOR::BTNFACE)
.
title: String
Window title to be created.
Defaults to empty string.
size: (i32, i32)
Width and height of window client area, in pixels, to be created. Does not include title bar or borders.
Defaults to gui::dpi(600, 400)
.
style: WS
Window styles to be created.
Defaults to WS::CAPTION | WS::SYSMENU | WS::CLIPCHILDREN | WS::BORDER | WS::VISIBLE
.
Suggestions:
WS::SIZEBOX
to make the window resizable;WS::MINIMIZEBOX
to have a minimize button;WS::MAXIMIZEBOX
to have a maximize button.
ex_style: WS_EX
Extended window styles to be created.
Defaults to WS_EX::LEFT
.
Main menu of the window to be created.
This menu is not shared: the window will own it, and destroy it when the window is destroyed.
Defaults to none.
accel_table: Option<DestroyAcceleratorTableGuard>
Main accelerator table of the window to be
created.
Use
HACCEL::CreateAcceleratorTable
to create one.
Defaults to None
.
process_dlg_msgs: bool
In most applications, the window loop calls
IsDialogMessage
so child control messages will properly work. However, this has the side
effect of inhibiting
WM_CHAR
messages from being sent to the window procedure. So, applications which
do not have child controls and deal directly with character processing –
like text editors – will never be able to receive WM_CHAR
.
This flag, when true
, will enable the normal IsDialogMessage
call in
the window loop. When false
, the call will be suppressed.
Defaults to true
.