#[cfg(feature = "std")]
use thiserror::Error;
#[cfg_attr(feature = "std", derive(Error))]
#[cfg_attr(not(feature = "std"), derive(Debug, Clone, PartialEq))]
#[derive(Debug, Clone, PartialEq)]
pub enum WindowsUtilsError {
#[cfg_attr(feature = "std", error("Invalid coordinates: ({x}, {y})"))]
InvalidCoordinates {
x: i32,
y: i32,
},
#[cfg_attr(feature = "std", error("Point ({x}, {y}) is outside window bounds"))]
OutOfBounds {
x: i32,
y: i32,
},
#[cfg_attr(feature = "std", error("Invalid window handle: {handle}"))]
InvalidWindowHandle {
handle: isize,
},
#[cfg_attr(feature = "std", error("Invalid message parameter: {parameter}"))]
InvalidMessageParameter {
parameter: &'static str, },
#[cfg_attr(feature = "std", error("Unsupported message type: 0x{message:x}"))]
UnsupportedMessage {
message: u32,
},
#[cfg_attr(feature = "std", error("Required feature not enabled: {feature}"))]
FeatureNotEnabled {
feature: &'static str,
},
}
pub type WindowsUtilsResult<T> = Result<T, WindowsUtilsError>;