Microsoft KB Archive/113251

= MULTICON Demonstrates Dynamic Icons =

Article ID: 113251

Article Last Modified on 8/9/2004

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 1.5 Professional Edition

 Microsoft Visual C++ 1.51

 Microsoft Visual C++ 1.52 Professional Edition

 Microsoft Visual C++ 1.0 Professional Edition</li></ul>

 Microsoft Visual C++ 4.1 Subscription</li></ul>

 Microsoft Visual C++ 2.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.1</li></ul>

 Microsoft Visual C++ 4.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q113251

<div class="summary_section">

SUMMARY
The MULTICON sample demonstrates how to implement dynamic icons for both CMDIChildWnd and CMDIFrameWnd windows. The procedure is to first register a window class with a NULL icon for the frame. A frame of this type receives WM_PAINT messages when it becomes iconic, and can output to a 36 x 36* pixel area. To prevent duplicating output code from the view, the frame can call its view's OnDraw member to do the output.

NOTE: Dynamically animated application icons will not work on Windows 95 and versions of Windows NT after 3.51.

<div class="moreinformation_section">

MORE INFORMATION
The following files are available for download from the Microsoft Download Center:

Multicon.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

This file contains subdirectories, be sure to use the -d command line switch while extracting.

Two simple view classes are used to demonstrate dynamic icons: CRectView and CEllipseView. These classes draw a random rectangle and a random ellipse, respectively. CWinApp::OnIdle is overridden to invalidate each open view and each minimized frame window. The MULTICON sample also demonstrates how to scale the output from an open view to fit a minimized frame, and how to convert the minimized frame's output to an icon during a drag operation.

<pre class="fixed_text">Feature (How to...)                           Location(s) ---                           --- Generate random rectangles ................... RECTVIEW.CPP CRectView::OnDraw
 * For Windows 3.1, subject to change in future versions of Windows.

Generate random ellipses ..................... ELLPSEVW.CPP: CEllipseView::OnDraw

Register a window class with a NULL icon ......................................... MAINFRM.CPP: CMainFrame::PreCreateWindow

Render on a minimized CMDIFrameWnd using the application's active view .................... CMainFrame::OnPaint

Convert the display of a minimized CMDIFrameWnd to an icon ...................... CMainFrame::QueryDragIcon

Enable OnIdle processing while a menu or modal dialog is displayed .................... CMainFrame::OnEnterIdle

Render on a minimized CMDIChildWnd using the associated view .............................. ICONWND.CPP: CIconWnd::OnPaint

Convert the display of a minimized CMDIChildWnd to an icon ...................... CIconWnd::QueryDragIcon

Drive animated views and icons in the background ................................... MULTICON.CPP: CMulticonApp::OnIdle

Additional query words: dynamic mdi frame child kbfile

Keywords: kbdownload kbuidesign kbfile kbmdi kbsample KB113251

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.