易截截图软件、单文件、免安装、纯绿色、仅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汇编帮助

 The built-in assembler allows you to write assembly code within Delphi programs. It has the following features:
内嵌的汇编器允许在delphi程序中书写汇编代码,他有如下特性:
Allows for inline assembly
允许内嵌汇编
    Supports all instructions found in the Intel Pentium III, In ......

Delphi编译指令说明

《Delphi下深入Windows核心编程》(附录A Delphi编译指令说明)
摘抄人:麻子 qq:71892967
Delphi快速高小的编译器主要来自Object PASCAL的严谨,使用Delphi随时都在与编译器交流,大部分情况下不需要干涉编译器的运行,但是有时也需要对编译器进行必要的设置。
*************************************************** ......

Delphi 资源


 关于IntraWeb程序在编译时出现错误的解决方法
错误提示:[Error] IWLicenseKey.pas(12): Undeclared identifier: 'SetLicenseKey'
处理方法:进入菜单Tools->Environment Options,选择‘Library’,将'Library path'参数中有关intraweb的目录放在前面即可。
使用&n ......

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号