Menu Button control 1.0
Downloads:
Publisher: viksoe.dk
File size: 5KB
OS: Windows XP, 98
Date added: 2009-10-27
Homepage: http://www.viksoe.dk/
Category: Development
Menu Button control 1.0 Description
"A menu button control. Ownerdrawn button painting."
BS Editor: This is a Menu Button control. Menu Button controls are not rocket-science, but this control is also a demonstration on how to draw an ownerdrawn button in both Windows 98 and Windows XP.
The control displays itself as a regular button, except that it has a Glyph (a little arrow) on the right signalling that it displays something when you click it. All it does is to display a popup menu. The popup menu is custom drawn because I wanted to be able to add colourful icons to it. The button is also ownerdrawn because it needs to paint the dropdown-glyph on the right.
The problem with ownerdrawn buttons is that on Windows XP and greater we need to paint it with the current theme. Before Windows XP it was simply a matter of using the BS_OWNERDRAWN style. Unfortunately this also meant that we had to repaint the entire button exterior as well. Since a button always behaved the same, we could use the DrawFrameControl() API to do much of the drawing.
Along came Windows XP and changed all that. The DrawFrameControl() no longer works and we'll have to dip into the Theme API to get the job done. Well, not quite... because the old Windows Common Controls ListView and TreeView introduced a new ownerdraw method: the NM_CUSTOMDRAW notifications. And in Windows XP the Button control inherits this behaviour too (as well as supporting the old WM_DRAWITEM-range of messages).
The trick to drawing an ownerdraw button under Windows XP is not to draw the button at all.
The Button sends WM_NOTIFY / NM_CUSTOMDRAW notifications to the parent. If we wanted to drastically change the look of the button, we would start to custom paint here but since we just want to add an icon and some visual decorations, we'll answer the notification with the CDRF_NOTIFYPOSTPAINT code. This instructs Windows to paint the button entirely. When done, Windows calls us again with NM_CUSTOMDRAW and allows us to paint on top of the button image. you can free download Menu Button control 1.0 now.
Menu Button control 1.0 Keywords
Menu Button control 1.0 Related Software
- Anyplace Control
PC remote control software: you control remote PC, transfer files, etc. - Movie Player Pro ActiveX Control
media player, video player activex Mov, Mp4, 3gp, AVI, WMV, MPEG-1, RM, MPEG-2 - Hidetools Parental Control
Remotely monitor all computer activities. Restrict Internet and program access. - Start Button Hacking
Start Button will begin moving and you can also removeStart Button - CFixedString
Implements a CString-like class with a fixed-length string buffer. - RTF Script Editor
A RTF based editor with syntax highlighting. - Edit control (filter)
A simple subclassed EDIT control, which filters input. - Script Studio
A remake of the Envox Studio application. - XML OLE DB Provider
An OLE DB Provider allowing you to query XML documents with SQL. - Coloured controls
Extensions to most of the standard Windows controls with custom colouring. - Database wrappers Class
A set of classes wrapping the ODBC and OLE DB database APIs. - HTML ListBox
A WTL list control which uses the HTML layout engine. - ComboBoxes
Various ComboBox controls. - Command Bar XP
An extension to the WTL Command Bar - Gmail Driver
Shell Namespace Extension that creates a virtual filesystem around Gmail account - CShellLink
A small MFC class that wraps the Windows Shell's shortcut API. - Menu Button control
A menu button control. Ownerdrawn button painting. - A LED control
A LED control. - BVRDE
An IDE for remote compiling debugging UNIX and LINUX applications from Windows - PropertyList control
A WTL property list control; just like the one in MS Visual Basic. - MultiSelect Tree View control
A tree with multi-select capabilities. - Console Screen class
The class wraps the Win32 Console API. - CPathMonitor
Uses the FindFirstChangeNotification Win32 API to detect changes in a file path. - Simple HTML Viewer
A RTF-based HTML viewer control. Extends the RichEdit control. - BaseScript
A scripting language with C or JavaScript-like syntax - ASMIL
ASM to IL compiler - Non-Client control
Testing non-client painting in Windows. - Skinned Button control
A WTL version of Shinya Miyamoto's Window Blinds skinned button. - PropertyGrid control
A simple WTL grid control. - WriteRes
Modifies the icon resource section of any application. - MiniHTML control
A GDI based label control with text formatting. - Alpha Play
A short walk-through of the alpha functions in Windows XP. - ASCII Desktop
This small utility displays your desktop as ASCII art. - Dialog Ed
Dialog Ed implements a dialog editor using the DHTML Editing Component. - GMail Drive shell extension
creates a virtual filesystem around your Google GMail account - Cool Tabs
Includes DevStudio 6 and VisualStudio.NET folder tabs. - HTML Source Bar
Shows parsed HTML, script code,style sheet source, image information o fbrowser. - atldock
A basic docking windows framework for WTL.
Menu Button control 1.0 Publisher's Software
Popular Searches
Hot Downloads Software
New Release Software