mirust 0.2.0

SDK for exporting mIRC/AdiIRC-compatible DLL functions in Rust.
1
2
3
4
5
6
7
8
9
10
11
12
use windows::Win32::{
    Foundation::HWND, System::Threading::GetCurrentThreadId,
    UI::WindowsAndMessaging::GetWindowThreadProcessId,
};

pub fn is_main_thread(hwnd: HWND) -> bool {
    unsafe {
        let current_thread_id = GetCurrentThreadId();
        let main_thread_id = GetWindowThreadProcessId(hwnd, None);
        current_thread_id == main_thread_id
    }
}