diff --git a/src/events.rs b/src/events.rs index f42d8aac..332867ad 100644 --- a/src/events.rs +++ b/src/events.rs @@ -7,6 +7,9 @@ pub enum Event { /// The size of the window has changed. SizeChanged(uint, uint), + /// The position of the window has changed. + Moved(uint, uint), + /// The window has been closed. Closed, diff --git a/src/win32/ffi.rs b/src/win32/ffi.rs index 96f09d41..8ff7c432 100644 --- a/src/win32/ffi.rs +++ b/src/win32/ffi.rs @@ -309,6 +309,7 @@ pub static WM_KILLFOCUS: UINT = 0x0008; pub static WM_MBUTTONDOWN: UINT = 0x0207; pub static WM_MBUTTONUP: UINT = 0x0208; pub static WM_MOUSEMOVE: UINT = 0x0200; +pub static WM_MOVE: UINT = 0x0003; pub static WM_PAINT: UINT = 0x000F; pub static WM_RBUTTONDOWN: UINT = 0x0204; pub static WM_RBUTTONUP: UINT = 0x0205; diff --git a/src/win32/mod.rs b/src/win32/mod.rs index be6014e9..481436c5 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -299,6 +299,14 @@ extern "stdcall" fn callback(window: ffi::HWND, msg: ffi::UINT, 0 }, + ffi::WM_MOVE => { + use events::Moved; + let x = ffi::LOWORD(lparam as ffi::DWORD) as uint; + let y = ffi::HIWORD(lparam as ffi::DWORD) as uint; + send_event(window, Moved(x, y)); + 0 + }, + ffi::WM_CHAR => { use std::mem; use events::ReceivedCharacter;