基于python 3.5
<code class="lang-python">from ctypes import * from ctypes.wintypes import * WNDPROC = WINFUNCTYPE(LPARAM, HWND, UINT, WPARAM, LPARAM) class WNDCLASSEX(Structure): _fields_ = [("cbSize", UINT), ("style", UINT), ("lpfnWndProc", WNDPROC), ("cbClsExtra", c_int), ("cbWndExtra", c_int), ("hInstance", HANDLE), ("hIcon", HANDLE), ("hCursor", HANDLE), ("hBrush", HANDLE), ("lpszMenuName", LPCWSTR), ("lpszClassName", LPCWSTR), ("hIconSm", HANDLE)] WS_OVERLAPPEDWINDOW = 0xCF0000 SW_SHOW = 5 CS_HREDRAW = 2 CS_VREDRAW = 1 CW_USEDEFAULT = 0x80000000 WM_DESTROY = 2 WHITE_BRUSH = 0 IDI_APPLICATION = 32512 IDC_ARROW = 32512 # program starts here def PyWndProc(hwnd, message, wparam, lparam): if message == WM_DESTROY: windll.user32.PostQuitMessage(0) return 0 else: return windll.user32.DefWindowProcW(HWND(hwnd), message, WPARAM(wparam), LPARAM(lparam)) WndProc = WNDPROC(PyWndProc) hInst = windll.kernel32.GetModuleHandleW(None) wndclass = WNDCLASSEX() wndclass.cbSize = sizeof(WNDCLASSEX) wndclass.style = CS_HREDRAW | CS_VREDRAW wndclass.lpfnWndProc = WndProc wndclass.cbClsExtra = 0 wndclass.cbWndExtra = 0 wndclass.hInstance = hInst wndclass.hIcon = windll.user32.LoadIconW(None, IDI_APPLICATION) wndclass.hCursor = windll.user32.LoadCursorW(None, IDC_ARROW) wndclass.hBrush = windll.gdi32.GetStockObject(WHITE_BRUSH) wndclass.lpszMenuName = None wndclass.lpszClassName = u'MyWndClass' wndclass.hIconSm = windll.user32.LoadIconW(None, IDI_APPLICATION) windll.user32.RegisterClassExW(byref(wndclass)) hwnd = windll.user32.CreateWindowExW( 0, u'MyWndClass', u'标题', WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, None, None, HANDLE(hInst), None) windll.user32.ShowWindow(HWND(hwnd), SW_SHOW) windll.user32.UpdateWindow(HWND(hwnd)) msg = MSG() while windll.user32.GetMessageW(byref(msg), None, 0, 0): windll.user32.TranslateMessage(byref(msg)) windll.user32.DispatchMessageW(byref(msg))</code>
[修改于 9年0个月前 - 2016/01/11 17:04:54]
时段 | 个数 |
---|---|
{{f.startingTime}}点 - {{f.endTime}}点 | {{f.fileCount}} |
200字以内,仅用于支线交流,主线讨论请采用回复功能。