zoukankan      html  css  js  c++  java
  • delphi 程序最小化和最大化都不在任务栏显示

    delphi   程序不在任务栏显示

    
    

    published
    procedure CreateParams( var Params: TCreateParams ); override;
    procedure WndProc(var Message: TMessage); override;







    procedure
    TmainFrm.CreateParams( var Params: TCreateParams ); begin inherited CreateParams( Params ); Params.ExStyle := WS_EX_TOOLWINDOW; end; procedure TmainFrm.WndProc(var Message: TMessage); begin inherited WndProc(Message); if (not Application.MainFormOnTaskBar) and (Message.Msg = WM_SHOWWINDOW) then begin ShowWindow(Application.Handle, SW_HIDE); SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW); end; end;

     上面的方法 在桌面上会显示一个小窗口

    另外的方式  

    procedure WMSysCommand(var Message: TWMSysCommand);message WM_SYSCOMMAND;
    
    
    //如果是关闭或者最小化  不显示主窗口
    procedure TmainFrm.WMSysCommand(var Message: TWMSysCommand);
    begin
      if (Message.CmdType  = SC_MINIMIZE) or (Message.CmdType  = SC_CLOSE) then
        Self.Visible:=False // 隐藏窗体
      else
        Inherited;
    end;

    //双击右下角 小图标 显示出来

    Self.Visible:=true// 隐藏窗体
  • 相关阅读:
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    How to build and run ARM Linux on QEMU from scratch
    How to debug Android Native Application with eclipse
  • 原文地址:https://www.cnblogs.com/iwana/p/13214086.html
Copyright © 2011-2022 走看看