易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi PureAPIWindow program

program PureAPIWindow;
uses
SysUtils,
Windows,
Messages;
const
WinClassName = 'DvsClass';
StrOut = 'Davis TextOut';
//窗口回调函数
function MyWinProc(
hWindow: HWND;
aMessage: UINT;
WParam: WPARAM;
LParam: LPARAM): LRESULT; stdcall; export;
var
dc: HDC;
ps: TPaintStruct;
rect: TRect;
begin
MyWinProc := 0;
case aMessage of
WM_PAINT:
begin
dc := BeginPaint(hWindow,ps);
GetClientRect(hWindow,rect);
DrawText(dc,StrOut,Length(StrOut),rect,DT_SINGLELINE or DT_CENTER or DT_VCENTER);
//TextOut(dc,0,0,StrOut,Length(StrOut));
EndPaint(hWindow,ps);
end;
WM_LBUTTONDOWN:
begin
dc := GetDC(hWindow);//GetDC(0);
TextOut(dc,0,0,'Left Button Down',Length('Left Button Down'));
ReleaseDC(hWindow,dc);
//ReleaseDC(0,dc);
end;
WM_CLOSE:
if ID_YES = MessageBox(0,'Are you sure exit ?','Propmt info',MB_YESNO) then
begin
DestroyWindow(hWindow);
end;
WM_DESTROY:
begin
PostQuitMessage(0);
end;
else
Result := DefWindowProc(hWindow,aMessage,WParam,LParam);
end;
end;
function WinRegister: Boolean;
var
wndClass: TWndClass;
hInstance: Cardinal;
begin
hInstance := GetModuleHandle(0);
//
wndClass.style := CS_VREDRAW or CS_HREDRAW;
wndClass.lpfnWndProc := TFNWndProc(@MyWinProc); //Callback function
wndClass.cbClsExtra := 0;
wndClass.cbWndExtra := 0;
wndClass.hInstance := hInstance;//Same as System.MainInstance; //实例句柄
wndClass.hIcon := LoadIcon(0,IDI_INFORMATION);
wndClass.hCursor := LoadCursor(0,IDC_CROSS);
wndClass.hbrBackground := HBRUSH(GetStockObject(BLACK_BRUSH));
wndClass.lpszMenuName := nil;
wndClass.lpszClassName := WinClassName;
//
Result := Windows.RegisterClass(wndClass) <> 0;
end;
function WinCreate: HWND;
var
hWindow: HWND;
hInstance: Cardinal;
begin
hInstance := GetModuleHandle(0);
hWindow := C


相关文档:

终于搞定了Delphi的Unicode支持(Tnt控件)

原来是要在FormCreate中加入以下代码:
procedure TTntForm1.TntFormCreate(Sender: TObject);
begin
  //这句很关键.对于平台的支持.
  if Win32Platform = VER_PLATFORM_WIN32_NT then
    Font.Name := 'MS Shell Dlg 2'
  else
    Font.Name := 'MS Shell Dlg';
......

delphi 实现 图片类型转换 jpg

下面三个delphi函数实现了bmp类型图片和jpg(jpeg)类型图片的转换和改变位图图片的大小。
jpg转换为bmp:
{********************************************
作者/日期
描述: 实现jpg(jpeg)图片向bmp图片的转换
参数介绍
FileName:要转换的jpg(jpeg)图片的名称(包括路径)
SaveFileName:转换后的bmp图片的存储位置。 ......

谁说Delphi没有哈希

谁说Delphi没有哈希?--Delphi中,TStringList和THashedStringList的性能对比
曾经看到很多人在嚷嚷Delphi没有哈希表,这些人的动手意识姑且不论,却还有很多人以此来证明Delphi比别的语言垃圾,实在是...
好,牢骚打住,转接正题。
TStringList是我们常用的字符串列表类型,用法就不在这里赘述,但是,在数据其项数增 ......

Delphi Pubic Function

function GetFileSizeString(const pFileName: String):String;
var
iFileSize: Int64;
begin
Result := '0';
iFileSize := FileSizeByName(pFileName);
Result := IntToStr(iFileSize);
end;
  function WinExecAndWait(strFileName: string; uCmdShow: UINT): DWORD;
var
cAppName: array ......

delphi中用ado连接oracle 10g

2009-12-01  00:41:35
之前安装了oracle 10g,后来为了在C#里面连接oracle,安装了ODAC,之后连接数据库时,填写数据库服务名,总是会出错,连接测试无法通过,不填数据库服务名,倒还可以通过连接测试
今晚终于查到原因了。。。
系统属性那里的环境变量,path这里,oracle的两个默认路径:
d:\oracle\product\10. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号