以下是引用吹水佬在2023-3-27 16:31:29的发言:
试了一下,删除菜单也会将右上角的按钮删除掉。
只好拦截点击图标消息和右击标题消息。顶层表单右击标题会弹出菜单,不是顶层表单好像没有。
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 = 1
PROCEDURE Destroy
CLEAR EVENTS
ENDPROC
PROCEDURE Init
BINDEVENT(this.hWnd, 0x00A4, this, "myMenuMsg") && WM_NCRBUTTONDOWN equ 00A4h
BINDEVENT(this.hWnd, 0x0112, this, "myMenuMsg") && WM_SYSCOMMAND equ 0112h
ENDPROC
PROCEDURE myMenuMsg(hWnd, Msg, wParam, lParam)
IF (Msg==0x00A4) OR (Msg==0x0112 AND wParam==0xF093)
RETURN
ENDIF
SendMessage(hWnd, Msg, wParam, lParam)
ENDPROC
ENDDEFINE
噢,原来是这样!又学了一招!
非常感谢吹版!