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

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

?? cooltrayicon.pas

?? 圖標提取器源碼 非常管用.大家試試
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{
This is a component for placing icons in the notification area
of the Windows taskbar (aka. the traybar).

The component is freeware. Feel free to use and improve it.
I would be pleased to hear what you think.

Troels Jakobsen - tjak@get2net.dk
}
unit CoolTrayIcon;

interface

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

const
  { User-defined message sent from the icon. Some low user-defined
    messages are used by Windows itself! (WM_USER+1 = DM_SETDEFID). }
  WM_TRAYNOTIFY = WM_USER + 1024;
  IconID = 1;

type
  TCycleEvent = procedure(Sender: TObject; Current: Integer) of object;
  TMainFormMinimizeEvent = procedure(Sender: TObject; var GotoTray: Boolean) of object;

  TCoolTrayIcon = class(TComponent)
  private
    FEnabled: Boolean;
    FIcon: TIcon;
    FIconVisible: Boolean;
    FHint: String;
    FShowHint: Boolean;
    FPopupMenu: TPopupMenu;
    FLeftPopup: Boolean;
    FOnClick,
    FOnDblClick: TNotifyEvent;
    FOnCycle: TCycleEvent;
    FOnMouseDown,
    FOnMouseUp: TMouseEvent;
    FOnMouseMove: TMouseMoveEvent;
    FStartMinimized: Boolean;
    FMinimizeToTray: Boolean;
    HasShown: Boolean;
    FClicked: Boolean;
    CycleTimer: TTimer;           // For icon cycling
    FDesignPreview: Boolean;
    SettingPreview: Boolean;
    FIconList: TImageList;
    FCycleIcons: Boolean;
    FCycleInterval: Cardinal;
    IconIndex: Integer;           // Current index in imagelist
    OldAppProc, NewAppProc: Pointer;   // Procedure variables
    procedure SetCycleIcons(Value: Boolean);
    procedure SetDesignPreview(Value: Boolean);
    procedure SetCycleInterval(Value: Cardinal);
    procedure TimerCycle(Sender: TObject);
    procedure HandleIconMessage(var Msg: TMessage);
    function InitIcon: Boolean;
    procedure SetIcon(Value: TIcon);
    procedure SetIconVisible(Value: Boolean);
    procedure SetHint(Value: String);
    procedure SetShowHint(Value: Boolean);
    procedure PopupAtCursor;
    procedure HookApp;
    procedure UnhookApp;
    procedure HookAppProc(var Message: TMessage);
  protected
    IconData: TNotifyIconData;    // Data of the tray icon wnd.
    procedure Loaded; override;
    function ShowIcon: Boolean; virtual;
    function HideIcon: Boolean; virtual;
    function ModifyIcon: Boolean; virtual;
    procedure Click; dynamic;
    procedure DblClick; dynamic;
    procedure CycleIcon; 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 DoMinimizeToTray; dynamic;
    procedure Notification(AComponent: TComponent; Operation: TOperation);
      override;
  public
    property Handle: HWND read IconData.wnd;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure ShowMainForm;
    procedure HideMainForm;
    procedure Refresh;
  published
    // Properties:
    property DesignPreview: Boolean read FDesignPreview
      write SetDesignPreview default False;
    property IconList: TImageList read FIconList write FIconList;
    property CycleIcons: Boolean read FCycleIcons write SetCycleIcons
      default False;
    property CycleInterval: Cardinal read FCycleInterval
      write SetCycleInterval;
    property Enabled: Boolean read FEnabled write FEnabled default True;
    property Hint: String read FHint write SetHint;
    property ShowHint: Boolean read FShowHint write SetShowHint;
    property Icon: TIcon read FIcon write SetIcon stored True;
    property IconVisible: Boolean read FIconVisible write SetIconVisible
      default True;
    property PopupMenu: TPopupMenu read FPopupMenu write FPopupMenu;
    property LeftPopup: Boolean read FLeftPopup write FLeftPopup
      default False;
    property StartMinimized: Boolean read FStartMinimized write FStartMinimized
      default False;         // Main form minimized on appl. start-up?
    property MinimizeToTray: Boolean read FMinimizeToTray write FMinimizeToTray
      default False;         // Minimize main form to tray when minimizing?
    // 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;
    property OnCycle: TCycleEvent read FOnCycle write FOnCycle;
  end;

