1、

  “{$O-}”关闭优化

  “{$O-}”打开优化

2、

unit NativeWindow;

interface

uses
Windows, Messages, SysUtils; procedure CreateWindow; implementation function ProcWindow(_hWnd :HWND;
_uMsg :UINT;
_wParam :WPARAM;
_lParam :LPARAM):longint;stdcall;
var
hDc1 :HDC;
ps :PAINTSTRUCT;
begin
if (_uMsg = WM_LBUTTONUP) then
begin
MessageBox(, 'Up', '', );
end
else if (_uMsg = WM_PAINT) then
begin
hDc1 := BeginPaint(_hWnd, ps);
TextOut(hDc1, , , 'ASDFG zxcvb', strlen('ASDFG zxcvb'));
EndPaint(_hWnd, ps);
Result := ;
Exit;
end
else if (_uMsg = WM_DESTROY) then
begin
DestroyWindow(_hwnd);
PostQuitMessage(); Result := ;
Exit;
end;
Result := DefWindowProc(_hWnd, _uMsg, _wParam, _lParam);
end; {$O-}
procedure CreateWindow;
var wndcls :WNDCLASS;
hInstance :THandle;
hWnd1 :HWND;
iErr :integer;
begin
hInstance := Windows.GetModuleHandle(nil); ZeroMemory(@wndcls, sizeof(wndcls));
wndcls.cbClsExtra := ;
wndcls.cbWndExtra := ;
wndcls.hbrBackground := HBRUSH(GetStockObject(WHITE_BRUSH)); // 背景画刷
wndcls.hCursor := LoadCursor(, IDC_CROSS);
wndcls.hIcon := LoadIcon(, IDI_ERROR); // 窗口图标
wndcls.hInstance := hInstance;
wndcls.lpfnWndProc := @ProcWindow;
wndcls.lpszClassName:= 'zc20110929';
wndcls.lpszMenuName := nil;
wndcls.style := CS_HREDRAW or CS_VREDRAW;
RegisterClass(wndcls); hWnd1 := CreateWindowEx(
WS_EX_CLIENTEDGE,
wndcls.lpszClassName,
'ZC Window',
WS_OVERLAPPEDWINDOW,
, ,
, ,
,
, //g_hMenu,
hInstance,
);
if (hWnd1 = ) then
iErr := GetLastError; // ShowWindow(hWnd1, SW_SHOWNORMAL);
UpdateWindow(hWnd1);
end;
{$O+} end.

3、

NativeWindow_01的更多相关文章

随机推荐

  1. jQuery选择器概览

    层级 ancestor descendant parent > child prev + next prev ~ siblings 基本筛选器 :first :not(selector) :ev ...

  2. 160629、 DBCP、C3P0、Proxool 、 BoneCP开源连接池的比较

       简介   使用评价  项目主页  DBCP DBCP是一个依赖Jakarta commons-pool对象池机制的数据库连接池.DBCP可以直接的在应用程序用使用 可以设置最大和最小连接,连接等 ...

  3. C# 利用StringBuilder提升字符串拼接性能

    一个项目中有数据图表呈现,数据量稍大时显得很慢. 用Stopwatch分段监控了一下,发现耗时最多的函数是SaveToExcel 此函数中遍列所有数据行,通过Replace替换标签生成Excel行,然 ...

  4. curl post CURLOPT_POSTFIELDS

    PHP: curl_setopt - Manual http://php.net/manual/en/function.curl-setopt.php CURLOPT_POST TRUE to do ...

  5. Maven 整合SSH框架之pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  6. C++ 常见字符处理 收录

    1.string字符串删除 字符串中 指定字符 std::string& HTTPRequestHandlerImpl::replace_all_distinct(std::string&am ...

  7. 10.Query an Array-官方文档摘录

    1.插入 db.inventory.insertMany([ { item: "journal", qty: 25, tags: ["blank", " ...

  8. MySQL给字段唯一索引的三种方法

    建表时添加 DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `stu_id` ) NOT NULL AUTO_INCREMENT, ` ...

  9. Matlab/Simulink仿真中如何将Scope转化为Figure?

    1.只需要在运行仿真后,在命令窗口内输入: ,'ShowHiddenHandle','on'); set(gcf,'menubar','figure'); scope最上方会出现一个菜单栏,选择Too ...

  10. 我的Android进阶之旅------&gt;Android无第三方Jar包的源代报错:The current class path entry belongs to container ...的解决方法

    今天使用第三方Jar包afinal.jar时候.想看一下源码,无法看 然后像加入jar相应的源代码包.也无法加入相应的源代码,报错例如以下:The current class path entry b ...