Set window border and title bar colors?
Posted: Thu Nov 18, 2004 12:26 am
Anyone know how to do this? I already know how to set the background color.
Here is code for a partially colored window and menu. But I want the borders and back ground and stuff to change, too:
Here is code for a partially colored window and menu. But I want the borders and back ground and stuff to change, too:
Code: Select all
#MIM_BACKGROUND = 2 ; applies to menubar background
#MIM_APPLYTOSUBMENUS = $80000000 ; applies to submenu items
Structure myMENUINFO
cbSize.l
fMask.l
dwStyle.l
cyMax.l
hbrBack.l
dwContextHelpID.l
dwMenuData.l
EndStructure
hwnd=OpenWindow(0, 200, 200, 400, 300, #PB_Window_SystemMenu+#PB_Window_Sizegadget, "Menu Image Background")
brus=CreateSolidBrush_(RGB(64,64,64))
SetClassLong_(WindowID(),#GCL_HBRBACKGROUND,brus)
hMenu = CreateMenu(0, WindowID())
MenuTitle("Title 1")
MenuItem(1, "Item Number 1" + Chr(9) + "Ctrl+1")
MenuItem(2, "Item Number 2" + Chr(9) + "Ctrl+2")
MenuItem(3, "Item Number 3" + Chr(9) + "Ctrl+3")
MenuItem(4, "Item Number 4" + Chr(9) + "Ctrl+4")
MenuTitle("Title 2")
MenuItem(5, "Item Number 5" + Chr(9) + "Ctrl+5")
MenuItem(6, "Item Number 6" + Chr(9) + "Ctrl+6")
MenuItem(7, "Item Number 7" + Chr(9) + "Ctrl+7")
MenuItem(8, "Item Number 8" + Chr(9) + "Ctrl+8")
rect.rect
rect\left=0
rect\top=0
rect\right=200
rect\bottom=200
myMenu.myMENUINFO
myMenu\cbSize=SizeOf(myMENUINFO)
myMenu\fMask=#MIM_BACKGROUND+#MIM_APPLYTOSUBMENUS
myMenu\hbrBack=brus
SetMenuInfo_(hMenu, myMenu)
SetMenu_(WindowID(),hMenu)
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow