turned,more,difficult,work,than,drawing,butto
Quick Search for:  in language:    
turned,more,difficult,work,than,drawing,butto
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
RentACoder Stats

 Code:  lines
 Jobs: 0 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for RentACoder.
Wrapping Scrolling Text
By Paranoid_Androi d on 7/2


Create A Dummy File
By AML on 7/2


Click here to see a screenshot of this code!Captionbar manipulation!
By Peter Hebels on 7/2

(Screen Shot)

A Game Of War
By Co0nest on 7/2


Click here to see a screenshot of this code!KeyGen Example
By Bengie|NET on 7/2

(Screen Shot)

Click here to see a screenshot of this code!OpenBrowser v1.9
By Orlando Jerez on 7/2

(Screen Shot)

SendMessageBySt ring() Example
By Jaime Muscatelli on 7/2


Click here to see a screenshot of this code!FirstSunday
By Jan Paul Penning on 7/2

(Screen Shot)

Click here to see a screenshot of this code!Ikonz v1.0
By Gaurav Creations on 7/2

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Titled PopupMenu

Print
Email
 
winzip icon
Submitted on: 6/2/2001 12:14:23 PM
By: Mick Doherty 
Level: Intermediate
User Rating: By 43 Users
Compatibility:

Users have accessed this code 10850 times.
 
 
     This turned out to be more difficult to work out than the drawing of a button on the titlebar. Of course once I'd got it it was simple. Once again this code uses subclassing so always use the forms close button or the menus exit to stop the project, or you will crash.

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!

    //**************************************
    //     
    //Windows API/Global Declarations for :T
    //     itled PopupMenu
    //**************************************
    //     
    CreatePopupMenu
    TrackPopupMenu
    AppendMenu
    ModifyMenu
    DestroyMenu
    GetCursorPos
    CopyMemory
    BitBlt
    SetRect
    DrawCaption
    GetMenuItemRect
    GetMenuItemCount
    GetPixel
    SetPixel
    CallWindowProc
    SetWindowLong
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 8 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
6/2/2001 2:30:18 PM:Brandon McPherson
Nice work, man!
5 globes from me.... 
clean code, well documented and runs 
like a champ! It's nice to see someone 
coming up with cool interface ideas!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/2/2001 2:46:07 PM:Jonathan Jarvis
This is great! It is the simplist and 
most understandable menu drawing 
example I've ever seen!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/3/2001 7:40:27 AM:J Stover
Great Code! I've been trying to figure 
out how it was done. You really set my 
mind at ease. Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/4/2001 1:21:41 PM:Elias from NY
Cool effect. 
Simple to 
implement.
Clean code. 
Fairly 
commented.
What else could I ask 
for?
I am giving 5 planets for you!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/6/2001 5:52:04 AM:Valenitn
Voted five - your piece is nicely 
commented, idea is good, code is 
comprehendable; in a word, ideal PSC 
item. But... (1) by it you introduce a 
style, and no element of style could 
exists in isolation. Means the same 
style must apply to the form, and 
normal menus as well, and maybe to the 
other controls (2) what value you add? 
E.g., bitmaps in menus shorten learning 
curve for toolbar icons, so they 
justified. But what purpose this 
feature can serve?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/6/2001 7:23:12 AM:Mr.B
It is a amazing work indeed. I'm not 
sure if this is a bug or not. I'm using 
Korean version of Windows 98 Second 
Edition. The first I clicked, the side 
bar of the menu always appeared 
'wrong.' The second time I tried it, it 
was working fine. If this is a bug, I 
think it should be easy to fix.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/6/2001 10:24:15 AM:Mick Doherty
I have not seen this incorrect drawing 
so I cannot comment on this.
You 
should note however, that I have made 
no attempt to account for a second 
Ownerdraw MenuItem or other OwnerDraw 
Controls. It was meant simply to 
introduce you to the basics of 
OwnerDraw. Hopefully from here you will 
learn more about MeasureItemStruct and 
DrawItemStruct so that you can build 
Case statements into the MeasureMenu 
and DrawMenu subroutines and then 
modify only the desired item.
You 
will notice that if you remove the 
Titlebar from the form you will have no 
picture. I am hoping that you are going 
to adapt this code for your own 
requirements, and BitBlt a picture to 
the sidebar. I used the DrawCaption 
method here for simplicity, rather than 
correctness.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/7/2001 1:35:22 AM:Nathan Chere
Just out of curiosity is this the same 
way the Start menu does it? Or the ICQ 
menu?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/7/2001 8:36:57 AM:Mick Doherty
Using a Spy Tool on the Start Menu will 
show you that the Menu is of class 
"ToolbarWindow32" and the SideBar is of 
Class "BaseBar".
ICQ menu uses 
custom controls.
So the simple 
answer is no.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/11/2001 5:02:37 PM:Syntax
Great code. 5 globes from me:-)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/15/2001 2:28:28 PM:Doctor Evil
I great menu modification solution is 
availible from vbAccelerator.  You can 
use ICQ-sytle seperators, icons, and 
easy OwnerDraw options, with an example 
on gradient sidebars.  Menu: 
http://vbaccelerator.com/codelib/cpopmen
u/cnewmenu.htm; Sidebar: 
http://vbaccelerator.com/codelib/cpopmen
u/icqmenu.htm
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/16/2001 2:29:17 AM:Benji
great code though is there away to 
attach it to form menus without the 
popups???
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/18/2001 7:13:39 AM:Mick Doherty
vbAccelerator's example is indeed 
excellent, however, it uses it's own 
menu dll, probably written in C++, so 
you do not really get an Idea of what 
is going on. If you just want pretty 
menus without knowing how they are 
created then use their 
sample.
Benji: I haven't tried that 
but I will look into it. I am sure it 
is just a case of using InsertMenuItem 
and ModifyMenu to update the flag for 
the first menuitem.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/28/2001 2:23:14 AM:Chris Hatton
good work, this will come in handy 5/5 
globes
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/9/2001 11:47:40 PM:Greg C.
Mick Doherty, all of vbAccelerator's 
controls are made from Pure VB (not C++ 
or somthing else, like said above)!! 
you can download the source to, for 
free!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/21/2001 8:40:11 AM:Verburgh Peter
Great stuff ! 5/5 !
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/3/2001 4:48:28 PM:Verburgh Peter
Tnx For sharing this amazing code.
I 
have use it in my application on PSC 
called NetWatch
Tnx !!!!!!!!!!!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/31/2001 11:41:00 AM:Nickels
How to put Icons next to menus like 
this one??
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/1/2001 7:34:30 AM:Mick Doherty
Take a look at my other submission to 
see how to add icons to this type of 
menu.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | RentACoder Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.