FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MBPython/MBPython/timer.py at master · lochen88/MBPython · GitHub
lochen88
/
MBPython
Public
Notifications
You must be signed in to change notification settings
Fork
12
Star
62
Code
Issues
3
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MBPython
/
MBPython
/
timer.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (27 loc) · 846 Bytes
Breadcrumbs
MBPython
/
MBPython
/
timer.py
Copy path
File metadata and controls
29 lines (27 loc) · 846 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding:utf-8 -*-
from
ctypes
import
(
c_void_p
,
windll
,
WINFUNCTYPE
)
from
ctypes
.
wintypes
import
(
DWORD
,
HWND
,
UINT
)
from
.
method
import
method
user32
=
windll
.
user32
class
Timer
:
def
__init__
(
self
):
self
.
timer_func_dict
=
{}
def
setTimer
(
self
,
hwnd
,
nid
,
dwTime
,
is_timer_one
=
True
):
self
.
is_timer_one
=
is_timer_one
return
user32
.
SetTimer
(
hwnd
,
nid
,
dwTime
,
self
.
_timerCallBack
)
@
method
(
WINFUNCTYPE
(
c_void_p
,
HWND
,
c_void_p
,
UINT
,
DWORD
))
def
_timerCallBack
(
self
,
hwnd
,
msg
,
nid
,
dwTime
):
if
hasattr
(
self
,
'timerCallBack'
):
if
self
.
is_timer_one
:
self
.
timerCallBack
(
hwnd
=
hwnd
,
msg
=
msg
,
nid
=
nid
,
dwTime
=
dwTime
)
user32
.
KillTimer
(
hwnd
,
nid
)
return
0
return
self
.
timerCallBack
(
hwnd
=
hwnd
,
msg
=
msg
,
nid
=
nid
,
dwTime
=
dwTime
)
Back
|
FazBrowse Home
|
New Git URL