Mouse position: Difference between revisions

Content added Content deleted
m (→‎{{header|Rust}}: Update to Rust 0.9)
Line 653:
Prints current location of the mouse cursor relative to any active window.
This example relies on the Windows API.
<lang Rust>// rustrustc 0.9 (7613b15 2014-01-08 18:04:43 -pre0800)
 
use std::libc::types::os::arch::extra::{BOOL, HANDLE, LONG};
use std::ptr::mut_null;
 
type LONG = i32;
type HWND = HANDLE;
 
Line 669 ⟶ 668:
#[link_name = "user32"]
extern "system" {
pub fn GetCursorPos(lpPoint:&mut POINT) -> BOOL;
pub fn GetForegroundWindow() -> HWND;
pub fn ScreenToClient(hWnd:HWND, lpPoint:&mut POINT);
}