This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace winrt; | |
using namespace Windows::Foundation; | |
struct Base: implements<Base, composable, IStringable> | |
{ | |
static IInspectable CreateInstance(IInspectable const& base, IInspectable& inner) | |
{ | |
return impl::composable_factory<Base>::CreateInstance<IInspectable>(base, inner); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D:\git\scratch10>type src\main.rs | |
use windows_sys::{core::*, Win32::System::LibraryLoader::*}; | |
fn main() { | |
unsafe { | |
let module = LoadLibraryExW( | |
w!("api-ms-win-core-com-l1-1-3.dll"), | |
core::ptr::null_mut(), | |
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use windows_core::*; | |
#[interface("1bd72b4b-8d05-44c6-8909-da3e0e91afa0")] | |
unsafe trait IDebug: IUnknown { | |
fn debug_carrot(&self, carrot: Ref<ICarrot>) -> Result<()>; | |
fn debug_pear(&self, pear: Ref<IPear>) -> Result<()>; | |
} | |
#[interface("3bde3f9e-4d7c-4d5f-8322-4b226e0e1b91")] | |
unsafe trait ICarrot: IUnknown { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use windows::{core::*, Win32::Storage::FileSystem::*}; | |
fn search_path(filename: &str) -> Result<String> { | |
let filename = &HSTRING::from(filename); | |
let len = unsafe { SearchPathW(None, filename, None, None, None) }; | |
if len == 0 { | |
return Err(Error::from_win32()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use windows::core::*; | |
use windows::Win32::System::Com::*; | |
use windows::Win32::UI::Accessibility::*; | |
use windows::Win32::UI::WindowsAndMessaging::*; | |
fn main() -> Result<()> { | |
unsafe { | |
let mut acc: Option<IAccessible> = None; | |
AccessibleObjectFromWindow( | |
GetDesktopWindow(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dependencies.windows] | |
version = "0.52" | |
features = [ | |
"Win32_Foundation", | |
"Win32_System_LibraryLoader", | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dependencies.windows] | |
version = "0.51" | |
features = ["Win32_Foundation", "Win32_System_SystemInformation", "Wdk_System_SystemServices"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pch.h" | |
using namespace winrt; | |
using namespace Windows::Foundation; | |
IAsyncAction Sample() | |
{ | |
throw winrt::hresult_invalid_argument(L"yolo"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(non_snake_case)] | |
use windows::{core::*, Win32::Foundation::*}; | |
#[interface("17f409a1-f79d-45f6-962d-9db106cb7727")] | |
unsafe trait ICompositor: IUnknown { | |
unsafe fn CreateVisual(&self, value: u32, visual: *mut Option<IVisual>) -> HRESULT; | |
unsafe fn RenderVisual(&self, visual: std::mem::ManuallyDrop<Option<IVisual>>) -> HRESULT; | |
} | |
#[interface("34e49797-1302-4ad6-8975-dd7c5b286e72")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dependencies.windows] | |
version = "0.51" | |
features = [ | |
"implement", | |
"Win32_Foundation", | |
] |
NewerOlder