![]() |
|
#1
|
|||
|
|||
Image on the unused Menu bar area ?Is there a way I can put an image on the menu bar thing as shown in the image provided in the link. I have uploaded a snapshot of my project intending to show you exactly where i want the image to be. Please lemme know soon. I have used Win 32 api.
|
|||
|
#2
|
|||
|
|||
|
well, if you attempt to draw on the menu bar using GDI (at least on Windows XP) nothing crashes, but the line (that's what I tried) is invisible. So I'm thinking the only way to do this is using owner-drawn menus.
|
|
#3
|
|||
|
|||
|
Ok so I am gonna create a owner drawn menu. What next . How should I put the image on the menu bar unused area. Can you send me an algo or a code.
|
|
#4
|
|||
|
|||
|
all right. Don't rush me, I've been researching this on MSDN. Looks like you're gonna have to create a right-aligned menu item and owner-draw it. Some actual code in a very short while (at the very latest tomorrow afternoon), right now I'm working on interpreting from MSDN and MFC.
|
|
#5
|
|||
|
|||
|
Yes! I am proud to be able to announce victory over the terrible documentation on MSDN and the innate confusing-ness of the Windows API. But, I have included completely source code to draw a bitmap file on the right-hand corner of the menu bar of your application. Just make sure the bitmap is less than 20 pixels high (this may depend on your resolution; I use 1024x768 and used a handy tool called Meazure [yes it's spelled right--search Google if you want it] to measure the height of the menu bar.
Below is source code. If the included comments are inadequate, reply and I'll explain what I've done. When in doubt, search MSDN. (If you look at enough disparate pages on there, you can usually find what you need, although it took me about two hours of blundering just to find out how to make an owner-drawn menu item!) Note that this code compiles with Dev-C++ 4.9.9.2. source file CPP / C++ / C Code:
.rc (resource) file CPP / C++ / C Code:
header file (referred to in source and resource file as "menudraw.h" but can be named anything, just remember to change the #include lines) CPP / C++ / C Code:
|
|
#6
|
|||
|
|||
|
Hey ubergeek. You are a king man. This code was just too amazing. As in thanks a lot for going thru the code and getting the solution. You were just great. Is there a way to get a line under the menu bar as a demarcation or is it that owner drawn menus dont have a seperator line..
|
|
#7
|
|||
|
|||
|
Well, thanks. I always like helping people with their problems, and it also gives me a feeling of victory when I manage to figure out how to do something like this, that's not explicitly documented.
Quote:
|
|
#8
|
|||
|
|||
Re: Image on the unused Menu bar area ?thank you ubergreek.i am a 13 year old person and had a hard time understanding the msdn documentation.it is a havoc for me.
|
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| loading image | asal | FLTK Forum | 5 | 24-Feb-2006 12:43 |
| Photoshop Tutorial: Make An Inspirational/Mystical Picture | ToddSAFM | Graphics Forum | 9 | 09-Aug-2005 21:32 |
| GIM gidedit - a fltk fluid resize project | cable_guy_67 | FLTK Forum | 2 | 01-Jun-2005 16:00 |
| Checking source codes of image, audio and video files | onauc | C Programming Language | 5 | 26-Feb-2005 22:47 |
| javascript menu | dopee | Web Design Forum | 7 | 31-Jul-2004 00:22 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The