a亚洲精品_精品国产91乱码一区二区三区_亚洲精品在线免费观看视频_欧美日韩亚洲国产综合_久久久久久久久久久成人_在线区

首頁 > 編程 > Delphi > 正文

delphi制作的托盤程序

2019-11-18 18:09:36
字體:
來源:轉載
供稿:網友
 

unit uMain;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, shellapi,
  Menus, Buttons, ExtCtrls;
const
  mousemsg = wm_user + 1;
  iid = 100;
type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    Panel1: TPanel;
    SpeedButton1: TSpeedButton;
    SpeedButton6: TSpeedButton;
    SpeedButton7: TSpeedButton;
    SpeedButton8: TSpeedButton;
    SpeedButton9: TSpeedButton;
    SpeedButton10: TSpeedButton;
    PopupMenu1: TPopupMenu;
    exit1: TMenuItem;
    SpeedButton2: TSpeedButton;
    PRocedure SQLLMClick(Sender: TObject);
    procedure N2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure exit1Click(Sender: TObject);
  private
    { Private declarations }
      procedure mousemessage(var message: tmessage); message
      mousemsg;
  public
    { Public declarations }
    procedure exec(sender: tobject);
  end;

var
  Form1: TForm1;
  ntida: TNotifyIcondataA;
implementation

{$R *.DFM}
procedure TForm1.mousemessage(var message: tmessage);
var
  mousept: TPoint;
begin
  inherited;
  if message.LParam = wm_rbuttonup then begin
      getcursorpos(mousept);
      popupmenu1.popup(mousept.x, mousept.y);
    end;
  if message.LParam = wm_lbuttonup then begin
      ShowWindow(Handle, SW_SHOW);
      ShowWindow(application.handle, SW_SHOW);
      SetWindowLong(Application.Handle, GWL_EXSTYLE,
        not (GetWindowLong(Application.handle, GWL_EXSTYLE)
        or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW));
    end;
  message.Result := 0;
end;

Procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caNone;
  ShowWindow(Handle, SW_HIDE);
  ShowWindow(Application.Handle, SW_HIDE);
  SetWindowLong(Application.Handle, GWL_EXSTYLE,
    not (GetWindowLong(Application.handle, GWL_EXSTYLE)
    or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW));
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ntida.cbSize := sizeof(tnotifyicondataa);
  ntida.Wnd := handle;
  ntida.uID := iid;  ntida.uFlags := nif_icon + nif_tip +
    nif_message;  ntida.uCallbackMessage := mousemsg;
  ntida.hIcon := Application.Icon.handle;
  ntida.szTip := 'Icon';
  shell_notifyicona(NIM_ADD, @ntida);
end;

procedure TForm1.exit1Click(Sender: TObject);
begin
  ntida.cbSize := sizeof(tnotifyicondataa);
  ntida.wnd := handle;
  ntida.uID := iid;
  ntida.uFlags := nif_icon + nif_tip + nif_message;
  ntida.uCallbackMessage := mousemsg;
  ntida.hIcon := Application.Icon.handle;
  ntida.szTip := 'Icon';
  shell_notifyicona(NIM_DELETE, @ntida);
  Application.Terminate;
end;

end.


上一篇:DELPHI實現攝像頭拍照

下一篇:DELPHI開發技巧

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
學習交流
熱門圖片

新聞熱點

疑難解答

圖片精選

網友關注

主站蜘蛛池模板: 热久久这里只有精品 | 日韩成人影院 | 91九色在线观看 | 欧美黑人xxx| 在线观看免费视频日韩 | 男女国产视频 | 伊人免费网 | 国产一级二级毛片 | 免费黄色在线观看 | 男人的天堂一级片 | 精品国产欧美一区二区三区成人 | 女同理伦片在线观看禁男之园 | 国产精品嫩草33av在线 | 污片在线免费看 | 男女福利| 欧美日一区二区 | h片在线 | 人人鲁人人莫一区二区三区 | 国产精品久久久久久吹潮 | 日本欧美在线观看 | 欧美视频免费看 | 久久人 | 久久精品99 | 99久久99 | 午夜精品久久久久久久 | 久久精品视频7 | 色www精品视频在线观看 | 四虎永久在线 | 色激情五月 | 久久午夜影视 | 秋霞av电影 | 久久精品一区视频 | 九色视频网站 | 欧美日韩一区二区三区在线观看 | 国产目拍亚洲精品99久久精品 | 精品久久网| 五月婷婷六月激情 | 青草免费视频 | 久久久久.com | 欧美一区二区三区在线看 | 久久久国产一区二区三区四区小说 |