博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
NativeWindow_01
阅读量:6891 次
发布时间:2019-06-27

本文共 1856 字,大约阅读时间需要 6 分钟。

1、

  “{$O-}”关闭优化

  “{$O-}”打开优化

2、

unit NativeWindow;interfaceuses  Windows, Messages, SysUtils;procedure CreateWindow;implementationfunction ProcWindow(_hWnd :HWND;                    _uMsg :UINT;                    _wParam :WPARAM;                    _lParam :LPARAM):longint;stdcall;var  hDc1 :HDC;  ps :PAINTSTRUCT;begin  if (_uMsg = WM_LBUTTONUP) then  begin    MessageBox(0, 'Up', '1', 0);  end  else if (_uMsg = WM_PAINT) then    begin    hDc1 := BeginPaint(_hWnd, ps);    TextOut(hDc1, 0, 0, 'ASDFG zxcvb', strlen('ASDFG zxcvb'));    EndPaint(_hWnd, ps);    Result := 0;    Exit;    end  else if (_uMsg = WM_DESTROY) then  begin    DestroyWindow(_hwnd);    PostQuitMessage(0);      Result := 0;    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 := 0; wndcls.cbWndExtra := 0; wndcls.hbrBackground := HBRUSH(GetStockObject(WHITE_BRUSH)); // 背景画刷 wndcls.hCursor := LoadCursor(0, IDC_CROSS); wndcls.hIcon := LoadIcon(0, 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, 100, 100, 400, 300, 0, 0, //g_hMenu, hInstance, 0); if (hWnd1 = 0) then iErr := GetLastError;// ShowWindow(hWnd1, SW_SHOWNORMAL); UpdateWindow(hWnd1);end;{
$O+}end.

3、

 

转载于:https://www.cnblogs.com/CodeSkill/p/6099954.html

你可能感兴趣的文章
计算机集群多任务投递脚本
查看>>
Flume数据采集之常见集群配置案例
查看>>
自定义ANDROID中EDITTEXT中的HINT文本的大小
查看>>
Unity3D下用C#通过WinSCP命令行方式给Linux服务器SCP传文件
查看>>
Fedora遇难记之rpmfusion:获取 GPG 密钥失败
查看>>
Exception
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
VC改变鼠标的WM_SETCURSOR( setcursor() )
查看>>
jQuery添加/改变/移除CSS类及判断是否已经存在CSS
查看>>
Leetcode PHP题解--D82 13. Roman to Integer
查看>>
使用scrapy抓取股票代码
查看>>
hashmap实现原理浅析
查看>>
1.1什么是数据仓库
查看>>
注册个博客好累哦
查看>>
spring mvc 如何从前台表单传递集合参数并绑定集合对象
查看>>
编程实现strcpy函数功能
查看>>
网络红人魏道道:做微商的不知道就真的“out”了
查看>>
PHP关于时间的时段的重合、 整合的方法
查看>>
awk sed grep 正则表达式
查看>>