Change the system menu 4 ur form!
Changes your forms system menu (visible when you right click on the forms titlebar or press [Alt] + [Space]) to what every you want, and does it really easily too!
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
'~~~~~~~~~~~~~~~ '~~~~~~~~~~~~~~~ '~~~~~~~~~~~~~~~ ' place a button on the form called "command1" and test ' run this project. Notice how BEFORE you click the button ' the forms system menu (press [Alt] + [Space]) is the ' normal on. Now press the button! It has changed! :) 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 ' ^ APIs required 4 menu change! Const MF_STRING = &H0& ' ^ CONSTANTs required 4 menu change! Private Sub command1_click() Dim hMenu As Long, MenuItem As Long hMenu = GetSystemMenu(Me.hwnd, 0) MenuItem = GetMenuItemID(hMenu, 0) ModifyMenu hMenu, MenuItem, MF_STRING, MenuItem, "Restore my Bollocks" MenuItem = GetMenuItemID(hMenu, 1) ModifyMenu hMenu, MenuItem, MF_STRING, MenuItem, "Move u'r fat arse!" MenuItem = GetMenuItemID(hMenu, 6) ModifyMenu hMenu, MenuItem, MF_STRING, MenuItem, "Bugger off!" End Sub
Original Comments (3)
Recovered from Wayback Machine