 |
|
 |
This code doesn't work on Windows Vista 64 bit with Vista Theme enabled.
The part of logo that is on the caption bar is not drawn.
|
|
|
|
 |
|
 |
Aweo is painting over the caption. It's hard to fix,
Think about that next time you're illegally downloading music; you're not only killing Metallica, you're killing forests and bald eagles and crap. And Smokey Bear's band. - Jake Vinson, of Daily WTF fame
The cloud is a lie - it sucks!
|
|
|
|
 |
|
 |
You could just do this:
InsertMenu(hMenu,
0,
MF_BITMAP|MF_DISABLED|MF_BYPOSITION,
IDB_BITMAP,
(char *)hBitmap);
Where hBitmap is the handle to the bitmap, obtained via a call to LoadBitmap to import it from a resource, 0 is the position on hMenu, and the flags tell Win32 that it's a bitmap, disabled, and it should go at the beginning. Use 0xFFFFFFFF to put it at the end...
So. There you go. Somewhat easier method, but it does mess with your menu bar height a wee bit. Use with, erm, discretion.
|
|
|
|
 |
|
 |
thanks for this discussion
but i want use this featuer with SDI ?
please help me if you can
thanks
|
|
|
|
 |
|
 |
So far I have installed my app on several different machines. All machines running XP home display the logo beautifully. Other machines running Windows 2000 do not display the logo at all.
Has anyone come across this and if so how can I resolve the problem?
Thanks,
|
|
|
|
 |
|
|
 |
|
 |
I want the icon to be in the top right like in internet explorer, how would I do that?
==================================================
The Eclypse
|
|
|
|
 |
|
 |
I use the code in a SDI app.
everything works great. I think you
know of the line between titlebar and
menubar. You solved this problem by drawing the
logo serveral times (e.g. in OnSysCommand).
And yes it works.
The line does not come up anymore.
!BUT!
now I use some code in CMainFrame::OnCreate
to add some item to sys-menu (not the mainframe menu,
the System Menu at the upper left corner)
here is the code:
CMenu* pSysMenu = GetSystemMenu(0);
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty()){
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_SYSMENU_ABOUT, strAboutMenu);
DrawMenuBar();
}
I also removed all from this code and let there only be:
CMenu* pSysMenu = GetSystemMenu(0);
->this is enough to have the error (see below)
After I do this code the line between Titlebar and Menubar
comes up until I choose some Menu.
Example:
I move Mouse over Titlebar - the line comes up.
I doubleclick on the window-border - the line comes up.
but:
I click on Systemmenu (upper left corner)
-> the line does not come up anymore (for this session)
another session:
I doubleclick on the sizer (bottom right) - the line comes up.
I click e.g. on the "File" Menu
-> the line does not come up anymore (for this session)
and so on ....
So why this?
I tried to overwrite nearly all NC - Member Functions
and added Draw Logo -> nothing happens.
I tried to overwrite nearly all Mouse - Member Functions
and added Draw Logo -> nothing happens.
I tried to overwrite nearly all Menu - Member Functions
and added Draw Logo -> nothing happens.
So how could I solve it ?
Hope someone could help me.
Thanks in advance
Ralf
|
|
|
|
 |
|
 |
hi,
i have a popup menu which pops up when the user presses
with the right botton on it.it's located in the tray icon
bar (where the time is displayed).
i wrote it with Win32 API and now i want to add a bitmap
to this popup menu like windows does it on the "start"
button (you can see a bitmap "windows nt workstation" on the left part across the menu).
how i'm suppose to do it ??
thank you !!
|
|
|
|
 |
|
 |
http://codeguru.earthweb.com/menu/EZMenu.shtml
ok?
|
|
|
|
 |
|
 |
thanks.
i went there but what i found was a code in mfc.
it helped me to understand the idea but i don't know how
to "translate" it to Win32 API.
there are some mfc clases like CBitMap and i don't
know what to do with it.
if you can help me . .
|
|
|
|
 |
|
 |
