Questions tagged [windows-rs]

Use this tag for questions specific to the Rust for Windows crate.

Rust for Windows is Microsoft's library providing wrappers for the Win32, COM, and WinRT API surfaces.

36 questions
0
votes
1 answer

Why does a LoadCursorA call give a build error?

Why does a LoadCursorA generate 'trait implementation' build errors when a LoadCursorW call does not when using the rust Crate for Windows? #[allow(dead_code)] use windows::Win32::UI::WindowsAndMessaging::LoadCursorA; use…
MRahilly
  • 25
  • 3
0
votes
1 answer

Using IUIAutomationFocusChangedEventHandler interface in windows-rs

I am trying to use IUIAutomation::AddFocusChangedEventHandler using the official windows-rs crate, but in order to use it I need to implement the IUIAutomationFocusChangedEventHandler interface, which I am at a lose on how to do in rust It seems…
0
votes
0 answers

Proper handling of LPWSTR output in windows-rs

I noticed there are two ways of handling LPWSTR output types in the windows-rs crate; Both start with marshalling the string into a slice: let len = (0..).take_while(|&i| *ptr.offset(i) != 0).count(); let slice = std::slice::from_raw_parts(ptr,…
Dragoon
  • 723
  • 6
  • 13
-1
votes
1 answer

Error while trying to get PID with FindWindowA and GetWindowThreadProcessId

I'm trying to get the PID of a program in rust using the Windows crate, with the FindWindowA and GetWindowThreadProcessId functions. My problem is that GetWindowThreadProcessId fails with error 1400. fn main(){ unsafe{ let process_name:…
johnsc
  • 21
  • 5
-1
votes
2 answers

How to find a CLSID in rust for windows?

I'm using rust for windows to use the win32 API. However, I need to initialize com library to use some windows APIs, but I cannot find some classes ID (CLSID), to create an instance. I need to find the Speech ISpVoice CLSID to use in my instance…
-2
votes
1 answer

What does the error message "required by a bound in this" mean?

I have the following code: use bindings::Windows::Win32::DisplayDevices::POINT; use bindings::Windows::Win32::Gdi::{GetPixel, GetWindowDC, HDC}; use bindings::Windows::Win32::SystemServices::{BOOL, PSTR}; use…
1 2
3