Introduction
I was recently looking for a sample of how to mimic the IE menu bar. First, I read an article in MSDN Library named “Creating an Internet Explorer-style Menu Bar” which gives a brief idea of how to get started. Then, I ran across an article by Paul DiLascia (with a working sample!). Unfortunately, Paul’s article addresses SDI applications rather than MDI, although it gives many useful ideas and tricks which I used later on. Finally, I visited Internet sites devoted to MFC programming and found there some good articles concerning the problem in question. But most of those articles seem to pretend to be too universal and as a result are too heavy. This is possibly because the authors were trying to mimic MS Office/DevStudio (which is more complicated indeed) rather than the IE menu bar. Thus I came to the decision to create my own MenuBar which will meet all my unpretentious needs.
As my MenuBar was getting along I realized that it also would be nice to incorporate the standard ReBar control into another sizable “re-bar” just like IE does, so that the user could resize the ReBar by dragging a divider between the frame’s client area and the ReBar itself. So this gave rise to another control, which I call SizableReBar here. It was not hard to implement corresponding C++ class, since there are a lot of samples of custom ControlBars on the Net. My favourite is CSizingControlBar
by Cristi Posea (thanks Cristi for your excellent work!). I used some of his basic ideas in my CSizableReBar
class.
After all, one thing left to be implemented to fully mimic the IE-style GUI was a toolbar control that could display itself on a chevron menu when some of its buttons get clipped. Frankly speaking, I was not excited about this idea in the beginning and the initial version of the class library did not contain any toolbar classes. Fortunately, I had some spare time a while ago and did write that anticipated CToolBarEx
class.
Although bitmapped menus are not a distinction of the IE-style GUI, it is considered to be a good form for modern apps to have them nowadays. There are plenty of good articles on the Net that show how to implement owner-draw bitmapped menus. But I have failed to find one that utilizes new functions and structures introduced in Windows 98, namely the hbmpItem
member of the MENUITEMINFO
structure and the GetMenuInfo()
/ SetMenuInfo()
functions along with the MENUINFO
structure. In my opinion it is quite reasonable to use these functions/structures, bearing in mind the growing number of the users that have already moved from W95/NT4 to W98/W2K/XP platforms. Also it is much more easy and a more standard way than to use fully owner-draw menus. That is why I have built in support of bitmapped menus using these new functions/structures.
Highlights of the classes
Moving on to what has been implemented so far (all these classes are located in \GuiLib directory of the demo project and compiled into MFC extension DLL called GuiLib.dll):
CMenuBar
class encapsulates the core functionality of the menu bar. It also knows how to display itself on chevron menu when some of menu bar items (and/or caption buttons, in case of MDI app) get clipped:
The latest version ofCMenuBar
seems to work correctly when an embedded item is activated in-place.CToolBarEx
class is meant to be used instead of standardCToolBar
class. UnlikeCToolBar
,CToolBarEx
knows how to display itself on chevron menu when some of its buttons get clipped:CToolBarEx
provides 3 different options for text labels (“Show text lables”, “Selective text on right” and “No text labels”) and 2 options for icons (“Small icons” that is 16×16 and “Large icons” that is 24×24″).
Besides,CToolBarEx
is persistent, i.e. its state (including Text and Icon options) can be saved in the registry and restored later on. Corresponding methods are:SaveState(LPCTSTR lpszProfileName)
andLoadState(LPCTSTR lpszProfileName)
.CCustomizeDialog
class allows the user to change toolbar options, as well as do other toolbar customizations. In fact, it is standard “Customize Toolbar” dialog which has been slightly extended (see new combo-boxes at the bottom of the dialog):CSizableReBar
class encapsulates the functionality of the sizable re-bar control.
The control is persistent, i.e. its state can be saved in the registry and restored later on now. Corresponding methods are:SaveState(LPCTSTR lpszProfileName)
andLoadState(LPCTSTR lpszProfileName)
.CSizableReBar
has context menu which usually has two parts: the first part is a list of bands that can be hidden/shown, and the second part (which is optional) is specific to the band that was clicked. For example, when the user right-clicks band with a toolbar the context menu may look as follows:CFrameWndEx
(to be used in SDI applications),CMDIFrameWndEx
andCMDIChildWndEx
(to be used in MDI applications) classes were introduced to make the programmer’s life as easy as possible.C(MDI)FrameWndEx
will automatically create a SizableReBar and MenuBar, as well as handle some key windows messages in order to get the MenuBar working correctly.CPreviewToolBar
,CPreviewViewEx
andtemplate<class TBase> class CPreviewableView
classes were introduced to provide Print Preview mode with nice-lookingCToolBarEx
-derived toolbar instead of that ugly standard preview bar provided by MFC by default:
To have such a preview toolbar your view should be derived fromCPreviewableView
. For example:Hide Copy Code
class CMyView : public CPreviewableView< CEditView >
Also
ID_FILE_PRINT_PREVIEW
command handler implemented inCPreviewableView
should be added to the message map of the derived class:Hide Copy Code
BEGIN_MESSAGE_MAP( CMyView, CEditView ) ... ON_COMMAND( ID_FILE_PRINT_PREVIEW, OnFilePrintPreview ) END_MESSAGE_MAP()
- Every window that is assumed to be used as bitmapped popup menu owner should be derived from
template<class TBase> class CBmpMenuOwnerWnd
. For example:Hide Copy Code
class CMyFrame : public CBmpMenuOwnerWnd< CMiniFrameWnd >
Also message handlers implemented in
CBmpMenuOwnerWnd
should be added to the message map of the derived class:Hide Copy Code
BEGIN_MESSAGE_MAP( CMyFrame, CMiniFrameWnd ) ... ON_WM_INITMENUPOPUP() ON_WM_DRAWITEM() ON_WM_MEASUREITEM() END_MESSAGE_MAP()
Note:
CFrameWndEx
,CMDIFrameWndEx
andCMDIChildWndEx
are already derived fromCBmpMenuOwnerWnd
. CWindowListDialog
class allows the user to manage MDI child windows:
Obviously, this dialog makes sense for MDI apps only. Menu item that invokes this dialog is automatically added to the end of the Window popup menu, if any.CWinAppEx
class is used to cache various system-wide settings. It also holds image list with menu icons.
General note for the latest release of CMenuBar
and CToolBarEx
classes: all that new W98/W2K/XP visual effects (like XP themes, flat menu appearance, menu animation, menu underlines, menu fade, etc.) are supported by menu bar/toolbar chevron menu now and brought into accord with corresponding system-wide settings.
Using the classes
Here are basic steps:
- Add GuiLib directory to the list of additional include directories for your project.
- Add the following line of code to your stdafx.h:
Hide Copy Code
#include "GuiLib.h"
- Add inclusion of GuiLib\Resource.h in your RC file:
Hide Copy Code
#include "afxres.h" #include "GuiLib\Resource.h" ... 2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include ""afxres.h""\r\n" "#include ""GuiLib\\Resource.h""\r\n" ... "\0" END
Note: Resource IDs from 101 to 999 and from 33001 to 33999 are reserved by GuiLib.dll and should not be used by your application.
- Derive your Windows application object from
CWinAppEx
rather thanCWinApp
and modifyInitInstance()
as follows:Hide Copy Code
BOOL YourApp::InitInstance() { InitGuiLibDLL(); // insert GuiLib.dll into the resource chain ... }
- Derive your main frame object from
C(MDI)FrameWndEx
rather thanC(MDI)FrameWnd
. In case of MDI application all child frames should be derived fromCMDIChildWndEx
. - Derive all your toolbars from
CToolBarEx
(don’t forget to overrideCToolBarEx::Init()
function!). As soon as toolbar created it should be added to the sizable re-bar control. This can be done inCMainFrame::OnCreate()
. For example:Hide Copy Code
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if ( CMDIFrameWndEx::OnCreate( lpCreateStruct ) == -1 ) return -1; VERIFY( m_wndToolBar.Create( this, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP | CBRS_FLYBY ) ); VERIFY( m_wndReBar.AddBar( &m_wndToolBar, 0, 0, RBBS_FIXEDBMP | RBBS_BREAK, _T("&Toolbar"), false ) ); m_wndToolBar.Init(); ... }
find g
g two
g make
http://tinyurl.com/cbd-oil-that-works-2020
Fredrick Molla
website hosting
web hosting services
win money now online
Pingback: Home Goods
Betsy Abrams
Pingback: game bai catte
Pingback: tennis truc tuyen
Pingback: dua ngua online
look at this web-site
Elliptical assembly service
have a peek at this site
alberta car towing
roadside assistance
useful link
a digital marketing plan
White glove furniture delivery
my explanation
how to renovate a house cheaply
White glove delivery
bariatric vitamin
plumbing repair Learn More
why not find out more
VitalFlow Updated
무료 슬롯
master plumber article source
출장안마
안전사이트
SUNLITE for sale
Kyla Fritchey
White glove service
Seth Abrams
안전한 놀이터
라이브 베팅
Owen Clayborne
슬롯 머신
Delta 8 THC gummies
Pretty Gaming
Lionel Adkison
Jim Pest Control
pet toys
Verbal Reasoning Tests
Stormy Kauphusman
Roosevelt Medill
satchel
Visit This Link legal news central
free horror
MOTORCYCLE
black babydoll lingerie
Banana Kush Feminized Cannabis Seeds
Delma Christiansen
Skincell Pro website
mamashop.com.au
buy viagra
lingerie on line
plus size red underwear
제주마사지
sex toy review
Tim Woodson
Glinda Cramm
Pingback: Software regression testing
see this page suburbanews.com
fetish sex toys
trashy lingerie
freelance jobs from home
continue
Alona Lovejoy
movies
https://jbokeo.com/cach-dang-ky-jbo/
water company dubai
go right here electrician
Conservative Social Network Capmocracy.com
Floretta Besson
Elisha Redmon
investigate this site
have a peek at this site
Synapse XT
plumbing services near me visit this web-site
read more 365PlanetNews.com
linked here australnews.com
best app for cheap flights
cialis online
special info suburbanews.com
Ethelyn Sadler
i thought about this scaldingcoffee.com
https://online-casino20.sitey.me/
Best online sale
TgnTimes.com
Rubin Obeso
find this 247 real news
cordless drills
Satchel
real estate agents
Janay Sotero
usine marrakech
porno
Website Lindoron.com
Model Maker
women's clothes
1nza.com
directory Aanewshop.com
Continue legalorium.com
have a peek at this site bravenewspaper.com
Credit repair
go to these guys AbnewsBD.com
Bio Melt Pro Ingredients
Jewel Penton
see page 336news.com
Your Domain Name 51kannews.com
continue
emergency plumber near me try this site
over at this website Arajilinenews.com
pop over to these guys 9janewswatch.com
address
click to investigate Burkinatimes.com
special info phtimesng.com
download lagu
Sylvester Alvord
towing vancouver
chewhosting
netsportworld
check that CallCentreNews.com
description icetimesmagazine.com
look what i found RadScienceTimes.com
Shy Bladder
Source Brawlernews.com
click for info 891 news
Click here
try this out Aajnewsok.com
Extra resources Aazadhindnews.com
additional info FreeTownDailyNews.com
continue reading this ArvoNews.com
helpful site Attockcitynews.com
published here Aoqinews.com
Learn More Achounews.com
Edra Swogger
article source BestNewsUp.com
have a peek at this site fasotimes.com
browse around these guys AcademyWebNews.com
use this link brainwavelive.com
save game
additional resources Athanews.com
continue reading this 0751sgnews.com
YOURURL.com all new sharings
webpage Acblivenews.com
check my blog americanvalvenews.com
a fantastic read A7news.com
why not look here adnnews24.com
Shalonda Bise
Mirror installation
have a peek at these guys angola post news
hop over to this site bitarka news
Learn More Here 0913News.com
see this Pro-tec-insider.com
what it is
helpful site biz market news
Jobs offered
have a peek at this site BigMarketNews.com
why not try this out B2D News
visit this site right here Breaching News
you can find out more bombernews.com
description ADnNews24.com
see electrician free estimate
Read Full Article 4news4you.com
go to my site Ambrosymedia.com
moved here Backwards News Report
right here Bitarkanews.com
learn the facts here now allnewsnepal.com
Skincell Pro Ingredients
find Blog1News.com
why not look here aionews9.com
visit my profile
more BioAmericanews.com
my link Botapracorrernews.com
visit my profile
this article AisaDailyNews.com
visit my profile
find more aisadailynews.com
see here AJD News
have a peek here amarishwardi news 24
visit site Boudnews.com
youtube transcription
here Blog1 News
Amazon Aws Console
learn the facts here now allgonews.com
check out here BomberNews.com
try this out Ameliavillagenewspaper.com
find more information Allgonews.com
gaming news
click for info bmsportnews.com
visit AngolaPostNews.com
resource ameliavillagenewspaper.com
he said Botapracorrer News
Paruresis Cam
Continued bmsportnews.com
see this page BreachingNews.com
dishwasher repair plano
click here to investigate Boud News
Office movers
안동출장마사지
go to my blog 0913News.com
online shopping
hot sex stories
mobile indir}
918kiss
Lucy Heart
Dunkin Donuts
Vakuum Staubsauger
구미출장마사지
Margo Leta
more tips here 247realnews.com
mastic roofing cement
how to open your own bank
link alternatif qq
대전출장안마후불
latest news site
esamoda
일산명월관
Juicy Feminized Cannabis Seed Variety Pack
kitchen worktop polisher
Maryland mirror installation
read about business standard insurance news
digital marketing las vegas
microsoft office 2019
phim sex online
Modesto Vitalo
end of lease cleaning Melbourne
situs idn poker online
Steel Bite Pro USA
Lashawna Tengan
Tom Purdom
best porn sites
pool opening companies near me
shoes
Elliptical movers
Burton Beaudion
Trusted bitcoin investment platform
Saundra Lompa
Karri Desano
Ines Zweig
Naoma Nagode
Judi Slot Online
rankedpornsites.com
list of approved canadian pharmacies
pop slots free coins
Uber Accident Attorney
Slot Deposit Pulsa
activated carbon expert - next steps
m88 link
Situs Mpo
Health Insurance Low Income
bedding & bath
видео новостьи
schlüssel und schlösser
software development company
gaming news
Heidi Caporale
123 go
malvorlagen
Link vao VN88
brand
marketing agency Bristol
Graduate School
fuck ass
메리트카지노
Virginia apartment movers
DC limousine service
delta credit card
judi slot
Seo and Digital Marketing Company Kanpur
W88
bandar bola
Rey Westly
slot online
happy new year images
bandar bola
game news
video projectors for iphone
can amazon fire connect to video projectors?
T-Shirt Printing Swansea
DC Hookah bar
DC black car service
Ruko bsd
camera lens filters
dlp video projectors
gaming news
VN88
beauty shop
judi online
Buy Health Insurance
Porn 55
대구광역시출장마사지
funny videos
brokerreview scam
K8pro
bandar slot
weblink 4news 4you
get viagra without doctor
find more Aisa Daily News
Earrings
Austin Rideshare
포항출장
bandar slot online
buy youtube views
Buy Instagram Followers
Miltary Stickers
BK8.com.co
domiciliation casa
bandar judi online
Satchel
can you download ebooks on a laptop?
W88.com
mpo slot
viagra without a doctor prescription safe rx
personal trainer
Maicon
Health Insurance Quotes
body building body type
judi online android
buy instagram views
Qarabaq Azerbaycandir
Magnus Leonard Roth
gaming news
Mahi Mike
Cosplayo
cbd oil with no thc
Acidaburn Ingredients side effects
출장안마
agen judi
chrome mine supplier
โกงชักดาบ
judi bola
Patent Lawyer Irving
sisteme de copiat
꽁머
꽁머니
Copyright Ry
bandar judi
Altai Balance benefits
rheem apprentice plumber grant
Patent Attorney Garland
cialis effectiveness over time
DC events
καρκινογονος καφες
plumber kingston
bandar casino
removal of old furniture
百家樂
LA Trademark
Low-Cost Health Insurance
judi casino
plumbing contractors Gawler
panasonic cells
situs judi online
cialis vs viagra comparison
메이저사이트
local plumbers Gawler
출장마사지
bandar judi slot
bandar slot
Homepage commercial plumber guildford
poco x3 özellikleri
FangWallet
ligabola88 alternatif
official statement kavanews.com
instagram takipçi satın al
instagram takipçi satın al
구찌출장안마
Michel Akkerman
viagra
안전놀이터
출장마사지
prednisone and gabapentin interaction in dogs
w88 live online casino
Los Angeles Patent Attorney
check this out
Kurtis Kaminer
try this
Colin Cyrulik
best patreon alternative
social media
what is tadalafil ip 5mg
Margeret Jacobellis
telefon karşılaştırma
Golda Sinquefield
more info here royalty free sound effects for commercial use
Health Insurance Low Income
Ulysses Chess
Baby Essentials
Lorina Decook
domain seo service registration
http://yed.yworks.com/support/qa/index.php?qa=user&qa_1=russopena38
IDGod
Business Opportunities
용인출장마사지
my article
washington post viagra
slot qq
พนันออนไลน์
Real Madrid
gıda
구찌 출장
เกมส์คาสิโน
creditrepair
casino online
Miroslav Vyboh
does viagra show up in probation urine test
nootropics for depression
click here now body building e books
emergency plumber their website
navigate here
Immigration Attorney Miami
viagra growth
check it out 24 Hour
check it out emergency plumbers manly
Immigration Attorney Near Me
เว็บรูเร็ต
BioSoothe Pro Official website
성남 출장안마
Danna Reginaldo
Rico
เว็บคาสิโน
RevSkin Review
Thomas
Santos
Cathie Hebb
Profile
zahnarzt in düsseldorf
Leora
can i take 2 20mg sildenafil
Amelia
Keravita Pro Benefits
Woodrow
Online Casinos
tuzla escort bayan
Parker Alexis
check it out 24 Hour plumbers kellyville
find more info emergency plumber Melton
nootropics in australia
pendik bayan escort
LOL dolls
doctors in bay area who prescribe sildenafil
divi data
casimba
dividata
klimaanlage
Isatu Tejan-Sie
ProstaStream reviews
adult drivers ed near burr ridge illinois
Charles Kleinmetz
forex diamond review
샌즈카지노
bathroom mirrors
Residenial House Cleaner
Get More Info local plumbers melton
xsmb
Divorce Attorney Montgomery AL
click here
sildenafil effects on female
visit profile
Mitsuko Dey
this page plumbing contractors brisbane
video projectors for church
Escort Service
Maryland office movers
Virginia treadmill installers
Scott Umbarger
California Patent Attorney
emergency electrician cronulla
Nigeria Property
Gay Porn
make bitcoin with paxful
Roof Cleaning
Get More Info golf e books
MANITOBA FAKE DRIVER’S LICENCE
sildenafil texas
judi online tembak ikan
Uber Accident Lawyer
Escort Service
Rideshare Accident Attorney
kancelaria
MARCA DA PAZ CADASTRO
nootropics weight loss
마사지구인
DC mirror installers
BTC Haberleri
Dario Mclellan
Reta Basilio
หนังออนไลน์2017
www.cosplayo.com
Pingback: mice
หนังออนไลน์hdmaster
best plumbing website here
เว็บพนัน
Best divorce lawyer near me
karkinos
Francisco Filonuk
Aurora
Amina Baccam
Fausto Marona
web judi online terpercaya
find more info nootropics for energy,
제주출장
rent jet skis garland
find this nootropics for energy,
Entreprise Web
Supplemental Insurance
Pingback: mouse
Alexandra
Web Marketing
Storage shed installers
Guvenilir takipci satin al
Rodent Proofing
Diamond Review-ytvideoindir-10y3rteswJY.html
Tiffanie Mcgilvery
Josephine
Tom Hattori
สล็อตออนไลน์
planner celina
Massage Gun
Audio
제주출장마사지
tiktok begeni hilesi
Adalberto Kuhns
메리트카지노
샌즈카지노
search competitor
สล็อต
Pinterest Cosless
poker idn
beste hosting belgie
สล็อตออนไลน์
jasa review google bisnisku
Charlie
Wally Ronayne
Sammy Stage
helpful resources
24 emergency electrician cronulla
gaysex
Copyright Attorney
안전놀이터
Okinawa Flat Belly Tonic powder
games for pc download
GMB
Trademark Austin Attorney
Charlsie Leasure
kortingen
Eugene Derden
Kenia Cuzick
https://www.sagamecasino.com/
전주출장
website
covid
een border collie boek
CBD Lube Reviews
전주출장안마
Huntsville Divorce Lawyer
Apps For PC
at the races tipsters
Divorce Lawyer Near Me Free Consultation
bioplastics expert
Budderweeds
bk8thai
Profile
Elliptical movers
poker online
kitchen accessories click here
p2p사이트 순위
נערות ליווי תל אביב
designs
Nelida Adinolfi
Autoankauf Essen
נערות ליווי תל אביב
home appliances
샌즈카지노
Elliptical installers
poker online
Judi Slot
เว็บพนันออนไลน์
visit profile
Judi Slot
babouche france
you can try here
juana la loca megadede
Divorce Attorney Huntsville Alabama
crypto sace
crawl space encapsulation prices
film izleme sitesi
Treadmill assembly service
galileo fx
Sinnkrise Beratung
webdesigner west vlaanderen
mlb중계
Loose Leaf Tea
site link
Malinda Vendig
Paul Isner
visit my site
digital marketing agency
ramalan judi bola
Edmond Travillion
Swing set movers
Serina Mealy