ich möchte eine Grafik am Rand meines Kontextmenüs (Rechtsklickmenü), so wie im Startmenü von Windows (klassisch fals XP) am Rand wo "Windows XP Professional" steht

... wäre echt Super

Danke Lukaso
Zusammenkleben hmmm.... und wie soll ich dass bitte genau machen, habe garade irgendwie keinen planwichtel hat geschrieben: Ein Fenster and das Pop Up kleben, wenn du weist was ich meine.
Also händisch zusammenbasteln.
der Effekt wäre der selbe.
Du mußt das Menu selber zeichnen.Lukaso hat geschrieben:hat keiner eine Idee wie das bewerkställigen könnte?
Code: Alles auswählen
;
; Owner Drawn PopUp Menu
;
; by Danilo, 10.11.2004 - german forum
;
;
#MIIM_FTYPE = $100
#MIIM_TYPE = $10
#MIIM_STRING = $40
Global hMenu,hBmp,hBmpWidth, tempDC
Procedure GetMenuHeight(hWnd,Menu)
hDC = GetDC_(hWnd)
GetTextExtentPoint32_(hDC,"X",1,size.SIZE);
ReleaseDC_(hWnd,hDC)
ProcedureReturn GetMenuItemCount_(Menu)*size\cy
EndProcedure
Procedure$ GetMenuIDName(itemID)
mii.MENUITEMINFO
mii\cbSize = SizeOf(MENUITEMINFO)
mii\fMask = #MIIM_STRING;|#MIIM_TYPE
;mii\fType = #MFT_STRING
mii\dwTypeData = AllocateMemory(1024)
mii\cch = 1023
If GetMenuItemInfo_(hMenu,itemID,0,mii)
ItemName$ = PeekS(mii\dwTypeData)
EndIf
FreeMemory(mii\dwTypeData)
ProcedureReturn ItemName$
EndProcedure
Procedure WndProc(hWnd,Msg,wParam,lParam)
Select Msg
Case #WM_MEASUREITEM
*mis.MEASUREITEMSTRUCT = lParam
If *mis
hDC = GetDC_(hWnd)
ItemName$ = GetMenuIDName(*mis\itemID)
If ItemName$ = ""
ItemName$ = "X" ; for menu bars
EndIf
GetTextExtentPoint32_(hDC,ItemName$,Len(ItemName$),size.SIZE);
*mis\itemWidth = size\cx+hBmpWidth
*mis\itemHeight = size\cy
ReleaseDC_(hWnd,hDC)
ProcedureReturn #TRUE
EndIf
Case #WM_DRAWITEM
*dis.DRAWITEMSTRUCT = lParam
If *dis
If *dis\itemState & #ODS_SELECTED
colText = SetTextColor_(*dis\hDC,GetSysColor_(#COLOR_HIGHLIGHTTEXT))
colBack = SetBkColor_( *dis\hDC,GetSysColor_(#COLOR_HIGHLIGHT))
Else
colText = SetTextColor_(*dis\hDC,GetSysColor_(#COLOR_MENUTEXT))
colBack = SetBkColor_( *dis\hDC,GetSysColor_(#COLOR_MENU))
EndIf
x = *dis\rcItem\left + GetSystemMetrics_(#SM_CXMENUCHECK) + hBmpWidth
y = *dis\rcItem\top
ItemName$ = GetMenuIDName(*dis\itemID)
If ItemName$
ExtTextOut_(*dis\hDC,x,y+1,#ETO_OPAQUE,@*dis\rcItem,ItemName$,Len(ItemName$),0)
Else
hDC = GetDC_(hWnd)
GetTextExtentPoint32_(hDC,"X",1,size.SIZE);
ReleaseDC_(hWnd,hDC)
y + size\cy/2-1
colText = SetTextColor_(*dis\hDC,GetSysColor_(#COLOR_MENUTEXT))
colBack = SetBkColor_( *dis\hDC,GetSysColor_(#COLOR_MENUTEXT))
Pen=CreatePen_(#PS_SOLID,1,GetSysColor_(#COLOR_GRAYTEXT))
oldPen=SelectObject_(*dis\hDC,Pen)
MoveToEx_(*dis\hDC,0,y,@tmp.POINT)
LineTo_(*dis\hDC,*dis\rcItem\right,y)
SelectObject_(*dis\hDC,oldPen)
DeleteObject_(Pen)
EndIf
BitBlt_(*dis\hDC,0,0,hBmpWidth,1000,tempDC,0,0,#SRCCOPY)
SetTextColor_(*dis\hDC,colText)
SetBkColor_( *dis\hDC,colBack)
ProcedureReturn #TRUE
EndIf
Case #WM_INITMENU
If tempDC=0
hDC = GetDC_(hWnd)
tempDC = CreateCompatibleDC_(hDC)
SelectObject_(tempDC,hBmp)
ReleaseDC_(hWnd,hDC)
EndIf
EndSelect
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
Procedure OwnerDrawnMenu(Menu)
mii.MENUITEMINFO
mii\cbSize = SizeOf(MENUITEMINFO)
mii\fMask = #MIIM_FTYPE
mii\fType = #MFT_OWNERDRAW
For i = 0 To GetMenuItemCount_(Menu)-1
SetMenuItemInfo_(Menu,i,#TRUE,mii)
Next i
EndProcedure
;>---------------------------------------
hMenu = CreatePopupMenu(0)
If hMenu
For i = 1 To 10
MenuItem(100+i,"Item "+Str(i))
Next i
MenuBar()
OpenSubMenu("Sub")
MenuItem(1, "SubMenu 1")
MenuItem(2, "SubMenu 2")
CloseSubMenu()
MenuBar()
MenuItem(3, "Quit")
Else
End
EndIf
If OpenWindow(0,200,200,300,300,#PB_Window_SystemMenu,"OwnerDrawn PopUp Menu")
SetWindowCallback(@WndProc())
#barwidth = 30
height = GetMenuHeight(WindowID(),hMenu)
hBmp = CreateImage(0,#barwidth,height)
hBmpWidth = #barwidth
StartDrawing(ImageOutput())
stp.f = 255/height
For y = height To 0 Step -1
Line(0,y,#barwidth,0,RGB(0,0,b.f))
b+stp
Next y
Locate(3,height-20)
DrawingMode(1)
FrontColor($FF,$FF,$00)
DrawText("Yo!")
StopDrawing()
OwnerDrawnMenu(hMenu)
Repeat
Select WaitWindowEvent()
Case #WM_RButtonDown
DisplayPopupMenu(0,WindowID())
Case #WM_LButtonDown
DisplayPopupMenu(0,WindowID())
Case #PB_EventMenu
menu = EventMenuID()
If menu = 3
Break
EndIf
MessageRequester("MENU","Menu Event: "+Str(menu),0)
Case #PB_EventCloseWindow
Break
EndSelect
ForEver
EndIf
If tempDC
DeleteDC_(tempDC)
EndIf