本文整理自网络,侵删。
function WindowProc(hWnd,Msg,wParam,lParam:Integer):Integer; stdcall;
begin
if Msg = WM_DESTROY then PostQuitMessage(0)
else if Msg = WM_lBUTTONDOWN then DoSomething;
Result := DefWindowProc(hWnd,Msg,wParam,lParam);
end;
function MyWindow(Ptr: Pointer):Longint;stdcall;
begin
wClass.lpszClassName:= 'CN';
wClass.lpfnWndProc := @WindowProc;
wClass.hInstance := hInstance;
wClass.hbrBackground:= 1;
RegisterClassA(wClass);
CreateWindow(wClass.lpszClassName,'My Window',
WS_OVERLAPPEDWINDOW or WS_VISIBLE,
10,10,530,100,0,0,hInstance,nil);
while GetMessage(Msg,0,0,0) do
DispatchMessage(Msg);
end;
begin
CreateThread(nil, 0, @MyWindow, nil, 0, thrID);
end.
相关阅读 >>
Delphi vcl 模式下和firemonkey 模式下的字符串
Delphi lastdelimiter:在字符串中查找选定的字符最后出现的位置
Delphi 判断一个数组的长度用 length 还是 sizeof ?
Delphi 判断目录是否存在,不存在则创建目录并打开,存在则直接打开
Delphi xe7 android 实现的在线更新app的一个程序
Delphi显示 jpg、png、gif 图片及 gif 动画
Delphi datasnap 上传/下载大文件(本demo以图传片文件为例)
更多相关阅读请进入《Delphi》频道 >>