-
Hello, i have two question for you:
1)How to create timer in code only?
When i use the Control timer i can only get upto 10000 ms and it's not enough to me. :)
I like to now how can i create a timer class in code only without any controls so i can use it in module or other class without a form object.
2)How can i find the window Module (File Name)?
I need to know how can i find the window module (the file that execute this window or thread).
When i use GetWindowLong and pass to it Public Const GWL_HINSTANCE = (-6) and then use the API function GetModuleFileName i not always get the right file name.
Please try to help me.
Thank you,
Kiron.
-
First let me say that I already answered your 1st question... Search the forum before you ask such simple things. However, here's the code:
Code:
'In module:
Public Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
'Your timer
Dim Interval as Long
Dim NextTick as Long
Dim Temp as Long
Interval = 1000 'Also in ms
Temp = GetTickCount()
If NextTick < Temp Then
NextTick = ( Temp + Interval )
'Code here
Endif