Ruby/dl or win32API win32 help?

Hello,

I'm trying to make a FXRuby "always on top" on win32 using ruby/dl. 

i use ruby/dl only because it seems easier to use than win32API, but if
someone has a solution using win32API, i’d be delighted to get it, too :O)
Anyway, for now it’s a no-go. I connected also SetForegroundWindow()
to see if it works and this one seems to work. If i call
SetForegroundWindow with the wrong window Id, i loose the focus. if i
give the right window id, i keep the focus. Seems good. But
SetWindowPos(), that should set it always on top, doesn’t seem to work.

Based on 

http://www.ruby-talk.org/cgi-bin/vframe.rb/ruby/ruby-talk/82992?82958-83286+split-mode-vertical
and other documents, it seems SetWindowPos is the win32 API to call to
get “always on top” windows.

I attach the ruby script.. you can replace eg
  User32.setForegroundWindow(xid)

by
User32.setForegroundWindow(id)
and you’ll see that the window looses the focus as you type (id means
nothing to windows), which seems to prove it’s at least a bit working :O)

emmanuel

top.rb (1.12 KB)

Hello,

If someone is interested, I actually succeeded in making a "always 

on top" windows in ruby. In the end, i used win32api, and it worked fine :O)
thanks to Hal Fulton for his short doc in “the ruby way” :O)

attached, FWIW.

emmanuel

top2.rb (932 Bytes)