Mercurial > pub > dyncall > bindings
view ruby/rbdc/examples/win32msgbox.rb @ 60:8e905c0798c7
- p2Z() helper func
- import fix for test code avoiding potential circular import
author | Tassilo Philipp |
---|---|
date | Wed, 03 Aug 2022 15:38:07 +0200 |
parents | 5e159be89d73 |
children |
line wrap: on
line source
#////////////////////////////////////////////////////////////////////// # # win32msgbox.rb # Copyright 2007-2015 Tassilo Philipp # # Dyncall sample loading user32.dll on windows, listing all user32 # symbols and displaying a # native windows message box by calling # MessageBoxA(...). # #/////////////////////////////////////////////////////////////////////// require 'rbdc' l = Dyncall::ExtLib.new if l.load('user32') != nil and l.syms_init('user32') l.syms_each { |s| puts s } puts l.syms_count puts l.exists?(:NonExistant) puts l.exists?(:MessageBoxA) puts l.call(:MessageBoxA, 'IZZI)i', 0, 'Hello world from dyncall!', 'dyncall demo', 0) # @@@ check puts on dyncall called function returning a void... crashes e.g. change above signature to IZZI)v end