procedure Register;

implementation

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

constructor TCoolTrayIcon.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FIconVisible := True;      // Visible by default
  FEnabled := True;          // Enabled by default
  HasShown := False;         // The main form has not been shown before
  SettingPreview := False;

  FIcon := TIcon.Create;
  IconData.cbSize := SizeOf(TNotifyIconData);
  // 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
  IconData.uFlags := NIF_ICON + NIF_MESSAGE + NIF_TIP;
  // Message to send to IconData.wnd when mouse event occurs
  IconData.uCallbackMessage := WM_TRAYNOTIFY;

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

  if not (csDesigning in ComponentState) then
    HookApp;
end;


destructor TCoolTrayIcon.Destroy;
begin
  SetIconVisible(False);     // Remove the icon from the tray
  FIcon.Free;                // Free the icon
  DeallocateHWnd(IconData.Wnd);   // Free the tray window
  CycleTimer.Free;
  // It is important to unhook any hooked processes
  if not (csDesigning in ComponentState) then
    UnhookApp;
  inherited Destroy;
end;


procedure TCoolTrayIcon.Loaded;
{ This method is called when all properties of the component have been
  initialized. The method SetIconVisible must be called here, after the
  tray icon (FIcon) has loaded itself. Otherwise, the tray icon will
  be blank (no icon image). }
begin
  inherited Loaded;	     // Always call inherited Loaded first
  SetIconVisible(FIconVisible);
  if (StartMinimized) and not (csDesigning in ComponentState) then
  begin
    Application.ShowMainForm := False;
    ShowWindow(Application.Handle, SW_HIDE);
  end;
  ModifyIcon;
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
    IconList := nil;
  if (AComponent = PopupMenu) and (Operation = opRemove) then
    PopupMenu := nil;
end;


{ For MinimizeToTray to work, we need to know when the form is minimized
  (happens when either the application or the main form minimizes).
  The straight-forward way is to make TCoolTrayIcon trap the
  Application.OnMinimize event. However, if you also make use of this
  event in the application, the OnMinimize code used by TCoolTrayIcon
  is discarded.
  The alternative is to hook into the app.'s message handling (via
  HookApp). You can then catch any message that goes through the app.
  and still use the OnMinimize event. }

procedure TCoolTrayIcon.HookApp;
begin
  // Hook the application
  OldAppProc := Pointer(GetWindowLong(Application.Handle, GWL_WNDPROC));
  NewAppProc := MakeObjectInstance(HookAppProc);
  SetWindowLong(Application.Handle, GWL_WNDPROC, LongInt(NewAppProc));
end;


procedure TCoolTrayIcon.UnhookApp;
begin
  if Assigned(OldAppProc) then
    SetWindowLong(Application.Handle, GWL_WNDPROC, LongInt(OldAppProc));
  if Assigned(NewAppProc) then
    FreeObjectInstance(NewAppProc);
  NewAppProc := nil;
  OldAppProc := nil;
end;


{ All app. messages pass through HookAppProc. You can override the
  messages by not passing them along to Windows (via CallWindowProc). }

procedure TCoolTrayIcon.HookAppProc(var Message: TMessage);
begin
  with Message do
  begin
    case Msg of
      WM_SIZE:
        if wParam = SIZE_MINIMIZED then
        begin
          if FMinimizeToTray then
            DoMinimizeToTray;
{ It is tempting to insert a minimize event here, but it would behave
  exactly like Application.OnMinimize, so I see no need for it. }
        end;
    end;

    Result := CallWindowProc(OldAppProc, Application.Handle, Msg, wParam, lParam);
  end;
end;


{ You can hook into the main form (or any other window) just as easily
  as hooking into the app., allowing you to handle any message that
  window processes. Uncomment the procedures HookParent and UnhookParent
  below if you want to hook the main form. Remember to unhook when the
  app. terminates, or Bad Things may happen. }
{
procedure TCoolTrayIcon.HookParent;
begin
  if Assigned(Owner as TWinControl) then
  begin
    // Hook the parent window
    OldWndProc := Pointer(GetWindowLong((Owner as TWinControl).Handle, GWL_WNDPROC));
    NewWndProc := MakeObjectInstance(HookWndProc);
    SetWindowLong((Owner as TWinControl).Handle, GWL_WNDPROC, LongInt(NewWndProc));
  end;
end;


procedure TCoolTrayIcon.UnhookParent;
begin
  if ((Owner as TWinControl) <> nil) and Assigned(OldWndProc) then
    SetWindowLong((Owner as TWinControl).Handle, GWL_WNDPROC, LongInt(OldWndProc));
  if Assigned(NewWndProc) then
    FreeObjectInstance(NewWndProc);
  NewWndProc := nil;
  OldWndProc := nil;
end;
}


{ HandleIconMessage handles messages that go to the shell notification
  window (tray icon) itself. Most messages are passed through WM_TRAYNOTIFY.
  Use lParam to get the actual message, eg. WM_MOUSEMOVE.
  Sends the usual Delphi events for the mouse messages. Also interpolates
  the OnClick event when the user clicks the left button, and makes the
  menu (if any) popup on left and right mouse down events. }

procedure TCoolTrayIcon.HandleIconMessage(var Msg: TMessage);

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

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

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

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

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

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

    WM_LBUTTONUP:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩二区三区四区| 欧美精品一区二区蜜臀亚洲| 精品88久久久久88久久久| 一区二区三区产品免费精品久久75| 麻豆视频一区二区| 精品久久久久久亚洲综合网| 最新欧美精品一区二区三区| 国产一区91精品张津瑜| 精品久久久久av影院| 日韩高清一级片| 欧美高清激情brazzers| 香蕉成人啪国产精品视频综合网| 色又黄又爽网站www久久| 国产精品久久久久久户外露出 | 久久久不卡网国产精品一区| 日韩av高清在线观看| 7777精品伊人久久久大香线蕉完整版| 亚洲制服丝袜一区| 欧美日高清视频| 秋霞午夜av一区二区三区| 欧美日韩国产bt| 日韩国产欧美三级| 精品国产一区二区三区av性色| 日产国产高清一区二区三区| 日韩一级高清毛片| 国产精品白丝jk白祙喷水网站| 国产欧美精品区一区二区三区 | 精品久久国产字幕高潮| 国产精品一二三四| 国产精品护士白丝一区av| 99久久综合国产精品| 亚洲综合视频网| 欧美r级在线观看| 北条麻妃国产九九精品视频| 亚洲一区二区欧美激情| 日韩欧美二区三区| 92精品国产成人观看免费| 久草这里只有精品视频| 国产校园另类小说区| 91久久精品一区二区三区| 韩国三级中文字幕hd久久精品| 国产精品久久久久久久久免费桃花| 欧美日韩综合不卡| 成人免费视频视频在线观看免费 | 亚洲国产精品久久久久婷婷884| 欧美精品1区2区| 首页欧美精品中文字幕| 久久久蜜臀国产一区二区| 在线观看不卡一区| 精品一区二区三区在线视频| 日本一区二区三区久久久久久久久不 | 91香蕉视频污| 九九九精品视频| 亚洲精品欧美激情| 久久日一线二线三线suv| 99热精品一区二区| 国产一区二区三区在线观看免费视频 | 日本中文字幕一区二区有限公司| 久久久久国产精品麻豆ai换脸| 欧美日韩不卡视频| 99视频有精品| 成人av网站免费观看| 免费精品视频最新在线| 亚洲综合久久久| 国产精品污污网站在线观看 | 国产精品一区二区在线观看不卡| 亚洲黄色在线视频| 国产精品国产自产拍高清av| 精品国产99国产精品| 欧美妇女性影城| 在线视频国内自拍亚洲视频| 波多野结衣91| 成人精品视频一区| 国产九色sp调教91| 狠狠狠色丁香婷婷综合久久五月| 视频在线观看一区| 天天色综合天天| 综合久久国产九一剧情麻豆| 亚洲欧美日韩小说| 亚洲免费三区一区二区| 国产精品不卡一区| 国产精品白丝在线| 日韩毛片在线免费观看| 国产精品久久毛片| 国产精品成人一区二区三区夜夜夜 | 久久国产福利国产秒拍| 国产精品一区三区| 成人午夜视频在线观看| 成人一级片网址| 成人午夜电影久久影院| 99视频在线观看一区三区| 99久久婷婷国产| 91官网在线观看| 欧美一区二区三区色| 国产亚洲欧美日韩俺去了| 欧美一区二区福利视频| 国产三级一区二区| 18涩涩午夜精品.www| 一区二区三区久久久| 日韩福利电影在线| 国产超碰在线一区| 在线观看欧美黄色| 亚洲精品一区二区精华| 国产精品国产三级国产aⅴ中文 | 亚洲色图一区二区| 日韩成人av影视| 国产一区999| 777久久久精品| 国产精品久久久久永久免费观看 | 久久久精品蜜桃| 玉米视频成人免费看| 国产一区二区中文字幕| 在线欧美日韩国产| 欧美国产精品一区| 日韩高清一级片| 欧美午夜在线一二页| 欧美亚洲国产一区二区三区| 91精品国产欧美一区二区成人| 国产清纯白嫩初高生在线观看91 | 欧美在线小视频| 国产三区在线成人av| 日韩av中文字幕一区二区 | 成人毛片在线观看| 欧美精品自拍偷拍| 一区二区国产盗摄色噜噜| 国产成人av资源| 精品处破学生在线二十三| 亚洲v中文字幕| 欧美自拍丝袜亚洲| 国产欧美日韩精品在线| 亚洲国产成人av好男人在线观看| 国产99久久久久| 久久伊人蜜桃av一区二区| 偷拍自拍另类欧美| 欧美日韩国产色站一区二区三区| 亚洲国产精品ⅴa在线观看| 国产原创一区二区| 日韩一级完整毛片| 亚洲精品久久7777| 欧美三级韩国三级日本三斤| 亚洲宅男天堂在线观看无病毒| 91在线观看视频| 一区二区三区高清不卡| 色诱视频网站一区| 亚洲一级片在线观看| 67194成人在线观看| 免费看欧美女人艹b| 日韩欧美国产一区二区三区| 国产一区在线看| 国产精品美女久久久久久久久久久 | 欧美日本高清视频在线观看| 婷婷久久综合九色综合伊人色| 欧美性生活一区| 日韩国产欧美视频| 久久香蕉国产线看观看99| 成人激情综合网站| 亚洲高清在线精品| 日韩一区二区精品在线观看| 国产激情一区二区三区桃花岛亚洲| 久久久久高清精品| 91福利视频网站| 久久国产精品无码网站| 国产精品国产精品国产专区不蜜 | 日韩免费福利电影在线观看| 国内成人精品2018免费看| 欧美午夜不卡在线观看免费| 亚洲综合在线第一页| 欧美日韩成人一区| 成人性生交大片免费看中文| 亚洲香肠在线观看| 精品成人a区在线观看| 99久久99久久精品免费观看| 日本在线不卡一区| 综合久久给合久久狠狠狠97色| 欧美一区二区精美| 一本到高清视频免费精品| 看片网站欧美日韩| 亚洲一区二区在线免费观看视频| 精品福利一二区| 欧美日韩视频在线一区二区| 国产精品一级二级三级| 日韩电影在线免费| 久久综合av免费| 精品免费国产二区三区| 欧美精品777| 欧美三级蜜桃2在线观看| 99精品视频在线播放观看| 国产一区二区三区美女| 日韩精品乱码av一区二区| 一区二区三区色| 日本一区二区三区视频视频| 国产亚洲欧美色| 久久久久久日产精品| 日韩欧美激情一区| 欧美成人bangbros| 日韩欧美亚洲国产精品字幕久久久| 欧美三级乱人伦电影| 91福利精品第一导航| 欧美三级午夜理伦三级中视频| 色婷婷激情一区二区三区|