zoukankan      html  css  js  c++  java
  • 截获标题栏按钮事件

    改写 procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
    消息处理函数。

    其中 TWMSysCommand 定义如下:

    TWMSysCommand = packed record
    Msg: Cardinal;
    case CmdType: Longint of
    SC_HOTKEY: (
    ActivateWnd: HWND);
    SC_KEYMENU: (
    Key: Word);
    SC_CLOSE, SC_HSCROLL, SC_MAXIMIZE, SC_MINIMIZE, SC_MOUSEMENU, SC_MOVE,
    SC_NEXTWINDOW, SC_PREVWINDOW, SC_RESTORE, SC_SCREENSAVE, SC_SIZE,
    SC_TASKLIST, SC_VSCROLL: (
    XPos: Smallint;
    YPos: Smallint;
    Result: Longint);
    end;

    例: 
    procedure TBrxMainForm.WMSysCommand(var Message: TWMSysCommand);
    begin
    if (Message.CmdType = SC_CLOSE)
    or (Message.CmdType = SC_MINIMIZE)
    or (Message.CmdType = SC_MOUSEMENU)
    or (Message.CmdType = SC_NEXTWINDOW)
    or (Message.CmdType = SC_PREVWINDOW) then
    begin
    inherited;
    end;
    ...
    end;

  • 相关阅读:
    JS生成Guid
    MVC——分页
    MVC入门——删除页
    MVC入门——编辑页
    MVC入门——详细页
    MVC入门——列表页
    MVC入门——增
    pandas使用
    简单线性回归预测实现
    flask 自定义url转换器
  • 原文地址:https://www.cnblogs.com/spiritofcloud/p/3978315.html
Copyright © 2011-2022 走看看