|
-
Oct 8th, 2000, 11:03 AM
#1
Thread Starter
Hyperactive Member
You know on programs like word, and excel you click File or hit alt+F and you will see next to new a little sheet of paper thingy, and next to open you see a folder. How do you put thos pics in?
-
Oct 8th, 2000, 11:10 AM
#2
Take a look at this example.
Still need more? Search www.planet-source-code.com for "Menu Icons".
-
Oct 8th, 2000, 11:14 AM
#3
Code:
Public Declare Function GetMenu Lib "user32" _
(ByVal hwnd As Long) As Long
Public Declare Function GetSubMenu Lib "user32" _
(ByVal hMenu As Long, ByVal nPos As Long) As Long
Public Declare Function GetMenuItemID Lib "user32" _
(ByVal hMenu As Long, ByVal nPos As Long) As Long
Public Declare Function SetMenuItemBitmaps Lib "user32" _
(ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As _
Long, ByVal hBitmapUnchecked As Long, ByVal hBitmapChecked _
As Long) As Long
Function Pic_Menu(HdcPicC As Long, HdcPicUnC As Long)
Dim lngMenu As Long
Dim lngSubMenu As Long
Dim lngMenuItemID As Long
Dim lngRet As Long
lngMenu = GetMenu(Form1.hwnd)
lngSubMenu = GetSubMenu(lngMenu, 0)
lngMenuItemID = GetMenuItemID(lngSubMenu, 2)
lngRet = SetMenuItemBitmaps(lngMenu, lngMenuItemID, 0, _
Picture1.Picture, Picture1.Picture)
End Function
This example supports only 13x13 bitmaps.
-
Oct 8th, 2000, 11:20 AM
#4
Fanatic Member
If you make menus with a couple of classes I've made, you can have menus that are exactly like the VB menus 
I'm e-mailing it to you now...
-
Oct 8th, 2000, 05:58 PM
#5
Code:
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As Long, ByVal hBitmapChecked As Long) As Long
Const MF_BITMAP = &H4&
Private Sub Command1_Click()
Dim hMenu As Long, hSub As Long, ItemID As Long
hMenu = GetMenu(Me.hwnd)
hSub = GetSubMenu(hMenu, 0)
ItemID = GetMenuItemID(hSub, 0)
SetMenuItemBitmaps hMenu, ItemID, MF_BITMAP, Picture1.Picture, Picture1.Picture
End Sub
-
Oct 22nd, 2000, 05:46 AM
#6
Hyperactive Member
Just a quick question about the code above .
When I use it my Icons seem to lose they're transparency .
I mean I have an icon with a transparent background , but
when it loads up into the menu it gets sort of discolored . How can I avoid that ?
[]P
Visual Basic 6 SP4 on win98se
QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!
-
Oct 22nd, 2000, 05:49 AM
#7
transcendental analytic
I think you have to use 4 bit colors
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 22nd, 2000, 05:58 AM
#8
Hyperactive Member
Ouch!!!! ok thanks for the idea . Is there away around this ?
Visual Basic 6 SP4 on win98se
QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!
-
Oct 22nd, 2000, 06:11 AM
#9
transcendental analytic
I'm sure there is (look at all the menus in some apps), but nobody seems to know
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|