Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 6, 1997

Minimizing All Windows In Win95

In Windows 95, only the VB windows with the property ShowInTaskbar set to True are minimized if you select Minimize All Windows from the task bar context menu. This is the way Win95 handles the window class. Forms with ShowInTaskbar=False work like property pages. You can easily demonstrate this. Bring up the Display properties dialog from the control panel or by right-clicking on the desktop. Do a Minimize All. The property page remains. If Win95 were to minimize the window, it would sit on top of the task bar, not in it. Win95 provides this functionality, while VB4 just sets the bit. The way that standard Win95 applications handle this is by having a main window that shows in the taskbar. All auxiliary windows are owned by the main window. When an owner window is minimized, owned windows will hide, not minimize. You can use code to make a VB window be owned by another VB window, but there are implications to this solution. Owned windows are always on top of the owner window. On form load of each child window, do a GetWindow API call, using GW_OWNER on the form's window handle (hwnd) to get the original owner window handle. Save this value for later use. Proceed to make the subwindow "owned by" the main window by calling SetWindowLong, like this:
 iret = SetWindowLong(Form2.hwnd, _
GWL_HWNDPARENT, _
Form1.hwnd)
On form unload of the main window restore all remaining (owned) subwindows back to being owned by their original owner window. Otherwise, you may get an Invalid Page Fault error.
A. Nicklas
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date