以下是引用su0527在2019-8-12 12:18:10的发言:
能具体点吗?
参考示例:
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
* 窗口标题系统菜单添加菜单项
* 点击窗口标题菜单或<Shift+右键>任务栏图标
*** test.prg ***
_screen.Visible = .F.
DECLARE LONG GetSystemMenu IN User32 LONG, LONG
DECLARE LONG AppendMenu IN User32 LONG, LONG, LONG, STRING@
DECLARE LONG SendMessage IN User32 LONG, LONG, LONG, LONG
of = CREATEOBJECT("form1")
of.show
READ EVENTS
RETURN
DEFINE CLASS form1 AS Form
ShowWindow = 2
AutoCenter = .T.
PROCEDURE Init
LOCAL hMenu
hMenu = GetSystemMenu(this.hWnd, 0)
AppendMenu(hMenu, 0, 0x1001, "菜单项1")
AppendMenu(hMenu, 0, 0x1002, "菜单项2")
AppendMenu(hMenu, 0, 0x1003, "菜单项3")
BINDEVENT(this.hWnd, 0x0112, this, "myMenuCmd") && WM_SYSCOMMAND 0x0112
ENDPROC
PROCEDURE UnLoad
CLEAR EVENTS
ENDPROC
PROCEDURE myMenuCmd(hWnd, Msg, wParam, lParam)
DO CASE
CASE wParam == 0x1001
MESSAGEBOX("菜单项1")
CASE wParam == 0x1002
MESSAGEBOX("菜单项2")
CASE wParam == 0x1003
MESSAGEBOX("菜单项3")
ENDCASE
SendMessage(hWnd, Msg, wParam, lParam)
ENDPROC
ENDDEFINE