Dear All Friends,

I hope to post a question on manipulating multiple forms.

My application has a main window and several smaller toolwindows like the look of Photoshop.

I have used the function (suggested by a nice member in the forum):

**********************************************************
In Genral Declaration:
______________________
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

In MDIForm_Load:
________________
frmToolbox1.Show
SetWindowPos frmToolbox1.hwnd, -1, 0, 0, 0, 0, 3

:
:
etc

**********************************************************

to display the toolwindow forms on top of the main form.


When I switch from my application to another like a browser by clicking the tab on the taskbar, the toolwindows still display on top of the another application. This is very misleading and inconvenient to the users.

If I want the toolwindows display only when my application main window is displayed / on focus, how can I achieve this?

Thank you very much for your help.