-
I have written a program that checks the resolution every 1 sec for a resoltion change so that the program can alter the desktop picture.
1) I know there is a better way than using a timer to check but I am not sure how to do it.
2) Does anyone know how to activate the Active Desktop and add a htm file as the backgroud via VB.
The reason I would like to change it is that when you alter the Resolution and don't immediatley click to maintain the settings it causes a fatal exception.
Any help would be greatly apprectated.
Regards Matt
-
You can use GetTickCount() :
Code:
Dim LastTick As Long
Dim CurrentTick As Long
Private Const UpdateSpeed As Long = 60
'Change the UpdateSpeed as required
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub RunGameLoop()
'Rename the loop if applicable ...
Do
CurrentTick = GetTickCount()
DoEvents
If ((CurrentTick - LastTick) >= UpdateSpeed) Then
LastTick = GetTickCount()
'Do the res checking
End If
Loop
End Sub
That should do it.
- Jamie
-
Thanks
Thanks a lot at the rate you are going you'll be writing all my prgram. :)
Thanks again