摘要: unituWnWinetClass;interfaceusesWindows,Messages,SysUtils,Classes,WinInet;constCONST_AGENT='WininetbyEnli';BUFFER_SIZE=4096;type//定义http的请求调用方式//TWinWrapVerbs=(wwvGET,wwvPOST,wwvMPOST);//定义协议版本TWinHttpVersion=(wwvHttp1,wwvHttp11);//错误类型,没有错误为wwecNilTWinInetErrorCauses=(wwecNil,//0wwecAttemptC阅读全文
posted @ 2012-03-19 18:29 Enli 阅读(37) 评论(0) 编辑
http://115.com/file/e7fpe14u# skytest.rar
http://115.com/file/cl317w1j# 网络抓包工具.exe
http://115.com/file/bhgkqe5n# 全产品系列下载.exe
http://115.com/file/e7ft6alf# Speed.rar
posted @ 2012-02-23 10:07 Enli 阅读(18) 评论(0) 编辑
1. dll里面的form显示位置问题
需要显示在主程序窗口的屏幕上,可以用下面的方法放到 TForm里面的FormActivate事件里面
var
HM: HMonitor;
I: Integer;
LRect: TRect;
Begin
{$IFDEF STATIC_ADDIN}
HM := MonitorFromWindow(FContext.MasterPageHandle, MONITOR_DEFAULTTONEAREST);
if HM > 0 then
begin
for I := 0 to Screen.MonitorCount - 1 do
if Screen.Monitors[I].Handle = HM then
begin
LRect := Screen.Monitors[I].WorkareaRect;
SetBounds(LRect.Left + ((RectWidth(LRect) - Width) div 2),
LRect.Top + ((RectHeight(LRect) - Height) div 2), Width, Height);
Break;
end;
end;
{$ENDIF}
end;
HM: HMonitor;
I: Integer;
LRect: TRect;
Begin
{$IFDEF STATIC_ADDIN}
HM := MonitorFromWindow(FContext.MasterPageHandle, MONITOR_DEFAULTTONEAREST);
if HM > 0 then
begin
for I := 0 to Screen.MonitorCount - 1 do
if Screen.Monitors[I].Handle = HM then
begin
LRect := Screen.Monitors[I].WorkareaRect;
SetBounds(LRect.Left + ((RectWidth(LRect) - Width) div 2),
LRect.Top + ((RectHeight(LRect) - Height) div 2), Width, Height);
Break;
end;
end;
{$ENDIF}
end;
也可以直接跟着主程序的窗体走,直接在Formshow里面加
Left := FContext.MainForm.Left;
Top := FContext.MainForm.Top;
Top := FContext.MainForm.Top;
posted @ 2012-01-31 14:27 Enli 阅读(28) 评论(0) 编辑
1. 透明panel
unit uWnTransparentPanel;
interface
uses
Windows,Classes,StdCtrls,ExtCtrls,Messages,Forms;
type
TWnTransparentPanel = class(TPanel)
private
FTransparentPercent: Integer;
procedure SetTransparentPercent(const Value: Integer);
protected
procedure WMPaint(var message : TMessage); message WM_Paint;
public
procedure StepShow(const ALeft,ATop,HStet,VStep:Integer);
published
property TransparentPercent: Integer read FTransparentPercent write SetTransparentPercent;
end;
implementation
{ TWnTransparentPanel }
procedure TWnTransparentPanel.SetTransparentPercent(const Value: Integer);
begin
FTransparentPercent := Value;
end;
procedure TWnTransparentPanel.StepShow(const ALeft, ATop,HStet, VStep: Integer);
var
I: Integer;
begin
Visible := True;
Left := ALeft;
Top := ATop+VStep*10 ;
for I := 0 to 9 do
begin
Top := ATop +(9-I)*VStep;
Self.Parent.Update;
Self.Repaint;
Sleep(100);
Application.HandleMessage;
end;
end;
procedure TWnTransparentPanel.WMPaint(var message: TMessage);
procedure AlphaBlendTabControl;
var
MemBitmap, OldBitmap: HBITMAP;
BF: BLENDFUNCTION;
MemDC, DC: HDC;
begin
if (Parent = nil) or not Parent.HandleAllocated then
Exit;
DC := GetDC(0);
MemBitmap := CreateCompatibleBitmap(DC, Parent.Width, Parent.Height);
ReleaseDC(0, DC);
MemDC := CreateCompatibleDC(0);
OldBitmap := SelectObject(MemDC, MemBitmap);
try
Parent.Perform(WM_ERASEBKGND, MemDC, MemDC);
Parent.Perform(WM_PAINT, MemDC, 0);
BF.SourceConstantAlpha := TransparentPercent;
BF.AlphaFormat := 0;
BF.BlendOp := AC_SRC_OVER;
BF.BlendFlags := 0;
Windows.AlphaBlend(Canvas.Handle, 0, 0, Width, Height, MemDC, Left, Top, Width, Height, BF);
finally
SelectObject(MemDC, OldBitmap);
DeleteDC(MemDC);
DeleteObject(MemBitmap);
end;
end;
begin
inherited;
AlphaBlendTabControl;
end;
end.
interface
uses
Windows,Classes,StdCtrls,ExtCtrls,Messages,Forms;
type
TWnTransparentPanel = class(TPanel)
private
FTransparentPercent: Integer;
procedure SetTransparentPercent(const Value: Integer);
protected
procedure WMPaint(var message : TMessage); message WM_Paint;
public
procedure StepShow(const ALeft,ATop,HStet,VStep:Integer);
published
property TransparentPercent: Integer read FTransparentPercent write SetTransparentPercent;
end;
implementation
{ TWnTransparentPanel }
procedure TWnTransparentPanel.SetTransparentPercent(const Value: Integer);
begin
FTransparentPercent := Value;
end;
procedure TWnTransparentPanel.StepShow(const ALeft, ATop,HStet, VStep: Integer);
var
I: Integer;
begin
Visible := True;
Left := ALeft;
Top := ATop+VStep*10 ;
for I := 0 to 9 do
begin
Top := ATop +(9-I)*VStep;
Self.Parent.Update;
Self.Repaint;
Sleep(100);
Application.HandleMessage;
end;
end;
procedure TWnTransparentPanel.WMPaint(var message: TMessage);
procedure AlphaBlendTabControl;
var
MemBitmap, OldBitmap: HBITMAP;
BF: BLENDFUNCTION;
MemDC, DC: HDC;
begin
if (Parent = nil) or not Parent.HandleAllocated then
Exit;
DC := GetDC(0);
MemBitmap := CreateCompatibleBitmap(DC, Parent.Width, Parent.Height);
ReleaseDC(0, DC);
MemDC := CreateCompatibleDC(0);
OldBitmap := SelectObject(MemDC, MemBitmap);
try
Parent.Perform(WM_ERASEBKGND, MemDC, MemDC);
Parent.Perform(WM_PAINT, MemDC, 0);
BF.SourceConstantAlpha := TransparentPercent;
BF.AlphaFormat := 0;
BF.BlendOp := AC_SRC_OVER;
BF.BlendFlags := 0;
Windows.AlphaBlend(Canvas.Handle, 0, 0, Width, Height, MemDC, Left, Top, Width, Height, BF);
finally
SelectObject(MemDC, OldBitmap);
DeleteDC(MemDC);
DeleteObject(MemBitmap);
end;
end;
begin
inherited;
AlphaBlendTabControl;
end;
end.
2. 设计的时候,panel可以用Anchors = [akLeft, akTop, akRight, akBottom] 加上Align = alCustom达到自动预留边框的目的,就可以避免panel用Align = alClient的时候panel贴边的问题
3. Grid载入数据的时候界面频刷的问题,主要是要Grid paint之初就要设定好高宽,而不是边画边设高宽
posted @ 2011-11-08 14:13 Enli 阅读(35) 评论(0) 编辑
准备好RC文件,例如Quarter.rc:
stringtable
begin
1000, "29"
2000, "第一季度"
2001, "第二季度"
2002, "第三季度"
2003, "第四季度"
2004, "一季报"
2005, "中报"
2006, "三季报"
2007, "年报"
2008, "报告期"
2009, "从"
2010, "到"
2011, "或"
2012, "时间"
2013, "常用时间查询"
2014, "自定义年度查询"
2015, "自定义时间查询"
2016, "筛选条件"
2017, "全部资料"
2018, "请选择时间范围"
2019, "开始时间:"
2020, "结束时间:"
2021, "确认"
2022, "放弃"
2023, "年到"
2024, "年"
2025, "一季"
2026, "中报"
2027, "三季"
2028, "年报"
3000, "Quarter 1"
3001, "Quarter 2"
3002, "Quarter 3"
3003, "Quarter 4"
3004, "Q1 Report"
3005, "Mid-Year Report"
3006, "Q3 Report"
3007, "Annualreport"
3008, "ReportDate"
3009, "From"
3010, "To"
3011, "Or"
3012, "Date"
3013, "Common Time Span"
3014, "User-Defined Year"
3015, "User-Defined Time Span"
3016, "Select by"
3017, "All Related Data"
3018, "Select Time Period"
3019, "Begin Time:"
3020, "End Time:"
3021, "OK"
3022, "Cancel"
3023, "To"
3024, ""
3025, "Q1"
3026, "Q2"
3027, "Q3"
3028, "Q4"
End
begin
1000, "29"
2000, "第一季度"
2001, "第二季度"
2002, "第三季度"
2003, "第四季度"
2004, "一季报"
2005, "中报"
2006, "三季报"
2007, "年报"
2008, "报告期"
2009, "从"
2010, "到"
2011, "或"
2012, "时间"
2013, "常用时间查询"
2014, "自定义年度查询"
2015, "自定义时间查询"
2016, "筛选条件"
2017, "全部资料"
2018, "请选择时间范围"
2019, "开始时间:"
2020, "结束时间:"
2021, "确认"
2022, "放弃"
2023, "年到"
2024, "年"
2025, "一季"
2026, "中报"
2027, "三季"
2028, "年报"
3000, "Quarter 1"
3001, "Quarter 2"
3002, "Quarter 3"
3003, "Quarter 4"
3004, "Q1 Report"
3005, "Mid-Year Report"
3006, "Q3 Report"
3007, "Annualreport"
3008, "ReportDate"
3009, "From"
3010, "To"
3011, "Or"
3012, "Date"
3013, "Common Time Span"
3014, "User-Defined Year"
3015, "User-Defined Time Span"
3016, "Select by"
3017, "All Related Data"
3018, "Select Time Period"
3019, "Begin Time:"
3020, "End Time:"
3021, "OK"
3022, "Cancel"
3023, "To"
3024, ""
3025, "Q1"
3026, "Q2"
3027, "Q3"
3028, "Q4"
End
用此RC文件编译成res文件,然后在代码中加上 {$R Quarter.res}
从RC编译成RES文件有2个方法
1. 直接添加到工程中,build就可以了
2. 用命令brcc32 FileName.rc 编译
posted @ 2011-10-27 19:20 Enli 阅读(26) 评论(0) 编辑
摘要: unit uWnDownClass;interfaceuses Windows,Messages,SysUtils,Classes,WinInet;const WM_HTTPCOMM_PROGRESS = WM_USER + 1700; InnerAgent = 'Mozilla/4.0 (compatible; MSIE 6.0; Win32)'; HttpVersion = 'HTTP/1.1'; D_C_T = 'Content-Type:application/x-www-form-urlencoded'; D_C_T_S = Lengt阅读全文
posted @ 2011-10-19 09:27 Enli 阅读(54) 评论(0) 编辑
摘要: 转至:http://www.cnblogs.com/Equn93/archive/2010/04/27/1722070.html问题1:服务端接收的所有中文都是"?????"(乱码) 解决:设置HTTPRIO控件的HTTPRIO.HTTPWebNode.UserUTF8InHeader属性为true问题2:Dephi编写的客户端在windows2003下调用WebService提示"Access violation at address 00E59195. Write of address 00E59195" 解决:我的电脑属性->高级->性阅读全文
posted @ 2011-08-05 13:19 Enli 阅读(85) 评论(0) 编辑
摘要: 在打包的时候会发现图标,总是不对,或者有时候桌面快捷方式的图标都丢失了可以用以下脚本试试,摘至(http://hi.baidu.com/shaoping007/blog/item/2393bb1e8bd8260f41341750.html):解决:只需重组系统图标缓存 即可。 这里有个批处理很好用把下面的文字复制到文本文档,改后缀名为.bat,双击运行,okrem 关闭Windows外壳程序explorertaskkill /f /im explorer.exerem 清理系统图标缓存数据库attrib -h -s -r "%userprofile%\AppData\Local\Ic阅读全文
posted @ 2011-05-16 13:42 Enli 阅读(263) 评论(0) 编辑
摘要: 1. Variant和Stream的互换procedure VarToStream(var AStm: TStream; var AOvar: Olevariant);var p: Pointer;begin AStm:= TMemoryStream.Create; AStm.Position := 0; p := VarArrayLock(AOvar); AStm.Write(p^, VarArrayHighBound(AOvar, 1)); VarArrayUnlock(AOvar);end;procedure StreamToVar(var AStm: TStream; var AOva阅读全文
posted @ 2011-05-13 17:08 Enli 阅读(50) 评论(0) 编辑
摘要: {****************************************************************************** 文件名称: uWnDownLoadHelper.pas 文件功能: 断点续传下载线程单元 作者 : enli--------------------------------------------------------------------------------}unituWnDownLoadHelper;interfaceusesIdHTTP,IdAuthentication,IdHeaderList,IniFiles,md5,阅读全文
posted @ 2011-04-09 09:46 Enli 阅读(122) 评论(0) 编辑

