procedure TForm1.ShowSystemMenu(const LPt: TPoint); var LMenu: HMENU; LFlags: Cardinal; LCommand: LongWord; begin LMenu := GetSystemMenu(FParentForm.Handle, False); LFlags := TPM_RETURNCMD or GetSystemMetrics(SM_MENUDROPALIGNMENT); LCommand := LongWord(TrackPopupMenu(LMenu, LFlags, LPt.X, LPt.Y, 0, FParentForm.Handle, nil)); PostMessage(FParentForm.Handle, WM_SYSCOMMAND, LCommand, 0); end;
|
请发表评论