Advertisement
Guest User

Untitled

a guest
Jan 11th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.58 KB | None | 0 0
  1. use NativeCall;
  2.  
  3. class WindowClass is repr('CStruct') {
  4.     has uint32 $.style;
  5.     has &.lpfnWndProc(OpaquePointer, uint32, uint32, uint32);
  6.     has int32 $.cbClsExtra;
  7.     has int32 $.cbWndExtra;
  8.     has OpaquePointer $.hInstance;
  9.     has OpaquePointer $.hIcon;
  10.     has OpaquePointer $.hCursor;
  11.     has OpaquePointer $.hbrBackground;
  12.     has Pointer[int16] $.lpszMenuName;
  13.     has Pointer[int16] $.lpszClassName;
  14.    
  15.     sub RegisterClass(WindowClass) returns int32 is native('user32') is symbol('RegisterClassW') { * }
  16.    
  17.     method Register() { RegisterClass(self) }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement