麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁(yè) > 編程 > Delphi > 正文

delphi制作的托盤(pán)程序

2019-11-18 18:09:36
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
 

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實(shí)現(xiàn)攝像頭拍照

下一篇:DELPHI開(kāi)發(fā)技巧

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
學(xué)習(xí)交流
熱門(mén)圖片

新聞熱點(diǎn)

疑難解答

圖片精選

網(wǎng)友關(guān)注

主站蜘蛛池模板: 亚洲最新黄色网址 | 日韩剧情片 | 激情亚洲一区二区 | 午夜电影视频 | 国产精品亚洲激情 | 国产亚洲美女精品久久久2020 | 日本中文字幕久久 | av在线电影网站 | 欧美成人午夜一区二区三区 | 国产午夜亚洲精品理论片大丰影院 | 成人综合在线观看 | 大学生一级毛片在线视频 | 娇妻被各种姿势c到高潮小说 | 国产高清成人久久 | 九九黄色 | 欧美成人精品不卡视频在线观看 | 精品一区二区三区网站 | 国产免费一区 | 黄污网站在线观看 | 羞羞视频免费网站含羞草 | 久久2019中文字幕 | 亚洲xxx视频 | 欧美日韩大片在线观看 | 国产精品视频久久久 | 欧美日韩一 | 中文区永久区 | 亚洲成人自拍电影 | 黄色一级片在线观看 | 久久久久久久久久性 | 国产精品视频免费在线观看 | 日韩字幕在线观看 | 亚洲电影免费观看国语版 | 久久久www成人免费精品 | 欧美成年人视频在线观看 | 免费国产羞羞网站视频 | 91社区电影 | 日日草视频| 99日韩精品视频 | 免费看黄色一级大片 | 日本黄色免费播放 | 秋霞a级毛片在线看 |