[Win32utils-devel] win32-clipboard and change_notify

Daniel Berger djberg96 at gmail.com
Thu Jan 9 16:41:05 UTC 2014


On Thu, Jan 9, 2014 at 8:10 AM, Heesob Park <phasis at gmail.com> wrote:

> Hi,
>
> 2014/1/9 Daniel Berger <djberg96 at gmail.com>:
> > Hi,
> >
> > I'm having a bit of trouble with converting one bit of the change_notify
> > code. The first time SetWindowLongPtr is called, it's passed a proc
> > (callback). The second time, it's passed an HWND, returned from
> > SetClipboardViewer.
> >
> > I'm not sure how to handle the function declaration or how to pass
> arguments
> > exactly. Is there a way to convert a Ruby proc directly into an FFI
> pointer?
> >
> I'm not sure what is your problem.
>
> WNDPROC type is  LRESULT (CALLBACK* WNDPROC) (HWND, UINT, WPARAM, LPARAM);
>
> wnd_proc could be translated as FFI::Function
> wnd_proc = FFI::Function.new(:void, [:pointer, :long, :long, :long,
> :long]) do |hwnd, umsg, wparam, lparam|
>
> end
>
> SetWindowLongPtr(handle, GWL_WNDPROC, wnd_proc.address)
>

Thanks, updated.

Cheers,

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20140109/d900eb8e/attachment.html>


More information about the win32utils-devel mailing list