|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Owned On VistaIn a VB6 app that i am always working on, I found a strange difference
between XP and Vista (both latest SP). I used the API to set Owner vs non-Owner. On Vista, when set to Owned, the main form contains the child form such that the bounds that the child form can be moved is the main form. Maybe not the right terminology. As i move the child form, the child form moves freely but when moving to the right, the right edge of the child form disapears at the right edge of the main form. Like it is inside the main form. On XP there is no restriction and the child moves outside the main form. How is it supposed to work? Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Show quote
Hide quote
"BeeJ" <nospam@nospam.com> wrote in message I'm not sure exactly what you're after, or whether you are perhaps confusing news:i4l5s2$o89$1@speranza.aioe.org... > In a VB6 app that i am always working on, I found a strange > difference between XP and Vista (both latest SP). On Vista, > when set to Owned, the main form contains the child form > such that the bounds that the child form can be moved is the > main form. Maybe not the right terminology. As i move the > child form, the child form moves freely but when moving to > the right, the right edge of the child form disapears at the > right edge of the main form. Like it is inside the main form. > On XP there is no restriction and the child moves outside > the main form. How is it supposed to work? > Private Declare Function SetParent Lib "user32.dll" (ByVal > hWndChild As Long, ByVal hWndNewParent As Long) ... "parent" with "owner", but you can set the owner of a Form using the ownerform parameter of the Show method, as in: Form2.Show , Form1 Alternatively, you can use SetWindowLong to do it, as in: SetWindowLong Form2.hwnd, GWL_HWNDPARENT, Form1.hwnd Although the constant is called GWL_HWNDPARENT it actually sets the owner (or at least it does in my own experience). Mike It happens that Mike Williams formulated :
> Although the constant is called GWL_HWNDPARENT it actually sets the owner (or Yeah, and if that ain't the *most* perversely named constant in the > at least it does in my own experience). SDK... <mumble>
Show quote
Hide quote
"BeeJ" <nospam@nospam.com> wrote in message SetParent sets the forms parent, not it's owner. Parented windows are news:i4l5s2$o89$1@speranza.aioe.org... > In a VB6 app that i am always working on, I found a strange difference > between XP and Vista (both latest SP). > I used the API to set Owner vs non-Owner. > On Vista, when set to Owned, the main form contains the child form such > that the bounds that the child form can be moved is the main form. > Maybe not the right terminology. As i move the child form, the child form > moves freely but when moving to the right, the right edge of the child > form disapears at the right edge of the main form. Like it is inside the > main form. > On XP there is no restriction and the child moves outside the main form. > > How is it supposed to work? > > Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As > Long, ByVal hWndNewParent As Long) As Long contained within, like controls or MDI Childs. Owned windows are on top of their owners. To set owner you can use SetWindowLong. hwdPreviousOwner = SetWindowLong(HwndtoUse, GWL_HWNDPARENT, HwndofOwner) David "BeeJ" <nospam@nospam.com> wrote in message Actually, although your question has already been answered, I'm not news:i4l5s2$o89$1@speranza.aioe.org... > In a VB6 app that i am always working on, I found a > strange difference between XP and Vista (both latest SP). surprised that you found strange differences between the behaviour of Windows XP and Windows Vista. There are also strange differences between the behaviour of Vista and Win7 at the operating system level, odd things that are caused by sloppy programming and that you would not expect to happen. It seems that in Micro$oft's greedy pursuit of profits they regularly replace one bunch of crap with another new bunch of crap, never standing still long enough to consolidate on what they have already got and to make it work properly. In Win7, for example, (at least on the machines I have used) if you have a folder full of lots other folders and if it is set to list view and if the last visible column of folder names in the window is anything other than fully displayed then you cannot double click on one of those folders in the rightmost column to open it. That's because the first click causes the OS to immediately scroll the window contents to the left, so that the rightmost column moves left by one column width to become fully visible, which causes a new and different column of folders to become the new rightmost column, and then your second click of the double click operation causes that new rightmost column in turn to move to the left. The result is that the folder view moves two columns to the left, and your double click does not open anything at all, and the folder you originally intended to open has often disappeared off the window completely! In order to properly double click a folder under such circumstances you have to mess about to make sure you avoid those problems. I haven't yet checked whether you can cure that problem by messing about with various other settings, but that is certainly the default behaviour and it sucks! That is just sloppy programming! In fact it is what I would expect if they had allowed their crazy and deranged monkey of a CEO to write the code! http://www.youtube.com/watch?v=Nc4MzqBFxZE Mike
Show quote
Hide quote
"BeeJ" <nospam@nospam.com> wrote in message Look for ClipControls property or WS_CLIPCHILDREN style.news:i4l5s2$o89$1@speranza.aioe.org... > In a VB6 app that i am always working on, I found a strange difference > between XP and Vista (both latest SP). > I used the API to set Owner vs non-Owner. > On Vista, when set to Owned, the main form contains the child form such > that the bounds that the child form can be moved is the main form. > Maybe not the right terminology. As i move the child form, the child form > moves freely but when moving to the right, the right edge of the child > form disapears at the right edge of the main form. Like it is inside the > main form. > On XP there is no restriction and the child moves outside the main form. > > How is it supposed to work? > > Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As > Long, ByVal hWndNewParent As Long) As Long "Nobody" <nob***@nobody.com> wrote in message Are you sure about that, Nobody? ClipControls determines how drawings are news:i4m41e$ddu$1@speranza.aioe.org... >> "BeeJ" <nospam@nospam.com> wrote in message How is it supposed to work? >> Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild >> As Long, ByVal hWndNewParent As Long) As Long > > Look for ClipControls property or WS_CLIPCHILDREN style. made to the Form or PictureBox or whatever, specifically determining whether or not VB creates a clipping region around the contained controls, and therefore determining whether or not drawings go over the top of Controls and are therefore visible over them. or whether they treat the control areas as a "hole" in the drawing surface. Mike
Can we use Shell to write file properties
VB6 support and beyond How to manage a large dictionary of words? Re: How to get the File Properties Latest VB6 Cumulative Update? Callback function Managing Remote Access Database WebCAM Support Flash 10 Control Problem with VB6 Best Approach (psuedocode) for summing structure element values |
|||||||||||||||||||||||