Merge branch 'tauri' of https://git.ez-pp.farm/EZPPFarm/EZPPLauncher into tauri
This commit is contained in:
@@ -63,8 +63,18 @@ pub fn valid_osu_folder(folder: String) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[tauri::command]
|
||||
pub fn find_osu_installation() -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
pub fn find_osu_installation() -> Option<String> {
|
||||
use winreg::RegKey;
|
||||
use winreg::enums::*;
|
||||
|
||||
let hklm_registry_paths = ["SOFTWARE\\Classes\\osu\\DefaultIcon"];
|
||||
|
||||
let hkcr_registry_paths = [
|
||||
@@ -140,7 +150,7 @@ pub fn find_osu_installation() -> Option<String> {
|
||||
}
|
||||
}
|
||||
}
|
||||
return None;
|
||||
None
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
@@ -1,6 +1,4 @@
|
||||
use std::ffi::OsString;
|
||||
use std::fs;
|
||||
use std::os::windows::ffi::OsStringExt;
|
||||
use std::path::Path;
|
||||
use sysinfo::Pid;
|
||||
|
||||
@@ -178,12 +176,20 @@ pub fn get_osu_config<P: AsRef<Path>>(
|
||||
return Some(config_map);
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn get_window_title_by_pid(_pid: Pid) -> String {
|
||||
"".to_string()
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn get_window_title_by_pid(pid: Pid) -> String {
|
||||
use std::sync::{Arc, Mutex};
|
||||
use winapi::shared::windef::HWND;
|
||||
use winapi::um::winuser::{
|
||||
EnumWindows, GetWindowTextW, GetWindowThreadProcessId, IsWindowVisible,
|
||||
};
|
||||
use std::ffi::OsString;
|
||||
use std::os::windows::ffi::OsStringExt;
|
||||
|
||||
extern "system" fn enum_windows_proc(
|
||||
hwnd: HWND,
|
||||
|
Reference in New Issue
Block a user