急求一个小程序在线等 求一个类似迅雷图标的小程序,可以总在桌面的最前面,在线等! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) lblTest: TLabel; procedure FormCreate(Sender: TObject); private { Private declarations } protected procedure CreateParams(var Params: TCreateParams);override; public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}{ TForm1 }procedure TForm1.CreateParams(var Params: TCreateParams);begin inherited CreateParams(Params); with Params do begin Style := WS_POPUP or WS_CLIPSIBLINGS {or WS_BORDER}; ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST; end;end;procedure TForm1.FormCreate(Sender: TObject);begin SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED); SetLayeredWindowAttributes(Handle, clWhite, 200, LWA_ALPHA or LWA_COLORKEY);end;end. 给你做了一个:窗体代码:object Form1: TForm1 Left = 820 Top = 113 AlphaBlend = True AlphaBlendValue = 200 AutoSize = True BorderStyle = bsNone Caption = 'Form1' ClientHeight = 36 ClientWidth = 115 Color = 25 TransparentColor = True TransparentColorValue = 25 Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 object Image1: TImage Left = 0 Top = 0 Width = 36 Height = 36 AutoSize = True PopupMenu = PopupMenu1 OnMouseDown = Image1MouseDown end object PopupMenu1: TPopupMenu AutoHotkeys = maManual Left = 80 Top = 8 object N1: TMenuItem Caption = #26356#25442#22270#29255 OnClick = N1Click end object N2: TMenuItem Caption = #36864#20986#31243#24207 OnClick = N2Click end end object OpenPictureDialog1: TOpenPictureDialog Filter = 'JPG'#22270#29255'|*.jpg|BMP'#22270#29255'|*.bmp' Left = 40 Top = 8 endend程序代码:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, Menus, ExtDlgs,jpeg;type TForm1 = class(TForm) Image1: TImage; PopupMenu1: TPopupMenu; N1: TMenuItem; N2: TMenuItem; OpenPictureDialog1: TOpenPictureDialog; procedure FormCreate(Sender: TObject); procedure Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure N1Click(Sender: TObject); procedure N2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);beginSetWindowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);end;procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);beginReleaseCapture;SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0); end;procedure TForm1.N1Click(Sender: TObject);begin if OpenPictureDialog1.Execute then image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);end;procedure TForm1.N2Click(Sender: TObject);begincloseend;end.或者,你直接点www.mwymwy.cn/xun.rar下载。 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, shellapi; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public procedure IconOnClick(var message: TMessage); message WM_USER+1; { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); var Icondata: TNotifyIconDataA; begin IconData.cbSize := SizeOf(IconData); IconData.Wnd := Self.Handle; IconData.uID := 1; IconData.uFlags := 1 or 2 or 4; IconData.uCallBackMessage := WM_USER+1; IconData.hIcon := Application.Icon.Handle; IconData.szTip := 'TrayTest'; Shell_NotifyIcon(NIM_ADD, @IconData ); SetWindowLong(Application.Handle, GWL_EXSTYLE,WS_EX_TOOLWINDOW); ShowWindow(Self.Handle, SW_HIDE); end; procedure TForm1.IconOnClick( var message: Tmessage); begin if (message.lParam = WM_LBUTTONDOWN) then ShowWindow(Handle, SW_SHOW ); end; end. 祝福,2010年D版的朋友们幸福快乐!(有源码) 哪里能下载到Delphi4.0? 如何用程序判断网卡为静态IP或是动态IP if dataset.recordcount<>1 then 为什么是错误的? 我要去北京出差了,哪位大侠告诉我哪些好玩的地方 一篇文章很长,得分好几页,怎么打印出来?用QReport好象不行? 急!!关于数据库发布的,大家请进? 线程中涉及到窗体内容为什么总出错? 如何在ADO的SQL控件中不用ODBC完成长型备注型字段的模糊查询 我的程序为何总出错?等着大家救命 恭喜JJ大版主当选MS MVP 在delphi中按下ESC键(其他特定键)来将结束循环如何实现?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
lblTest: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
protected
procedure CreateParams(var Params: TCreateParams);override; public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}{ TForm1 }procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params); with Params do
begin
Style := WS_POPUP or WS_CLIPSIBLINGS {or WS_BORDER};
ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST;
end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(Handle, clWhite, 200, LWA_ALPHA or LWA_COLORKEY);
end;end.
Left = 820
Top = 113
AlphaBlend = True
AlphaBlendValue = 200
AutoSize = True
BorderStyle = bsNone
Caption = 'Form1'
ClientHeight = 36
ClientWidth = 115
Color = 25
TransparentColor = True
TransparentColorValue = 25
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Image1: TImage
Left = 0
Top = 0
Width = 36
Height = 36
AutoSize = True
PopupMenu = PopupMenu1
OnMouseDown = Image1MouseDown
end
object PopupMenu1: TPopupMenu
AutoHotkeys = maManual
Left = 80
Top = 8
object N1: TMenuItem
Caption = #26356#25442#22270#29255
OnClick = N1Click
end
object N2: TMenuItem
Caption = #36864#20986#31243#24207
OnClick = N2Click
end
end
object OpenPictureDialog1: TOpenPictureDialog
Filter = 'JPG'#22270#29255'|*.jpg|BMP'#22270#29255'|*.bmp'
Left = 40
Top = 8
end
end
程序代码:unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, Menus, ExtDlgs,jpeg;type
TForm1 = class(TForm)
Image1: TImage;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
OpenPictureDialog1: TOpenPictureDialog;
procedure FormCreate(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
SetWindowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);
end;procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
end;procedure TForm1.N1Click(Sender: TObject);
begin
if OpenPictureDialog1.Execute then
image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
end;procedure TForm1.N2Click(Sender: TObject);
begin
close
end;end.或者,你直接点www.mwymwy.cn/xun.rar下载。
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, shellapi;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
procedure IconOnClick(var message: TMessage); message WM_USER+1;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
Icondata: TNotifyIconDataA;
begin
IconData.cbSize := SizeOf(IconData);
IconData.Wnd := Self.Handle;
IconData.uID := 1;
IconData.uFlags := 1 or 2 or 4;
IconData.uCallBackMessage := WM_USER+1;
IconData.hIcon := Application.Icon.Handle;
IconData.szTip := 'TrayTest';
Shell_NotifyIcon(NIM_ADD, @IconData );
SetWindowLong(Application.Handle,
GWL_EXSTYLE,WS_EX_TOOLWINDOW);
ShowWindow(Self.Handle, SW_HIDE);
end;
procedure TForm1.IconOnClick( var message: Tmessage);
begin
if (message.lParam = WM_LBUTTONDOWN) then
ShowWindow(Handle, SW_SHOW );
end;
end.