Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Mon, 7 Jul 2008 10:50:07 -0700,    group: microsoft.public.win32.programmer.ui        back       


Problems with owner/owned windows.   
I’m attempting to use the concept of window ownership and I’m having a few 
problems.

To my understanding, a top-level window can specify another top-level window 
as its owner. The owned window will then always be in front of the owner 
window in the z-order, and the owned window will be hidden/shown when the 
owner window is minimized/maximized.

This is the behavior that I desire and it works well.

The problems I’m having are the following:

1.)	If the owner window happens to be minimized at the moment that the owned 
window is first created and the ownership is established, then the UI ends up 
in a strange state. The owned window appears as initially visible even though 
the owner is minimized. Furthermore, clicking on the owner window’s button on 
the task bar will not restore the owner window; it will only flash the owned 
window. The owner window only becomes accessible again after I close the 
owned window.

2.)	Whenever the owned window is closed, the owner window jumps to the back 
of the z-order behind all other top-level windows on the desktop.

For problem #1, I’ve tried using a little workaround where I always make 
sure that the owner window is fully restored and visible prior to creating 
the owned window. This seems to work, but I’d like to not have to do this.

For problem #2, I’ve been able to get around this by breaking the ownership 
link in the owned window’s OnClose() handler just prior to closing. Once 
again, this seems kind of dirty and I’d rather not do it.

Does anyone have any thoughts on this? It seems like window ownership is not 
used very frequently and I’ve been unable to find too much information about 
it online. Any help is appreciated.

Thanks.
date: Mon, 7 Jul 2008 10:50:07 -0700   author:   Doug E. Codemonger

Re: Problems with owner/owned windows.   
You are probably not only having owned windows, but modal dialogs.
Search Raymond Chen's blog Old New Thing (which is must read for Win32
programmers anyway) for EnableWindow. #1 is likely caused by the owner
window being disabled. #2 I don't know.

Arno
date: Fri, 11 Jul 2008 14:41:42 -0700 (PDT)   author:   Arno

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us