Page 1 of 2

A cute owner draw menu DLL (full Ver.)

Posted: Tue Dec 30, 2008 2:15 pm
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

Posted: Tue Dec 30, 2008 5:10 pm
by Tomi
I dont find the download section :(
where is that? 8)

Posted: Tue Dec 30, 2008 5:34 pm
by netmaestro
Doesn't belong in Tricks & Tips unless it includes PureBasic source code. Otherwise, it goes in Announcements.

Posted: Wed Dec 31, 2008 12:08 pm
by Micko
seems interressant but we can't download the file

Posted: Fri Jan 02, 2009 12:05 pm
by Tomi
:?: :?: :?: :!: :!: :!: :?: :?: :?:

Posted: Fri Jan 02, 2009 12:22 pm
by Rings
moved

Posted: Thu Jan 08, 2009 7:36 am
by Tomi
Image

Posted: Thu Jan 08, 2009 7:37 am
by Tomi
Image

Posted: Thu Jan 08, 2009 7:37 am
by Tomi
Image
Sorry for MultiPosting 8)

Posted: Thu Jan 08, 2009 12:19 pm
by blueznl
We can download it three times? Wow ;-)

Posted: Thu Jan 08, 2009 10:33 pm
by SFSxOI
four times if you blink once :)

Thanks for the post :)

Posted: Sat Jan 17, 2009 9:15 am
by clover
Full version released, download and enjoy it!

Posted: Sat Jan 17, 2009 9:26 am
by PB
Nice avatar, clover.

Posted: Sat Jan 17, 2009 3:25 pm
by Tomi
VeryVeryNice
Thanks Clover

Posted: Sun Jan 18, 2009 10:03 am
by User_Russian
Error to compiling Cute Menu.pb
Image