Run the main windows message loop.
()
| 218 | return 0 |
| 219 | |
| 220 | def WinMSGLoop(): |
| 221 | """Run the main windows message loop.""" |
| 222 | from ctypes import POINTER, byref, c_ulong |
| 223 | from ctypes.wintypes import BOOL, HWND, MSG, UINT |
| 224 | |
| 225 | LPMSG = POINTER(MSG) |
| 226 | LRESULT = c_ulong |
| 227 | GetMessage = get_winfunc("user32", "GetMessageW", BOOL, (LPMSG, HWND, UINT, UINT)) |
| 228 | TranslateMessage = get_winfunc("user32", "TranslateMessage", BOOL, (LPMSG,)) |
| 229 | # restype = LRESULT |
| 230 | DispatchMessage = get_winfunc("user32", "DispatchMessageW", LRESULT, (LPMSG,)) |
| 231 | |
| 232 | msg = MSG() |
| 233 | lpmsg = byref(msg) |
| 234 | while GetMessage(lpmsg, HWND(), 0, 0) > 0: |
| 235 | TranslateMessage(lpmsg) |
| 236 | DispatchMessage(lpmsg) |
| 237 | |
| 238 | if __name__ == "__main__": |
| 239 | # Create a connection to ESOTS (OTS Swardfish) and to instrument MAR11 ALSI |
no test coverage detected