|
-
May 27th, 2000, 03:36 PM
#1
Thread Starter
Addicted Member
Hi,
How can I append a Form's System Menu and And also detect when it has been clicked?
-
May 29th, 2000, 05:14 AM
#2
What do you man by append to the form's system menu? You mean like add menu to the Restore, Maximize, Minimize, Close etc.?
-
May 29th, 2000, 10:18 AM
#3
Thread Starter
Addicted Member
Yes, That is exactly what I'm talking about
Yes Megatron,
That is exactly what I'm talking about. The menu that appears when you click onthe top left hand corner of a form.
-
May 30th, 2000, 07:45 AM
#4
Hmmm, I think that's a default set by Windows, but there might be a way around it. I'll try testing some things out and get back to you in a couple of days.
-
May 30th, 2000, 03:47 PM
#5
Thread Starter
Addicted Member
I think it has something to do with the AppendMenu API
I think it has something to do with the AppendMenu API
-
May 30th, 2000, 08:31 PM
#6
Thread Starter
Addicted Member
-
May 31st, 2000, 02:16 AM
#7
Yes, that does look like the solution. I think you can also add to normal menus using that API.
-
Jun 3rd, 2000, 08:28 AM
#8
Wait a sec. The InsertMenuItem API adds a menu item to a menu that already exsists. This is probably what you're looking for.
-
Jun 4th, 2000, 12:55 PM
#9
New Member
Excuse me,where's the sample?
Hi,where's the sample?Can you let me have a look?
-
Jun 4th, 2000, 06:20 PM
#10
Thread Starter
Addicted Member
I don't know your email address Netfox
I don't know your email address Netfox
-
Jun 5th, 2000, 02:34 AM
#11
-
Jun 7th, 2000, 02:56 AM
#12
Try this. Make a Form with a CommandButton and put this code in the Declarations section of the Form.
Code:
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
Private Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenu Lib "user32" (ByVal hwnd As Long, ByVal hMenu As Long) As Long
Const MF_STRING = &H0&
Private Sub Command1_Click()
Dim mnuMenu As Long, mnuMenuI As Long
mnuMenu = GetSystemMenu(Me.hwnd, 0)
mnuMenuI = GetMenuItemID(mnuMenu, 0)
ModifyMenu mnuMenu, mnuMenuI, MF_STRING, mnuMenuI, "Restore my Bollocks"
mnuMenuI = GetMenuItemID(mnuMenu, 1)
ModifyMenu mnuMenu, mnuMenuI, MF_STRING, mnuMenuI, "Move u'r fat arse!"
mnuMenuI = GetMenuItemID(mnuMenu, 6)
ModifyMenu mnuMenu, mnuMenuI, MF_STRING, mnuMenuI, "Bugger off!"
End Sub
-
Jun 8th, 2000, 06:44 AM
#13
Just placing this at thre top incase you missed it.
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
|