Export (0) Print
Expand All

FIRE Sample: Demonstrates Windows Common Controls

Visual Studio .NET 2003

The FIRE sample is a Windows Common Controls dialog-based sample application. It simulates fire and allows you to change various properties of the fire by adjusting Windows Common Controls on the dialog.

Building and Running the Sample

To build and run the FIRE sample

  1. Open the solution fire.sln.
  2. On the Build menu, click Build.
  3. On the Debug menu, click Start Without Debugging.

    The Fire Simulation dialog box appears.

To change attributes of the fire

  • Click the tabs to change the palette that renders the fire (Wood, Natural Gas, or Kryptonite).
  • Click and drag the Vertical Slider (Max Burn) along the right side of the fire to adjust the ceiling of the flames. Note the Progress Indicator control below the fire that tells you when the adjustment is complete.

To use the Tree control

  • Click one of the leaf nodes: Decay, Flammability, Maximum Heat, Spread Rate, or Size under the Fire node, or Smoothness, Distribution, or Chaos under the Render node.
  • Use the up and down arrows to adjust the value that appears in the Spin control.
  • Click Apply to update the value and watch the fire change accordingly.


This sample demonstrates the following keywords:

AfxGetApp; BitBlt; CDC::BitBlt; CDC::CreateCompatibleDC; CDC::DrawIcon; CDC::GetSafeHdc; CDC::RealizePalette; CDC::SelectObject; CDC::SelectPalette; CDialog::DoModal; CDialog::OnInitDialog; CGdiObject::Attach; CGdiObject::DeleteObject; CGdiObject::GetObject; CMenu::AppendMenu; CRect::Height; CRect::Size; CRect::Width; CString::IsEmpty; CString::LoadString; CWinApp::InitInstance; CWinApp::LoadStdProfileSettings; CWnd::CenterWindow; CWnd::DoDataExchange; CWnd::EnableWindow; CWnd::GetClientRect; CWnd::GetCurrentMessage; CWnd::Invalidate; CWnd::IsChild; CWnd::IsIconic; CWnd::KillTimer; CWnd::OnActivate; CWnd::OnDestroy; CWnd::OnHScroll; CWnd::OnPaint; CWnd::OnPaletteChanged; CWnd::OnQueryDragIcon; CWnd::OnQueryNewPalette; CWnd::OnSysCommand; CWnd::OnTimer; CWnd::SendMessage; CWnd::UpdateData; CreateBitmap; CreateDIBSection; CreatePalette; DeleteObject; EnableWindow; GetActiveWindow; GetSystemMenu; GetSystemMetrics; LoadIcon; PeekMessage; RealizePalette; SelectPalette; SetTimer; memcpy; rand

Note   Some samples, such as this one, have not been modified to reflect the changes in the Visual C++ wizards, libraries, and compiler, but still demonstrate how to complete your desired task.

See Also

MFC Samples

© 2015 Microsoft