Timer Event won't fire when app doesn't have focus 
Author Message
 Timer Event won't fire when app doesn't have focus

I'm attempting to write a utility that monitors the numlock state and if
numlock is turned off, the program turns it back on. I find that while
working in Microsoft Access, Access occasionally turns the numlock off for
no apparent reason, and I find it quite annoying. I've got a program that
uses api's and the form's timer event to monitor the status and turn it on
if necessary, but when the app does not have the focus, the timer event does
not fire. I'm stumped on how to get the app to continue to monitor the
numlock.

Thanks For Your Help!



Thu, 23 Nov 2000 03:00:00 GMT  
 Timer Event won't fire when app doesn't have focus



Quote:
>I'm attempting to write a utility that monitors the numlock state and if
>numlock is turned off, the program turns it back on. I find that while
>working in Microsoft Access, Access occasionally turns the numlock off for
>no apparent reason, and I find it quite annoying. I've got a program that
>uses api's and the form's timer event to monitor the status and turn it on
>if necessary, but when the app does not have the focus, the timer event does
>not fire. I'm stumped on how to get the app to continue to monitor the
>numlock.

>Thanks For Your Help!

I don't know why the timer event is not firing... It should.. but you
could always just use the SetTimer, and KillTimer API to set up your
own timers... Example:

'Module:

Option Explicit

Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal
nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As
Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal
nIDEvent As Long) As Long

Function TimerProc() As Long
    Beep
    TimerProc = 1
End Function

'Form:

Private Sub Command1_Click()
    SetTimer Form1.hwnd, 1, 1000, AddressOf TimerProc
End Sub
Private Sub Command2_Click()
    KillTimer Form1.hwnd, 1
End Sub

===End Of Code===

Give that a try...

Donkey

????????????????????????????????????????????
DOS never says "EXCELLENT command or filename"
-
Note: remove "NOSPAM" from my address
to e-mail me
????????????????????????????????????????????



Fri, 24 Nov 2000 03:00:00 GMT  
 Timer Event won't fire when app doesn't have focus

Are you running Win 3.X?
I could understand that happening in previous versions of Windows but not in
Windows 95 and specially not in NT.
More information could help.

--
Gerardo Villeda MVP - VB

Quote:

>I'm attempting to write a utility that monitors the numlock state and if
>numlock is turned off, the program turns it back on. I find that while
>working in Microsoft Access, Access occasionally turns the numlock off for
>no apparent reason, and I find it quite annoying. I've got a program that
>uses api's and the form's timer event to monitor the status and turn it on
>if necessary, but when the app does not have the focus, the timer event
does
>not fire. I'm stumped on how to get the app to continue to monitor the
>numlock.

>Thanks For Your Help!



Fri, 24 Nov 2000 03:00:00 GMT  
 Timer Event won't fire when app doesn't have focus

Matt;

Is your scheduling set to Exclusive in Foreground (See Control Panel).

It should fire, even when minimized, without focus.  Mine does.

LFS



Fri, 24 Nov 2000 03:00:00 GMT  
 Timer Event won't fire when app doesn't have focus

Are you using Sendkeys? That function, (depending on the keyboard driver),
toggles numlock.

Jon

Quote:

>I'm attempting to write a utility that monitors the numlock state and if
>numlock is turned off, the program turns it back on. I find that while
>working in Microsoft Access, Access occasionally turns the numlock off for
>no apparent reason, and I find it quite annoying. I've got a program that
>uses api's and the form's timer event to monitor the status and turn it on
>if necessary, but when the app does not have the focus, the timer event
does
>not fire. I'm stumped on how to get the app to continue to monitor the
>numlock.

>Thanks For Your Help!



Fri, 24 Nov 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Timer Event won't fire when app doesn't have focus

2. Item_Sent event doesn't always fire??

3. VBScript Item_Open event doesn't always fire?

4. Application_Startup event doesn't fire

5. item_open event doesn't fire

6. BeforeNavigate2 Event Doesn't Fire in VB.NET

7. DB Combo doesn't fire Change event?

8. ListView event doesn't fire when set programmically

9. LostFocus event doesn't fire

10. Custom event doesn't fire!

11. Webbrowser control doesn't fire NavigateComplete2 after DocumentComplete event

12. Validate event doesn't fire into OCX

 

 
Powered by phpBB® Forum Software