VRuby/Win32 Question

Discussion in 'Ruby' started by Steve Tuckner, Sep 25, 2003.

  1. This is a multi-part message in MIME format.

    ------=_NextPart_000_0126_01C3834F.594401B0
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit

    I am trying to bring a VRuby app to be the front most window. I try the
    following but it doesn't work. Any ideas of what to try next would be
    appreciated:

    bringWindowToTop = Win32API.new("user32", "BringWindowToTop", ["L"],
    "L")
    bringWindowToTop.Call(self.hWnd)

    I have also tried ["P"] for the argument with no effect. When I inspect
    self.hWnd it is a Fixnum with a large number in it. I used Spy++ to
    check the window handle and it matched. I also thought of trying hParent
    but that didn't work as hParent is zero.

    Thanks in advance,

    Steve Tuckner



    ------=_NextPart_000_0126_01C3834F.594401B0
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>



    <META content=3D"MSHTML 6.00.2730.1700" name=3DGENERATOR></HEAD>
    <BODY>
    <DIV><SPAN class=3D230580015-25092003><FONT face=3DArial size=3D2>I am =
    trying to bring=20
    a VRuby app to be&nbsp; the front most window. I try the following but =
    it=20
    doesn't work. Any ideas&nbsp;of what to try next would be=20
    appreciated:</FONT></SPAN></DIV>
    <DIV><SPAN class=3D230580015-25092003><FONT face=3DArial=20
    size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=3D230580015-25092003><FONT face=3DArial =
    size=3D2>bringWindowToTop =3D=20
    Win32API.new("user32", "BringWindowToTop", ["L"],=20
    "L")&nbsp;<BR>bringWindowToTop.Call(self.hWnd)<BR></FONT></SPAN></DIV>
    <DIV><SPAN class=3D230580015-25092003><FONT face=3DArial size=3D2>I =
    have also tried=20
    ["P"] for the argument with no effect. When I inspect self.hWnd it is a =
    Fixnum=20
    with a large number in it. I used Spy++ to check the window handle and =
    it=20
    matched. I also thought of trying hParent but that didn't work as =
    hParent is=20
    zero.</FONT></SPAN></DIV>
    <DIV><SPAN class=3D230580015-25092003><FONT face=3DArial=20
    size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=3D230580015-25092003><FONT face=3DArial =
    size=3D2>Thanks in=20
    advance,</DIV></FONT></SPAN>
    <P><FONT face=3DArial size=3D2>Steve Tuckner</FONT> =
    <BR></P></BODY></HTML>

    ------=_NextPart_000_0126_01C3834F.594401B0--
    Steve Tuckner, Sep 25, 2003
    #1
    1. Advertising

  2. Steve Tuckner

    Eric Landuyt Guest

    > I am trying to bring a VRuby app to be the front most window. I try the
    following but it doesn't work. Any ideas of what to try next would be
    appreciated:
    >
    > bringWindowToTop = Win32API.new("user32", "BringWindowToTop", ["L"], "L")
    > bringWindowToTop.Call(self.hWnd)
    >
    > I have also tried ["P"] for the argument with no effect. When I inspect

    self.hWnd it is a Fixnum with a large number in it. I used Spy++ to check
    the window handle and it > matched. I also thought of trying hParent but
    that didn't work as hParent is zero.

    I suppose you want to code something similar to the "window always on top"
    setting
    available in various applications.

    For this, use SetWindowPos() in place of BringWindowToTop().
    Try to convert the following C code to Ruby (using Win32API):

    SetWindowPosl(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE)

    To disable the "always on top" feature:

    SetWindowPosl(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE)

    (see
    http://msdn.microsoft.com/library/d...dowReference/WindowFunctions/SetWindowPos.asp
    for more details about this function)

    Eric Landuyt
    Eric Landuyt, Sep 25, 2003
    #2
    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. Iki

    VRuby and Timeout

    Iki, Nov 7, 2003, in forum: Ruby
    Replies:
    0
    Views:
    82
  2. Armin Roehrl
    Replies:
    0
    Views:
    98
    Armin Roehrl
    Feb 9, 2004
  3. Esad Hajdarevic

    vruby question

    Esad Hajdarevic, Sep 29, 2006, in forum: Ruby
    Replies:
    3
    Views:
    135
    Steve Tuckner
    Sep 29, 2006
  4. Domenic Padula

    VRuby tabstop question

    Domenic Padula, Sep 29, 2006, in forum: Ruby
    Replies:
    3
    Views:
    115
    Domenic P.
    Oct 12, 2006
  5. Replies:
    6
    Views:
    118
Loading...

Share This Page