use HBITMAP instead of CBitmap, use use standard windows functions such as 'LoadBitmap' to load it etc, etc.. look up MSDN
|
|
|
|
 |
|
 |
Is there a way to merge a bitmap with a menubar? Been dilegently searching for a way to do this.
I want to load bitmaps across the top of a dailog over the menubar(IDR_MENU1 for example) appearing transparent with out interupting the bitmap with a rectangle border. I can position the bitmap but the menubar dosn't look right and dosn't show up until you click it.
Thinking I might have to subclass CMenu? If so, not sure how to go about it.
Let me know if you can think of a way to do this
|
|
|
|
 |
|
 |
Override the DefWindowProc function, it will work fine!
LRESULT CMainFrame::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
switch(message)
{
case WM_MEASUREITEM:
{
LPMEASUREITEMSTRUCT pMeasureItemStruct = (LPMEASUREITEMSTRUCT)lParam;
if (pMeasureItemStruct->CtlType == ODT_MENU)
{
if (pMeasureItemStruct->itemID == IDM_IMAGE)
pMeasureItemStruct->itemWidth = m_rectLogo.Width() + 5;
}
}
break;
case WM_PAINT:
case WM_SYSCOMMAND:
case WM_INITMENU:
DrawLogo();
}
return CFrameWnd::DefWindowProc(message, wParam, lParam);
}
(load image in OnCreate function, just like doing in OnInitDialog)
Good lucky!
Elto
|
|
|
|
 |
|
 |
It is so simple.
Thanks..
|
|
|
|
 |
|
 |
Ok. This works pretty well. I had initially emailed the author for some more help before really understanding everything that was in here. I still have some problems and one solution:
1) From the code listed here, you also want to add
case WM_ACTIVATEAPP:
to the list so you get
case WM_ACTIVATEAPP:
case WM_PAINT:
case WM_SYSCOMMAND:
case WM_INITMENU:
DrawLogo();
This will keep the image drawn nicely when your application is no longer the window in front. At least in Windows NT, leaving this out meant that when the title bar went inactive when other application gets focus, the title bar covered over the logo.
2) My application never called WM_MEASUREITEM so the above code did not resize my menu item for me. My only way around this so far has been to make the "hidden" menu item's caption a " " to push the other menu items out. Is this supposed to be called during startup or do I need to force it somehow?
3) How does RealPlayer get the icon to show normally on the taskbar when minimized but use something else beside the logo? I can always paint over it by changing the logo to cover over the whole area so it appears no icon is there and changing the offset in BitBlit but is there a better way?
4) How can I force the Window title over past the logo? Again, I can use spaces to pad it out, " Title" but then it shows up that way on the taskbar with the spaces. How did you get the "Fake RealPlayer" title to move over like you did to leave room for the logo?
5) When dragging the window around the screen it really makes a mess trying to paint that window the whole way...
|
|
|
|
 |
|
 |
I have done it and it works just great,
send me an email if you wish that I'll give you the source code for it.
Bye,
Adun
|
|
|
|
 |
|
 |
Thanks.
Please send me your new source.
My Email address is seaousak@hotmail.com
http://go.to/smileseo
Bye
|
|
|
|
 |
|
 |
Please send me your new source.
My Email address is anterbg@icqmail.com
Thank You
|
|
|
|
 |
|
 |
Please send me the source too,
Thanks in advance,
Ruwan.
janapriya2k@yahoo.com
|
|
|
|
 |
|
 |
I am trying to insert the bitmap into a SDI CFormView. I compile and get no errors, but the bitmap logo doesn't appear. By chance, do you have a demo project that shows how to insert this logo in a SDI application?
Please, any response you can give me will be greatly appreciated. The sample project looks cools.
Sincerely,
Erich J. Ruth (an overworked graduate student)
eruth@apexmail.co
|
|
|
|
 |
|
 |
How would I go about doing this is a non dialog based application? I have noticed in my app that the Menu is not being repositioned to it's proper location because WM_MEASUREITEM is never sent to the main frame window. Do I have to subclass my menu and override OnMeasureItem
|
|
|
|
 |