Guest User

Untitled

a guest
Oct 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. // Module MyHWND
  2.  
  3. static WINDOW : Option<MyHWND> = None;
  4.  
  5. fn get_window() -> MyHWND {
  6. match WINDOW {
  7. None => panic!("This should never happen")
  8. Some(foo) => foo
  9. }
  10. }
  11.  
  12. struct MyHWND {
  13. handle: HWND;
  14. }
  15.  
  16. impl Send for MyHWND;
  17. impl Sync for MyHWND;
  18.  
  19. impl Debug for MyHWND {
  20.  
  21. }
  22.  
  23. impl MyHWND {
  24. fn get(&self) -> HWND {
  25. handle
  26. }
  27. }
  28.  
  29. // Module Main
  30.  
  31. let foo: MyHWND = winapi::getWindowHandle()
Add Comment
Please, Sign In to add comment