Ruby DL Setup to send and receive windows messages?

Discussion in 'Ruby' started by awertyui@gmail.com, May 2, 2005.

  1. Guest

    I am trying to send and receive messages between a ruby program and
    another program. The end goal is to be able to send a message to the
    other program to request data and the other program returns a message
    saying where the data file is using Atom tables. Could anyone point me
    in the right direction? I have been trying to use ruby dl but I never
    seem to set it up right with anyting more complicated than the sleep
    function. I always get this error "unexpected type 'W'" or one
    similar to it. Here is what I have been trying so far with no luck.


    require 'dl/import'
    require 'dl/struct'
    require 'dl/types'

    module Win32
    extend DL::Importable
    dlload 'user32.dll'

    typealias "WPARAM", "UINT"
    typealias "LPARAM", "UINT"

    POINT = struct [
    "ULONG x",
    "ULONG y"
    ]


    MSG = struct [
    "HWND hwnd",
    "UINT message",
    "WPARAM wParam",
    "LPARAM lParam",
    "DWORD time",
    "POINT pt"
    ]

    typealias "LPMSG","MSG*"
    extern 'BOOL PeekMessage(LPMSG,HWND,UINT,UINT,UINT)'
    extern 'UINT SendMessage(HWND,UINT,WPARAM,LPARAM)'


    end
    line = gets
    , May 2, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2Fscw==?=

    ASP.Net Receive HTTP-POST Messages

    =?Utf-8?B?S2Fscw==?=, May 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    984
    =?Utf-8?B?S2Fscw==?=
    May 25, 2004
  2. John
    Replies:
    0
    Views:
    487
  3. Replies:
    1
    Views:
    190
    Takaaki Tateishi
    May 3, 2005
  4. Mihael
    Replies:
    4
    Views:
    1,644
    Knute Johnson
    Mar 7, 2012
  5. Replies:
    1
    Views:
    103
    Gunnar Hjalmarsson
    Jun 27, 2007
Loading...

Share This Page