pub enum WindowClass {
Atom(ATOM),
Name(Vec<u16>),
}Expand description
A window class.
Variants§
Implementations§
Source§impl WindowClass
impl WindowClass
Sourcepub fn builder(class_name: impl AsRef<OsStr>) -> WindowClassBuilder
pub fn builder(class_name: impl AsRef<OsStr>) -> WindowClassBuilder
A builder for creating a new window class.
The class name should be unique, otherwise creation will fail.
Examples found in repository?
examples/hello-win.rs (line 38)
33fn main() {
34 unsafe {
35 let icon = LoadIconW(0 as HINSTANCE, IDI_APPLICATION);
36 let cursor = LoadCursorW(0 as HINSTANCE, IDC_ARROW);
37 let brush = CreateSolidBrush(0xff_ff_ff);
38 let win_class = WindowClass::builder("rust")
39 .icon(icon)
40 .cursor(cursor)
41 .background(brush)
42 .build()
43 .unwrap();
44 let hwnd = WindowBuilder::new(MyWindowProc, &win_class)
45 .name("win-win example")
46 .style(WS_OVERLAPPEDWINDOW)
47 .build();
48 ShowWindow(hwnd, SW_SHOWNORMAL);
49 win_win::runloop(null_mut());
50 }
51}Sourcepub fn from_name(class_name: impl AsRef<OsStr>) -> WindowClass
pub fn from_name(class_name: impl AsRef<OsStr>) -> WindowClass
Create a window class reference from a name.
This function is useful if the window class has already been registered, either through a successful builder or some other means.
Auto Trait Implementations§
impl Freeze for WindowClass
impl RefUnwindSafe for WindowClass
impl Send for WindowClass
impl Sync for WindowClass
impl Unpin for WindowClass
impl UnsafeUnpin for WindowClass
impl UnwindSafe for WindowClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more