This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
public
Signed in as
public
Profile
Starred
Subscriptions
Settings
Help
Sign Out
yws
/
lc-mcp
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
lc-mcp
/
scripts
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
# -*- coding: utf-8 -*- """桌面渲染自检: 从屏幕 DC 做一次 BitBlt。 成功 = 桌面正在出图(会话处于渲染状态); 失败(err 6 ERROR_INVALID_HANDLE) = 会话被断开, Windows 拆掉了显示表面, 此时游戏截图会全黑, AALC 会失明。 退出码: 0 渲染正常, 1 渲染不可用 """ import ctypes SRCCOPY = 0x00CC0020 def main(): u = ctypes.windll.user32 g = ctypes.windll.gdi32 hdc = u.GetDC(0) mem = g.CreateCompatibleDC(hdc) bmp = g.CreateCompatibleBitmap(hdc, 64, 64) g.SelectObject(mem, bmp) r = g.BitBlt(mem, 0, 0, 64, 64, hdc, 0, 0, SRCCOPY) g.DeleteObject(bmp) g.DeleteDC(mem) u.ReleaseDC(0, hdc) print('BitBlt=%d desktop=%dx%d' % (r, u.GetSystemMetrics(0), u.GetSystemMetrics(1))) return 0 if r else 1 if __name__ == '__main__': raise SystemExit(main())
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
codex/local-wip-20261022
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel