Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Latest commit

 

History

History
46 lines (36 loc) · 1.05 KB

NOTES.adoc

File metadata and controls

46 lines (36 loc) · 1.05 KB

About

These are some notes for the Rust language.

Accessing consts inside structs

In Visual Studio Code you can hover over the const’s value to get the hexadecimal.

    const WS_CAPTION: isize = 0xC0000;
    const WS_POPUP: isize = 0x80000000;
    const WS_SYSMENU: isize = 0x80000;
    const WS_MAXIMIZEBOX: isize = 0x10000;
    const WS_MINIMIZEBOX: isize = 0x20000;
    const WS_EX_TOOLWINDOW: isize = 0x80;
    const WS_EX_APPWINDOW: isize = 0x40000;
    const WS_OVERLAPPEDWINDOW: isize = 0xCF0000;
    const WS_VISIBLE: isize = 0x10000000;

Getting handles

Note
Do this after wind.show().
let hwnd = wind.raw_handle();
let hwnd: HWND = unsafe { mem::transmute(hwnd) };

Example of accessing ITaskList3

CoInitializeEx(Some(null()), COINIT_APARTMENTTHREADED);
let test: ITaskbarList3 = CoCreateInstance(&TaskbarList, None, CLSCTX_ALL)?;
let result = (*test).AddTab(hwnd);

Example of getting RECT

let mut size_rect: RECT = Default::default();
GetWindowRect(hwnd, &mut size_rect)?;