A cute owner draw menu DLL (full Ver.)

Developed or developing a new product in PureBasic? Tell the world about it.
clover
User
User
Posts: 14
Joined: Tue Dec 30, 2008 4:43 am

A cute owner draw menu DLL (full Ver.)

Post by clover »

Introduction
This DLL acts to make the menu more beautiful. The way it works is based on the existent menu and you will find it quite convenient to use it.


Characteristics
1) The code completely depends on the existent MENUITEMINFO structure and didn't allocate any structure array that store item info at all.

2) Cool and cute outlook. User can specify menu style (about 40 items) as free as possible. It supports gradient fill, alpha blend, 32-bits bitmap.

3) Easy way when use, you only need to invoke three functions, and then all is OK!

4) Pocket library file size.


Compiler
PureBasic 4.20


Quick guide
1) There are three kinds of Demo Codes such as Visual C++ 6.0, Visual Basic 6.0 and PureBasic in the folder "Demo Code", you can refer to them respectively.

2) First step, invoke AssignOwnerDraw(HMENU hMenu, UINT fSubIncluded). This function will set MFT_OWNERDRAW flag to each item of hMenu. You can invoke this function as soon as the menu is either loaded or created, and you can also invoke it later in WM_INITMENU/WM_INITMENUPOPUP message instantly. And next step, invoke MeasureItem(LPMEASUREITEMSTRUCT lpmis) and DrawItem(LPDRAWITEMSTRUCT lpdis) in WM_MEASUREITEM and WM_DRAWITEM message respectively.

3) Menu style was initialized according to system menu style as default when the library is newly loaded by a process. To realize other styles, another two functions GetMenuStyle(LPMENUSTYLE lpms) and SetMenuStyle(LPMENUSTYLE lpms) are needed. By set each property a proper value with the powerful couple, not only can the library imitate other software's menu appearance, but also it can show particular appearance as your wish.

4) Please refer to help documentation for details of use.


Note
For the sake of good compatibility, the library was compiled with UNICODE.

You shouldn't invoke any of the functions until the menu was either loaded or created.

The icon (a bitmap essentially) lacated on the left side of the menu item and item bitmap need to be specified by invoking API SetMenuItemInfo(). Note that the member hbmpChecked, hbmpUnchecked and hbmpItem of MENUITEMINFO structure accept BITMAP handle only! Dont't try to specify any other handles such as an icon handle.

The last member of MENUITEMINFO should be hbmpItem, or there would be some problems.

It is not API LoadBitmap() but LoadImage() should you invoke when you are loading a bitmap. By adding a flag LR_CREATEDIBSECTION, the function will load the bitmap as a DIB rather than a compatible bitmap to the screen color depth. The purpose is to ensure that 32-bits bitmap be recognised and displayed correctly.


Contact author
migiwa@yahoo.com.cn


Snapshot
Office
Image

3D
Image

Aero
Image

Gradient
Image


Download
http://www.live-share.com/files/381169/ ... L.rar.html
Last edited by clover on Thu Feb 19, 2009 4:36 pm, edited 5 times in total.
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

I dont find the download section :(
where is that? 8)
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Doesn't belong in Tricks & Tips unless it includes PureBasic source code. Otherwise, it goes in Announcements.
BERESHEIT
Micko
Enthusiast
Enthusiast
Posts: 244
Joined: Thu May 24, 2007 7:36 pm
Location: Senegal
Contact:

Post by Micko »

seems interressant but we can't download the file
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

:?: :?: :?: :!: :!: :!: :?: :?: :?:
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

moved
SPAMINATOR NR.1
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

Image
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

Image
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

Image
Sorry for MultiPosting 8)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

We can download it three times? Wow ;-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

four times if you blink once :)

Thanks for the post :)
clover
User
User
Posts: 14
Joined: Tue Dec 30, 2008 4:43 am

Post by clover »

Full version released, download and enjoy it!
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Nice avatar, clover.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

VeryVeryNice
Thanks Clover
User_Russian
Addict
Addict
Posts: 1519
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Post by User_Russian »

Error to compiling Cute Menu.pb
Image
Post Reply