win32_counter.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:KeyCounter 作者: Microcore 项目源码 文件源码
def instance_running(self):
        '''
        Use CreateEvent to make sure there is only one instance running
        '''
        if self.SICHECK_EVENT is None:
            self.SICHECK_EVENT = win32event.CreateEvent(
                None, 1, 0, self.GUID
            )
            # An instance is already running, quit
            if win32api.GetLastError() == winerror.ERROR_ALREADY_EXISTS:
                win32gui.MessageBox(
                    self.HWND,
                    'You can only run one instance at a time',
                    'Seems like KeyCounter is already running',
                    win32con.MB_OK
                )
                return self.stop()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号