Re: how to change Z-orders of Windows

Tech-Archive recommends: Speed Up your PC by fixing your registry



Review the Show method in the VB6 Reference for details on specifying owner
forms.There is no need to use thE API.

BTW, SetWindowPos merely changes the z-order, not the ownership. The API is
SetParent. However, you do not need it for VB6 windows, as the Show method
already solves the problem.

"Cobalt" <xiaosongw2000@xxxxxxx> wrote in message
news:OPK2drsZGHA.4752@xxxxxxxxxxxxxxxxxxxxxxx
Hi,Everyone,I have a question about how to change Z-orders of Windows.
The question is discribed below in details:

Form2 is loaded in subroutine of Form1 :
Private Sub Form_Load()

Load form2 'it's vbModeless
End Sub

How can I realize that Form2 is always in front of Form1, whether Form2 is
overcasted by other programs or not.That is to say, Form2 is like to be
loaded in subroutine of Form1 by Form2.Show [vbModal],but Form1 can still
be clicked and make reponse to the clicking.

I think it may be a question of changing Z-orders of windows,but the API
function of SetWindowPos is the only one that I am familiar to in Z-order
operation. It's seem that more functions are needed besides SetWindowPos.
So,What shall I do?

Thanks a lot.

©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤
Bridge Eng.,Tongji Univ.,Shanghai,PRC
Cobalt
E-mail:xiaosongw2000@xxxxxxx
©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤


.



Relevant Pages

  • Re: how to change Z-orders of Windows
    ... The API is SetParent. ... Form2 is loaded in subroutine of Form1: ... I think it may be a question of changing Z-orders of windows,but the API function of SetWindowPos is the only one that I am familiar to in Z-order operation. ...
    (microsoft.public.vb.winapi)
  • Re: how to change Z-orders of Windows
    ... owner forms.There is no need to use thE API. ... BTW, SetWindowPos merely changes the z-order, not the ownership. ... Private Sub Form_Load ...
    (microsoft.public.vb.winapi)
  • Re: Combo box getting hidden
    ... The z-order can be changed by using SetWindowPos. ... (const CWnd * pInsertAfter, int x, int y, int cx, int cy, UINT flags) ... reason I would ever want to use the::SetWindowPos API. ... Just looking at the names alone makes it evident that in MFC it is the first parameter. ...
    (microsoft.public.vc.mfc)
  • Re: Combo box getting hidden
    ... The z-order can be changed by using SetWindowPos. ... It is not the second parameter to CWnd::SetWindowPos that determines the z-order, ... (const CWnd * pInsertAfter, int x, int y, int cx, int cy, UINT flags) ...
    (microsoft.public.vc.mfc)
  • Re: How to get m_hWnd in CDialog
    ... Reason i need to do this is because the z-order is off. ... The first statement does nothing except retrieve the 'this' pointer, ... Although SetWindowPos doesn't seem to do what i need it to. ...
    (microsoft.public.vc.mfc)