Mouse position: Difference between revisions

→‎{{header|Rust}}: Update to current Rust 0.9-pre syntax
(→‎{{header|Rust}}: Update to current Rust 0.9-pre syntax)
Line 586:
}
 
#[link_argslink_name = "-luser32user32"]
extern "stdcallsystem" {
pub fn GetCursorPos(lpPoint:&mut POINT) -> BOOL;
pub fn GetForegroundWindow() -> HWND;
Line 593:
}
 
#[fixed_stack_segment]
fn main() {
let mut pt = POINT{x:0, y:0};
Line 604 ⟶ 603:
let h = unsafe { GetForegroundWindow() };
if h == mut_null() { continue }
 
let mut ptc = pt;
unsafelet {mut ScreenToClient(h, &mutpt_client ptc)= }pt;
println!("x:unsafe {}, y: {}"ScreenToClient(h, ptc.x,&mut ptc.ypt_client) };
println!("x: {}, y: {}", pt_client.x, pt_client.y);
}
}