Check if THide is currently running
()
| 67 | |
| 68 | /// Check if THide is currently running |
| 69 | fn is_thide_running() -> bool { |
| 70 | unsafe { |
| 71 | let class_name: Vec<u16> = format!("{}\0", IPC_WINDOW_CLASS).encode_utf16().collect(); |
| 72 | |
| 73 | matches!( |
| 74 | FindWindowW( |
| 75 | windows::core::PCWSTR(class_name.as_ptr()), |
| 76 | windows::core::PCWSTR::null(), |
| 77 | ), |
| 78 | Ok(hwnd) if !hwnd.0.is_null() |
| 79 | ) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | /// Start THide in GUI mode |
| 84 | fn start_gui() -> Result<(), Box<dyn std::error::Error>> { |