亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cooltray.pas

?? Clock 桌面時(shí)鐘 日歷 陰歷 看到的delphi程序 轉(zhuǎn)發(fā)
?? PAS
字號(hào):
unit CoolTray;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Menus, ShellApi, ExtCtrls;

const
  { Define user-defined message sent by the trayicon. We avoid low user-defined
    messages that are used by Windows itself (eg. WM_USER+1 = DM_SETDEFID). }
  WM_TRAYNOTIFY = WM_USER + 1024;
  // Constant used for recreating trayicon on system traybar recover
  IconID = 1;
  // Constants used for balloon hint feature
  WM_RESETTOOLTIP = WM_USER + 1025;
  NIIF_NONE    = $00000000;
  NIIF_INFO    = $00000001;
  NIIF_WARNING = $00000002;
  NIIF_ERROR   = $00000003;
  NIF_INFO     = $00000010;

type
  { You can use the TNotifyIconData record structure defined in shellapi.pas.
    However, WinME, Win2000, and WinXP have expanded this structure. We define
    a similar structure, TNotifyIconDataEx. }
  TNotifyIconDataEx = record
    cbSize: DWORD;
    Wnd: HWND;
    uID: UINT;
    uFlags: UINT;
    uCallbackMessage: UINT;
    hIcon: HICON;
//    szTip: array[0..63] of AnsiChar;
    szTip: array[0..127] of AnsiChar;      // 0..63 of WideChar in stead?
    dwState: DWORD;
    dwStateMask: DWORD;
    szInfo: array[0..255] of AnsiChar;
    uTimeout: UINT; // union with uVersion: UINT;
    szInfoTitle: array[0..63] of AnsiChar;
    dwInfoFlags: DWORD;
  end;

  TBalloonHintIcon = (bitNone, bitInfo, bitWarning, bitError);
  TBalloonHintTimeOut = 10..60;   // Windows defines 10-60 secs. as min-max

  TCycleEvent = procedure(Sender: TObject; NextIndex: Integer) of object;

  TCoolTrayIcon = class(TComponent)
  private
    FIcon: TIcon;
    FHint: String;
    FShowHint: Boolean;
    FPopupMenu: TPopupMenu;
    FLeftPopup: Boolean;
    FOnClick,
    FOnDblClick: TNotifyEvent;
    FOnMouseDown,
    FOnMouseUp: TMouseEvent;
    FOnMouseMove: TMouseMoveEvent;
    FClickStart: Boolean;
    CycleTimer: TTimer;                // For icon cycling
    FIconIndex: Integer;               // Current index in imagelist
    FIconList: TImageList;
    FCycleIcons: Boolean;
    FCycleInterval: Cardinal;
    FWindowHandle: HWND;               // Window handle (not general handle)
    procedure SetCycleIcons(Value: Boolean);
    procedure SetCycleInterval(Value: Cardinal);
    procedure TimerCycle(Sender: TObject);
    procedure HandleIconMessage(var Msg: TMessage);
    function InitIcon: Boolean;
    procedure SetIcon(Value: TIcon);
    procedure SetIconList(Value: TImageList);
    procedure SetIconIndex(Value: Integer);
    procedure SetHint(Value: String);
    procedure SetShowHint(Value: Boolean);
    procedure PopupAtCursor;
  protected
    IconData: TNotifyIconDataEx;       // Data of the tray icon wnd.
    function HideIcon: Boolean;
    procedure Click; dynamic;
    procedure DblClick; dynamic;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
      X, Y: Integer); dynamic;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
      X, Y: Integer); dynamic;
    procedure MouseMove(Shift: TShiftState; X, Y: Integer); dynamic;
    procedure Notification(AComponent: TComponent; Operation: TOperation);
      override;
    function ShowIcon: Boolean;
    function ModifyIcon: Boolean;
    function RemoveIcon: Boolean;
  public
    property Handle: HWND read IconData.Wnd;
    property WindowHandle: HWND read FWindowHandle;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    function Refresh: Boolean;
    function ShowBalloonHint(Title: String; Text: String; IconType: TBalloonHintIcon;
      TimeoutSecs: TBalloonHintTimeOut): Boolean;
    procedure Init;
  published
    // Properties:
    property IconList: TImageList read FIconList write SetIconList;
    property CycleIcons: Boolean read FCycleIcons write SetCycleIcons
      default False;
    property CycleInterval: Cardinal read FCycleInterval
      write SetCycleInterval;
    property Hint: String read FHint write SetHint;
    property ShowHint: Boolean read FShowHint write SetShowHint
      default True;
    property Icon: TIcon read FIcon write SetIcon stored True;
    property IconIndex: Integer read FIconIndex write SetIconIndex;
    property PopupMenu: TPopupMenu read FPopupMenu write FPopupMenu;
    property LeftPopup: Boolean read FLeftPopup write FLeftPopup
      default False;
    // Events:
    property OnClick: TNotifyEvent read FOnClick write FOnClick;
    property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
    property OnMouseDown: TMouseEvent read FOnMouseDown write FOnMouseDown;
    property OnMouseUp: TMouseEvent read FOnMouseUp write FOnMouseUp;
    property OnMouseMove: TMouseMoveEvent read FOnMouseMove write FOnMouseMove;
  end;

procedure Register;

implementation

{--------------------- TCoolTrayIcon ----------------------}

constructor TCoolTrayIcon.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FShowHint := True;         // Show hint by default
//  SettingPreview := False;

  FIcon := TIcon.Create;

  IconData.cbSize := SizeOf(TNotifyIconDataEx);
  // IconData.wnd points to procedure to receive callback messages from the icon
  IconData.wnd := AllocateHWnd(HandleIconMessage);
  // Add an id for the tray icon
  IconData.uId := IconID;
  // We want icon, message handling, and tooltips by default
  IconData.uFlags := NIF_ICON + NIF_MESSAGE + NIF_TIP;
  // Message to send to IconData.wnd when event occurs
  IconData.uCallbackMessage := WM_TRAYNOTIFY;

  FWindowHandle := GetWindowLong(IconData.wnd, GWL_HWNDPARENT);

  CycleTimer := TTimer.Create(Self);
  CycleTimer.Enabled := False;
  CycleTimer.Interval := FCycleInterval;
  CycleTimer.OnTimer := TimerCycle;

end;


destructor TCoolTrayIcon.Destroy;
begin
  RemoveIcon;     // Remove the icon from the tray
  
  FIcon.Free;                // Free the icon
  DeallocateHWnd(IconData.Wnd);   // Free the tray window
  CycleTimer.Free;
    
  inherited Destroy;
end;


procedure TCoolTrayIcon.Init;
begin
  ModifyIcon;
  ShowIcon;
end;


procedure TCoolTrayIcon.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  { Check if either the imagelist or the popup menu is about
    to be deleted }
  if (AComponent = IconList) and (Operation = opRemove) then
  begin
    FIconList := nil;
    IconList := nil;
  end;
  if (AComponent = PopupMenu) and (Operation = opRemove) then begin
    FPopupMenu := nil;
    PopupMenu := nil;
  end;

end;

procedure TCoolTrayIcon.HandleIconMessage(var Msg: TMessage);

  function ShiftState: TShiftState;
  // Return the state of the shift, ctrl, and alt keys
  begin
    Result := [];
    if GetAsyncKeyState(VK_SHIFT) < 0 then
      Include(Result, ssShift);
    if GetAsyncKeyState(VK_CONTROL) < 0 then
      Include(Result, ssCtrl);
    if GetAsyncKeyState(VK_MENU) < 0 then
      Include(Result, ssAlt);
  end;

var
  Pt: TPoint;
  Shift: TShiftState;
begin
  if Msg.Msg = WM_TRAYNOTIFY then
  // Take action if a message from the icon comes through
  begin
    case Msg.lParam of

      WM_MOUSEMOVE: begin
        Shift := ShiftState;
        GetCursorPos(Pt);
        MouseMove(Shift, Pt.X, Pt.Y);
      end;

      WM_LBUTTONDOWN:
      begin
        Shift := ShiftState + [ssLeft];
        GetCursorPos(Pt);
        MouseDown(mbLeft, Shift, Pt.X, Pt.Y);
        FClickStart := True;
        if FLeftPopup then
            PopupAtCursor;
      end;

      WM_RBUTTONDOWN:
      begin
        Shift := ShiftState + [ssRight];
        GetCursorPos(Pt);
        MouseDown(mbRight, Shift, Pt.X, Pt.Y);
        PopupAtCursor;
      end;

      WM_MBUTTONDOWN:
      begin
        Shift := ShiftState + [ssMiddle];
        GetCursorPos(Pt);
        MouseDown(mbMiddle, Shift, Pt.X, Pt.Y);
      end;

      WM_LBUTTONUP:
      begin
        Shift := ShiftState + [ssLeft];
        GetCursorPos(Pt);
        if FClickStart then       // Then WM_LBUTTONDOWN was called before
        begin
          FClickStart := False;
          Click;                  // We have a click
        end;
        MouseUp(mbLeft, Shift, Pt.X, Pt.Y);
      end;

      WM_RBUTTONUP:
        begin
          Shift := ShiftState + [ssRight];
          GetCursorPos(Pt);
          MouseUp(mbRight, Shift, Pt.X, Pt.Y);
        end;

      WM_MBUTTONUP:
        begin
          Shift := ShiftState + [ssMiddle];
          GetCursorPos(Pt);
          MouseUp(mbMiddle, Shift, Pt.X, Pt.Y);
        end;

      WM_LBUTTONDBLCLK:
          DblClick;
      end;
  end

  else        // Messages that didn't go through the icon
    case Msg.Msg of
      { Windows sends us a WM_QUERYENDSESSION message when it prepares
        for shutdown. Msg.Result must not return 0, or the system will
        be unable to shut down. }
      WM_QUERYENDSESSION: begin
//showmessage('WM_QUERYENDSESSION');
//        PostQuitMessage(0);
        Msg.Result := 1;
      end;
{
      WM_DESTROY: begin
showmessage('WM_DESTROY');
        PostQuitMessage(0);
        Msg.Result := 0;
      end;
}
{
      WM_ENDSESSION: begin
//showmessage('WM_ENDSESSION');
        Msg.Result := 0;
      end;
}
    else      // Handle all other messages with the default handler
      Msg.Result := DefWindowProc(IconData.Wnd, Msg.Msg, Msg.wParam, Msg.lParam);
    end;
end;


procedure TCoolTrayIcon.SetIcon(Value: TIcon);
begin
  FIcon.Assign(Value);
  ModifyIcon;
end;

procedure TCoolTrayIcon.SetCycleIcons(Value: Boolean);
begin
  FCycleIcons := Value;
  if Value then
    SetIconIndex(0);
  CycleTimer.Enabled := Value;
end;


procedure TCoolTrayIcon.SetCycleInterval(Value: Cardinal);
begin
  FCycleInterval := Value;
  CycleTimer.Interval := FCycleInterval;
end;


procedure TCoolTrayIcon.SetIconList(Value: TImageList);
begin
  FIconList := Value;
{
  // Set CycleIcons = false if IconList is nil
  if Value = nil then
    SetCycleIcons(False);
}
  SetIconIndex(0);
end;


procedure TCoolTrayIcon.SetIconIndex(Value: Integer);
begin
  if FIconList <> nil then
  begin
    FIconIndex := Value;
    if Value >= FIconList.Count then
      FIconIndex := FIconList.Count -1;
    FIconList.GetIcon(FIconIndex, FIcon);
  end else
    FIconIndex := 0;

  ModifyIcon;
end;


procedure TCoolTrayIcon.SetHint(Value: String);
begin
  FHint := Value;
  ModifyIcon;
end;


procedure TCoolTrayIcon.SetShowHint(Value: Boolean);
begin
  FShowHint := Value;
  ModifyIcon;
end;


function TCoolTrayIcon.InitIcon: Boolean;
// Set icon and tooltip
begin
  IconData.hIcon := FIcon.Handle;
  if (FHint <> '') and (FShowHint) then
    StrLCopy(IconData.szTip, PChar(FHint), SizeOf(IconData.szTip)-1)
      // StrLCopy must be used since szTip is only 64 bytes
  else
    IconData.szTip := '';

  Result := True;
end;


function TCoolTrayIcon.ShowIcon: Boolean;
// Add/show the icon on the tray
begin
  Result := InitIcon;
  if Result then
    Result := Shell_NotifyIcon(NIM_ADD, @IconData);
end;


function TCoolTrayIcon.HideIcon: Boolean;
// Remove/hide the icon from the tray
begin
  Result := InitIcon;
  if Result then
    Result := RemoveIcon;
end;


function TCoolTrayIcon.ModifyIcon: Boolean;
// Change icon or tooltip if icon already placed
begin
  Result := False;
  if InitIcon then
    Result := Shell_NotifyIcon(NIM_MODIFY, @IconData);
end;


procedure TCoolTrayIcon.TimerCycle(Sender: TObject);
begin
  if Assigned(FIconList) then begin
    FIconList.GetIcon(FIconIndex, FIcon);

    if FIconIndex < FIconList.Count-1 then
      SetIconIndex(FIconIndex+1)
    else
      SetIconIndex(0);
  end;
end; 

function TCoolTrayIcon.ShowBalloonHint(Title: String; Text: String;
  IconType: TBalloonHintIcon; TimeoutSecs: TBalloonHintTimeOut): Boolean;
// Show balloon hint. Return false if error.
const
  aBalloonIconTypes: array[TBalloonHintIcon] of Byte =
    (NIIF_NONE, NIIF_INFO, NIIF_WARNING, NIIF_ERROR);
begin
  with IconData do begin
      uFlags := uFlags or NIF_INFO;
      StrPCopy(szInfo, '');
  end;
  ModifyIcon;
    // Display new balloon hint
  with IconData do begin
      uFlags := uFlags or NIF_INFO;
      StrPCopy(szInfo, Text);
      StrPCopy(szInfoTitle, Title);
      uTimeout := TimeoutSecs * 1000;
      dwInfoFlags := aBalloonIconTypes[IconType];
  end;
  Result := ModifyIcon;
    { Remove NIF_INFO before next call to ModifyIcon (or else the balloon hint
      will redisplay itself) }
  with IconData do
    uFlags := NIF_ICON + NIF_MESSAGE + NIF_TIP;
end;



function TCoolTrayIcon.Refresh: Boolean;
// Refresh the icon
begin
  Result := ModifyIcon;
end;


procedure TCoolTrayIcon.PopupAtCursor;
var
  CursorPos: TPoint;
begin
  if Assigned(PopupMenu) and PopupMenu.AutoPopup then
      if GetCursorPos(CursorPos) then
      begin
        { Win98 (but not Win95/WinNT) seems to empty a popup menu before
          closing it. This is a problem when the menu is about to display
          while it already is active (two click-events in succession). The
          menu will flicker annoyingly. Calling ProcessMessages fixes this. }
        Application.ProcessMessages;

        { Bring the main form or its modal dialog to the foreground.
          This also ensures the popup menu closes after it loses focus. }
        SetForegroundWindow((Owner as TWinControl).Handle);
{
This seems unnecessary(?):
        if Screen.ActiveControl <> nil then
          if (Screen.ActiveControl.Owner is TWinControl) then
            SetForegroundWindow((Screen.ActiveControl.Owner as TWinControl).Handle);
}
        // Now make the menu pop up
        PopupMenu.PopupComponent := Self;
        PopupMenu.Popup(CursorPos.X, CursorPos.Y);
        // Post an empty message to make the popup menu disappear
        PostMessage((Owner as TWinControl).Handle, WM_NULL, 0, 0);
      end;
end;


procedure TCoolTrayIcon.Click;
begin
  // Execute user-assigned method
  if Assigned(FOnClick) then
    FOnClick(Self);
end;


procedure TCoolTrayIcon.DblClick;
begin
  // Execute user-assigned method

  if Assigned(FOnDblClick) then
    FOnDblClick(Self);
end;


procedure TCoolTrayIcon.MouseDown(Button: TMouseButton; Shift: TShiftState;
  X, Y: Integer);
begin
  // Execute user-assigned method
  if Assigned(FOnMouseDown) then
    FOnMouseDown(Self, Button, Shift, X, Y);
end;


procedure TCoolTrayIcon.MouseUp(Button: TMouseButton; Shift: TShiftState;
  X, Y: Integer);
begin
  // Execute user-assigned method
  if Assigned(FOnMouseUp) then
    FOnMouseUp(Self, Button, Shift, X, Y);
end;


procedure TCoolTrayIcon.MouseMove(Shift: TShiftState; X, Y: Integer);
begin
  // Execute user-assigned method
  if Assigned(FOnMouseMove) then
    FOnMouseMove(Self, Shift, X, Y);
end;

function TCoolTrayIcon.RemoveIcon: Boolean;
begin
  Result := Shell_NotifyIcon(NIM_DELETE, @IconData);
end;

procedure Register;
begin
  RegisterComponents('Custom', [TCoolTrayIcon]);
end;

end.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青草国产成人99久久| 91视频免费播放| 一区二区日韩电影| 日韩欧美三级在线| 91美女片黄在线观看91美女| 极品少妇一区二区三区精品视频 | 精品欧美一区二区久久| 色综合天天综合网天天狠天天 | 亚洲欧美日韩国产中文在线| 亚洲精品在线网站| 欧美三级视频在线观看| 成人av网站在线| 国产91丝袜在线18| 美女免费视频一区| 亚洲一二三四久久| 亚洲日本青草视频在线怡红院| 久久久99久久精品欧美| 欧美一区二区三区色| 欧美专区日韩专区| 色哟哟在线观看一区二区三区| 国产电影一区二区三区| 国产综合色视频| 美腿丝袜亚洲一区| 日韩av在线播放中文字幕| 亚洲国产精品久久人人爱蜜臀 | 777久久久精品| 91官网在线观看| 色94色欧美sute亚洲线路一久| 成人免费高清在线| 国产成人午夜视频| 国产福利一区二区| 国产成人在线观看| 成人午夜激情影院| 不卡一区二区三区四区| 波多野结衣一区二区三区| 国产999精品久久久久久绿帽| 国产乱码字幕精品高清av| 国产自产v一区二区三区c| 久久精品国产免费看久久精品| 美腿丝袜亚洲一区| 久久99久国产精品黄毛片色诱| 日本不卡免费在线视频| 美女www一区二区| 美女一区二区三区| 激情综合网激情| 国产一区不卡精品| gogogo免费视频观看亚洲一| 99久久精品99国产精品| 91网站在线播放| 欧美三级中文字幕| 制服丝袜激情欧洲亚洲| 日韩欧美高清dvd碟片| 久久久国产一区二区三区四区小说 | 日韩精品电影一区亚洲| 午夜在线电影亚洲一区| 日本aⅴ免费视频一区二区三区| 久久99在线观看| 国产a级毛片一区| 久久精品视频网| 亚洲国产高清aⅴ视频| 亚洲丝袜制服诱惑| 午夜av区久久| 国产精品综合一区二区| 91视频国产资源| 欧美一级在线观看| 国产日韩av一区| 亚洲一区二区在线视频| 美女被吸乳得到大胸91| 成人avav在线| 欧美日本精品一区二区三区| 精品国产麻豆免费人成网站| 亚洲国产精品av| 五月婷婷激情综合网| 国产精品综合网| 在线中文字幕一区二区| 欧美成人a视频| 亚洲日本护士毛茸茸| 乱一区二区av| 色综合久久久久综合| 日韩女同互慰一区二区| 亚洲欧洲精品一区二区精品久久久 | 九九视频精品免费| www.色综合.com| 日韩一本二本av| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 一区二区三区在线观看视频 | 狠狠色狠狠色综合日日91app| 国产69精品久久久久777| 欧美日韩激情一区| 欧美国产综合一区二区| 午夜欧美2019年伦理| 国产成人8x视频一区二区| 欧美色图在线观看| 中文字幕av一区 二区| 午夜精品一区二区三区免费视频 | 日韩二区三区四区| 99精品视频在线播放观看| 日韩午夜电影av| 亚洲一二三专区| 成人国产电影网| 日韩精品一区国产麻豆| 亚洲一本大道在线| 白白色亚洲国产精品| 欧美精品一区二区三区很污很色的| 亚洲精品菠萝久久久久久久| 精品亚洲国内自在自线福利| 在线观看一区不卡| 亚洲色图制服诱惑| 国产精品亚洲人在线观看| 欧美区视频在线观看| 一区二区在线观看免费| av午夜一区麻豆| 国产亲近乱来精品视频| 久久99精品一区二区三区| 91精品国产综合久久久久久久久久 | 日韩欧美国产一区二区在线播放 | 久久久精品欧美丰满| 久久国产精品99久久久久久老狼| 欧美日韩在线播放一区| 17c精品麻豆一区二区免费| 成人性生交大片| 亚洲国产精品t66y| 国产成人丝袜美腿| 久久精品一区八戒影视| 国产在线观看免费一区| 26uuu成人网一区二区三区| 六月婷婷色综合| 久久综合色之久久综合| 激情五月婷婷综合| 日韩精品专区在线影院观看| 另类调教123区| 日韩欧美一级二级| 精品一区二区在线视频| 日韩欧美久久久| 久久精品国产第一区二区三区| 日韩欧美色综合| 极品少妇xxxx精品少妇偷拍| 久久综合精品国产一区二区三区| 麻豆一区二区三区| 日韩精品一区二区三区四区| 久久疯狂做爰流白浆xx| 久久蜜桃一区二区| 成人激情开心网| 国产精品久久久久久久久快鸭| 国产sm精品调教视频网站| 中文幕一区二区三区久久蜜桃| 成人高清视频在线| 自拍视频在线观看一区二区| 欧美午夜寂寞影院| 秋霞电影网一区二区| 精品国产三级电影在线观看| 成人性生交大片| 亚洲国产视频a| 日韩你懂的电影在线观看| 国产成人精品影视| 亚洲三级在线播放| 91麻豆精品国产无毒不卡在线观看| 久久精品国产精品青草| 国产日韩欧美a| 91国模大尺度私拍在线视频| 美国一区二区三区在线播放| 国产欧美精品一区| 在线视频国内自拍亚洲视频| 丝袜a∨在线一区二区三区不卡| 精品国产伦理网| av不卡免费在线观看| 日韩国产精品久久久久久亚洲| 国产婷婷色一区二区三区在线| 91亚洲资源网| 久久国产福利国产秒拍| 亚洲视频 欧洲视频| 日韩视频免费观看高清完整版在线观看| 韩国一区二区视频| 亚洲精品亚洲人成人网在线播放| 欧美日韩一区成人| 国产精一品亚洲二区在线视频| 亚洲精品ww久久久久久p站| 欧美一区二区三区思思人| 国产成人在线免费| 日韩综合一区二区| 国产精品午夜免费| 欧美年轻男男videosbes| 成人黄页毛片网站| 免费av网站大全久久| 亚洲色欲色欲www在线观看| 日韩免费性生活视频播放| 99re这里都是精品| 久久99久久久欧美国产| 亚洲精品视频一区二区| 国产日韩精品一区二区浪潮av | 国产日韩欧美高清在线| 欧美日本乱大交xxxxx| 成人av手机在线观看| 精品写真视频在线观看| 亚洲一卡二卡三卡四卡五卡| 国产片一区二区| 精品国产一区久久| 欧美色图免费看| 91麻豆免费在线观看| 国产高清一区日本|