From: Emmanuel Touzery Date: 2004-01-20T15:52:25+09:00 Subject: Re: ruby/dl or win32API win32 help? --------------030401030703040909080606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------030401030703040909080606 Content-Type: text/plain; name="top2.rb" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="top2.rb" #! /usr/bin/env ruby require "fox" include Fox HWND_TOPMOST = -1 HWND_NOTOPMOST = -2 SWP_NOSIZE = 1 SWP_NOMOVE = 2 SWP_SHOWWINDOW = 64 require 'Win32API' # # inspired by http://www.ruby-talk.org/cgi-bin/vframe.rb/ruby/ruby-talk/82992?82958-83286+split-mode-vertical class FXTestMainWindow < FXMainWindow def initialize(app) super(app, "Test", nil, nil, DECOR_ALL, 0, 0, 350, 280 ) @text = FXText.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP) end def setOnTop() setWindowPos = Win32API.new('user32', 'SetWindowPos', ["P", "P", "I", "I", "I", "I", "I"], "I") setWindowPos.call(xid, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE) end end # Stand alone run if __FILE__ == $0 application = FXApp.new("Test", "ruby") application.init(ARGV) window = FXTestMainWindow.new(application) application.create window.show(PLACEMENT_SCREEN) window.setOnTop() application.run end --------------030401030703040909080606--