Ruby win32 api interface

后端 未结 3 1467
囚心锁ツ
囚心锁ツ 2020-12-06 03:12

I need to access a few functions of the win32 library in ruby. I have found extremely sparse information on the Win32API class online, so I\'m asking here.

I know th

3条回答
  •  攒了一身酷
    2020-12-06 03:43

    SHAppBarMessage takes two parameters: a DWORD and a pointer to APPBARDATA,
    so it shuold be declared thus:

    app_bar_msg = Win32API.new('shell32', 'SHAppBarMessage', ['L', 'P'], 'L')

    then called:

    msg_id = 1
    app_bar_data = "properly initalized binary string" #should have sizeof(APPBARDATA) bytes
    app_bar_msg.call(msg_id, app_bar_data)

    But I don't know Ruby, so maybe I am mistaken...

提交回复
热议问题