def Setup(self, plugin, waitTime): """ This will be called inside the thread at the beginning. """ self.plugin = plugin self.waitTime = waitTime self.timer = Timer(0, self.OnTimeOut) self.lastEvent = None wc = WNDCLASS() wc.hInstance = GetModuleHandle(None) wc.lpszClassName = "HiddenMceMessageReceiver" wc.lpfnWndProc = WNDPROC(self.MyWndProc) if not RegisterClass(byref(wc)): raise WinError() self.hwnd = CreateWindowEx(0, wc.lpszClassName, "MCE Remote Message Receiver", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, wc.hInstance, None) if not self.hwnd: raise WinError() self.wc = wc self.hinst = wc.hInstance self.dll = WinDLL(os.path.join(PLUGIN_DIR, "MceIr.dll")) if not self.dll.MceIrRegisterEvents(self.hwnd): raise self.plugin.Exceptions.DeviceNotFound self.dll.MceIrSetRepeatTimes(1, 1)
def __init__(self, parent): wx.PyWindow.__init__(self, parent) size = GetSystemMetrics(SM_CYHSCROLL), GetSystemMetrics(SM_CXVSCROLL) self.SetMinSize(size) self.SetMaxSize(size) self.sizeGripHandle = CreateWindowEx(0, "Scrollbar", None, FLAGS, 0, 0, 0, 0, self.GetHandle(), 0, GetModuleHandle(None), None)
def Setup(self): """ Overrides eg.ThreadWorker.Setup to create the window instance. """ self.hwnd = CreateWindowEx(0, self.wndclass.lpszClassName, self.windowName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, self.wndclass.hInstance, None) if not self.hwnd: raise WinError()