[英]Implementing a Windows Credential Provider
我最近發現了windows-rs框架,並一直在尋找通過實現其ICredentialProvider COM 接口在 Rust 中構建一個Windows Credential Provider 。 我一直在使用在現有問題之一下匯總的信息進行概念驗證實施,但我不確定如何實際公開已編譯的 rust 作為正 ...
[英]Implementing a Windows Credential Provider
我最近發現了windows-rs框架,並一直在尋找通過實現其ICredentialProvider COM 接口在 Rust 中構建一個Windows Credential Provider 。 我一直在使用在現有問題之一下匯總的信息進行概念驗證實施,但我不確定如何實際公開已編譯的 rust 作為正 ...
[英]Convert *mut c_void to HWND
我正在嘗試將 *mut c_void 轉換為 HWND ( https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Foundation/struct.HWND.html ) 但它一直拋出此錯誤: 我怎樣才能安全地將 *mut c ...
[英]Can you make a Windows desktop app in Rust and winapi?
我有一個帶有用 Rust 和 winapi 編寫的 GUI 的 Windows 應用程序。 盡管它有 GUI,但它的行為就像一個控制台應用程序。 啟動exe文件時,會彈出Command Prompt窗口,並從中運行應用程序。 這不是我想要的; 應該打開一個主窗口,就像在所有真正的桌面應用程序中一樣 ...
[英]DescribePixelFormat from windows crate always returns 0 when given PixelFormat to fill with "parameter is incorrect" (error 87)
我正在嘗試使用 windows 板條箱來設置和獲取 window 的像素格式描述符。當我將 None 傳遞給 PPFD 參數時,返回值是合理的(似乎是最大像素格式索引)。 但是,當我嘗試向它傳遞一個指向要填充的 PFD 的指針以便我可以檢查 SetPixelFormat 調用后的實際結果是什么時, ...
[英]Error trying to pass a LPARAM when going through windows
我正在嘗試 go 通過所有 windows(使用 Windows API)並獲取 windows 的列表,但是當我嘗試將向量作為LPARAM傳遞時,我收到錯誤消息: 非原始類型轉換:*mut Vec<isize> as LPARAM as 表達式只能用於原始類型之間的轉換或強制轉換為特定 ...
[英]Error while trying to get PID with FindWindowA and GetWindowThreadProcessId
我正在嘗試使用 Windows 板條箱以及 FindWindowA 和 GetWindowThreadProcessId 函數獲取 rust 中程序的 PID。 我的問題是 GetWindowThreadProcessId 失敗並出現錯誤 1400。 ...
[英]How to get IAudioSessionControl2 in windows-rs?
我正在嘗試在 Rust 中編寫類似mute.fm的程序,這是我使用 rust 和 winapi 的第一個大項目。 我設法獲得IAudioSessionControl ,但它不包含進程 ID 或名稱,因此無法知道它是哪個應用程序。 IAudioSessionControl2有一個GetProces ...
[英]How to use HANDLE from windows-rs and rust
我試圖在std::fs:File上調用LockFileEx並掙扎,因為類型HANDLE有多種實現: 我目前的嘗試如下:fn unsafe lock(file: &mut File) -> BOOL { let mut overlapped = std::mem::zeroed ...
[英]Get path to selected files in active explorer window
我正在嘗試獲取在當前活動的資源管理器 window 中選擇的文件的路徑。 類似於 c# 中的示例或python 中的示例。 在網上我發現,你可以用windows-rs用win32做事。 但我只設法編寫以下代碼: 使用此代碼,我仍然遇到問題,即我只能從 rust exe 獲取路徑,而所有其他程序 o ...
[英]Why should I initialize struct members even if it shouldn't be initialized?
我切換到 Rust 因為我喜歡它的語法。 但是,由於以下原因,我無法完成我的項目: 我有一個結構,它有一個方法應該用於創建我的結構的新實例,並且該結構使用一些外部板條箱( windows板條箱),但我無法使用任何其他結構,因為我需要初始化每個我使用的結構。 例如: 這些結構不應在 C++ wina ...