Single Toobar Simultaneously Used by Multiple Dialog-Based Applications At Once | CodeGuru

Single Toobar Simultaneously Used by Multiple Dialog-Based Applications At Once

Environment: VC6 SP3, Windows95/98/NT4/2000 TlbDlg_OK is a sample how to work with common toolbar from several dialog-based applications. Project TlbDlg_OK (see Downloads demo and source files) creates 2 applications tb.exe (toolbar) TbDlg_OK.exe (dialog application) > What to run at first – TbDlg_OK.exe or TB.exe is not important. Click several times exclamation mark in TB.exe to […]

Written By
CodeGuru Staff
CodeGuru Staff
May 5, 2000
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: VC6 SP3, Windows95/98/NT4/2000

TlbDlg_OK is a sample how to work with common toolbar from several dialog-based
applications.

Project TlbDlg_OK (see Downloads demo and source files) creates 2 applications

  • tb.exe (toolbar)
  • TbDlg_OK.exe (dialog application)
  • >

What to run at first – TbDlg_OK.exe or TB.exe is not important.
Click several times exclamation mark in TB.exe to run several instances
of TbDlg_OK.exe.

Move focus to any of them – common toolbar (TB.exe) moves automatically
in its area.

Common toolbar will be closed when a last instance will be closed.

TbDlg_OK.exe sends to TB.exe the following messages (see resource.h)
to add and delete connections between two applications and to move tb.exe placement:

ID_CONTROL_ADD_HWND
ID_CONTROL_DELETE_HWND
ID_CONTROL_SET_FOCUS

TB.exe sends to TbDlg_OK.exe the following messages (see resource.h)
in accordance with icons, that are set in tb.exe:

ID_CONTROL_NEW_INSTANCE
ID_CONTROL_NEW
ID_CONTROL_OPEN
ID_CONTROL_SAVE
ID_CONTROL_HELP

Their implementation is carried out in TbDlg_OK\TbDlg_OKDlg.cpp as usually:

ON_COMMAND(ID_CONTROL_NEW,OnNew)
ON_COMMAND(ID_CONTROL_OPEN,OnOpen)
ON_COMMAND(ID_CONTROL_SAVE,OnSave)
ON_COMMAND(ID_CONTROL_HELP,OnHelp)

TB.exe is a simple application that contains toolbar only.
Its size is equal toolbar size (see tb\mainfrm.cpp variables CONTROL_BAR_WIDTH
and CONTROL_BAR_HEIGHT).

Notes

This sample is used in
Windows Ini files Editor
.

Downloads


Download demo project – 45 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.