Delphi,Windows 10,如何绘制“前景”窗户?
我曾经这样做,并且在Windows XP上工作正常:
var
WND : HWND;
DC : HDC;
FF : HFONT;
begin
FF:= CreateFont (12,0, GM_COMPATIBLE, 0, 12, dword(false),dword(false),dword(false), ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, pchar('Times New Roman'));
WND:= GetForegroundWindow;
DC:= GetDC(WND);
SelectObject(DC, FF);
TextOut (DC, 0,Y, pchar('test'), 4);
ReleaseDC (WND, DC);
有时仍然有效,例如在应用程序自己的窗口或Delphi7本身上绘制,但例如不使用Firefox。如何在 Windows 10 上进行防弹?
I used to do it with that and worked fine on Windows XP:
var
WND : HWND;
DC : HDC;
FF : HFONT;
begin
FF:= CreateFont (12,0, GM_COMPATIBLE, 0, 12, dword(false),dword(false),dword(false), ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, pchar('Times New Roman'));
WND:= GetForegroundWindow;
DC:= GetDC(WND);
SelectObject(DC, FF);
TextOut (DC, 0,Y, pchar('test'), 4);
ReleaseDC (WND, DC);
it sometimes still works, for example draws onto the application's own window, or onto Delphi7 itself, but for example not working on Firefox. How to do it bulletproofly on Windows 10?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论