1. Win32 Lib, moving windows
- Posted by Agent Spectre <Email at SPECTRESOFTWARE.CO.UK> Apr 18, 2000
- 470 views
- Last edited Apr 19, 2000
------=_NextPart_000_0008_01BFA97E.359CB8A0 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable How can I tell if a window has been moved using the win32lib?=20 Example, I have an application that uses two windows, and want them to = stay "locked" a certain distance apart. ------=_NextPart_000_0008_01BFA97E.359CB8A0 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Dwindows-1252" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2722.2800" name=3DGENERATOR></HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT size=3D2>How can I tell if a window has been moved using the = win32lib?=20 </FONT></DIV> <DIV><FONT size=3D2>Example, I have an application that uses two = windows, and want=20 them to stay "locked" a certain distance = ------=_NextPart_000_0008_01BFA97E.359CB8A0--
2. Re: Win32 Lib, moving windows
- Posted by Kat <gertie at ZEBRA.NET> Apr 18, 2000
- 467 views
----- Original Message ----- From: "Agent Spectre" <Email at SPECTRESOFTWARE.CO.UK> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Tuesday, April 18, 2000 3:36 PM Subject: Win32 Lib, moving windows >How can I tell if a window has been moved using the win32lib? >Example, I have an application that uses two windows, and want them to stay "locked" a >certain distance apart. Just playing devils' advocate here for a second, not sniping at you..... What if the screen is resized? What if one of the screens is closed, what does the other one do? How about what happens if you fix everything, and the user changes the available system fonts out from under you? I'd suggest you launch *one* window, with fixed child windows inside the parent, making the parent window transparent, maybe. Setting the child windows to locked inside the parent, and visable only if the parent is visable, and making both child windows visable if the parent is active. But i am *very* far from a windoze expert, and have no idea how to do that. But it does sound pretty restrictive to me. Have you considered just making them both popup relative to each other and thereafter let the user move them to their liking? One of the *many* reasons i don't use ICQ is the way it takes over the desktop at times, it's not a good user interface. Kat
3. Re: Win32 Lib, moving windows
- Posted by Brian Broker <bkb at CNW.COM> Apr 18, 2000
- 497 views
On Tue, 18 Apr 2000 21:36:51 +0100, Agent Spectre wrote: >How can I tell if a window has been moved using the win32lib? >Example, I have an application that uses two windows, and want them to >stay "locked" a certain distance apart. One way to do it is by using "onEvent". Here is a quick demo: (note, you'll need to do a bit more work because the lParam returns x/y coordinates of the Window's client, not the window itself. [see notes below code demo] ) -- start demo -- include win32lib.ew constant Win1 = create( Window, "Main Window", 0, Default, Default, 100, 100, 0 ), Win2 = create( Window, "Another Window", Win1, Default, Default, 100, 100, 0 ) procedure onEvent_Win1( atom event, atom wParam, atom lParam ) integer x, y if event = WM_MOVE then x = and_bits( lParam, #0000FFFF ) -- low bits y = and_bits( lParam, #FFFF0000 ) / #10000 -- high bits moveWindow( Win2, x + 100, y, 100, 100, True ) end if end procedure onEvent[Win1] = routine_id( "onEvent_Win1" ) procedure onOpen_Win1() openWindow( Win2, Normal ) end procedure onOpen[Win1] = routine_id( "onOpen_Win1" ) WinMain( Win1, Normal ) -- end demo -- about WM_MOVE: The WM_MOVE message is sent after a window has been moved. WM_MOVE xPos = (int)(short) LOWORD(lParam); // horizontal position yPos = (int)(short) HIWORD(lParam); // vertical position Parameters: xPos: Value of the low-order word of lParam. Specifies the x-coordinate of the upper-left corner of the client area of the window. yPos: Value of the high-order word of lParam. Specifies the y-coordinate of the upper-left corner of the client area of the window. Return Values: If an application processes this message, it should return zero. Remarks: The xPos and yPos parameters are given in screen coordinates for overlapped and pop-up windows and in parent-client coordinates for child windows. An application can use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure. -- Brian
4. Re: Win32 Lib, moving windows
- Posted by Agent Spectre <Email at SPECTRESOFTWARE.CO.UK> Apr 18, 2000
- 470 views
- Last edited Apr 19, 2000
Why two windows like this? Because morfit requires a full window to itself, and overwrite almost all win32 controls in that window. -----Original Message----- From: Kat <gertie at ZEBRA.NET> To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU> Date: Tuesday, April 18, 2000 10:25 PM Subject: Re: Win32 Lib, moving windows >----- Original Message ----- >From: "Agent Spectre" <Email at SPECTRESOFTWARE.CO.UK> >To: <EUPHORIA at LISTSERV.MUOHIO.EDU> >Sent: Tuesday, April 18, 2000 3:36 PM >Subject: Win32 Lib, moving windows > > >>How can I tell if a window has been moved using the win32lib? >>Example, I have an application that uses two windows, and want them to stay >"locked" a >certain distance apart. > >Just playing devils' advocate here for a second, not sniping at you..... > >What if the screen is resized? What if one of the screens is closed, what >does the other one do? How about what happens if you fix everything, and the >user changes the available system fonts out from under you? > >I'd suggest you launch *one* window, with fixed child windows inside the >parent, making the parent window transparent, maybe. Setting the child >windows to locked inside the parent, and visable only if the parent is >visable, and making both child windows visable if the parent is active. But >i am *very* far from a windoze expert, and have no idea how to do that. But >it does sound pretty restrictive to me. Have you considered just making them >both popup relative to each other and thereafter let the user move them to >their liking? One of the *many* reasons i don't use ICQ is the way it takes >over the desktop at times, it's not a good user interface. > >Kat >