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
相关文档:
以前看了 通过崩溃地址找错误行数之VC版 那时候还没用DELPHI
昨晚刚好又看到了 所以就试了一下DELPHI的,与大家共享 ^_^
什么是 MAP 文件?简单地讲, MAP 文件是程序的全局符号、源文件和代码行号信息的唯一的文本表示方法,它可以在任何地方、任何时候使用,不需要有额外的程序进行支持。而且,这是唯一能找出程 ......
unit Servicescontrol;
interface
uses Windows,Messages,SysUtils,Winsvc,Dialogs;
function StartServices(Const SvrName:String):Boolean;
function StopServices(Const SvrName:String):Boolean;
function QueryServiceStatu(Const SvrName:  ......
最近要做一个图书管理系统,并且是用Delphi软件开发,很多都不懂,本来是可以从网上下载,学习一下的,可是不知道怎么破解登陆密码,运行时没办法登陆进去,5555~~好好学习,有高手指点就好了…… ......
procedure TForm_BaseMDI.FormKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
Key := #0;
SendMessage(Handle, 48384, 9, 0);
end;
end; ......
unit DvsLinkingClass;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs;
type
PRecLinkNode = ^RecLinkNode;
RecLinkNode = record
NodeMsg: String;
Counter: Integer;
Previous: PRecLinkNode;
Next: PRecLinkNode;
end;
TLinkingClass = class
......