Guest User

Untitled

a guest
Apr 15th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. use NativeCall;
  2.  
  3. enum EnumHWND (
  4. NULL => 0
  5. );
  6.  
  7. enum EnumMessageBox (
  8. MB_CANCELTRYCONTINUE => 0x00000006,
  9. MB_HELP => 0x00004000,
  10. MB_OK => 0x00000000,
  11. MB_OKCANCEL => 0x00000001,
  12. MB_RETRYCANCEL => 0x00000005,
  13. MB_YESNO => 0x00000004,
  14. MB_YESNOCANCEL => 0x00000003,
  15. );
  16.  
  17.  
  18. class HWND is repr('CPointer') {
  19. sub new (Int $a) { $a }
  20. }
  21.  
  22. sub MessageBoxA(HWND, Str, Str, int32)
  23. returns int32
  24. is native('user32')
  25. { * }
  26.  
  27.  
  28. say MessageBoxA(HWND.new(NULL), "We can haz NCI?", "oh lol", MB_YESNO);
  29.  
  30.  
  31. Default constructor for 'HWND' only takes named arguments
  32. in block <unit> at a.pl line 28
Advertisement
Add Comment
Please, Sign In to add comment