VRuby/Win32 Question

S

Steve Tuckner

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--
 
E

Eric Landuyt

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top