|
-
Apr 25th, 2002, 04:07 PM
#1
Thread Starter
Junior Member
Screensaver Blues
(Since this is the Graphics forum, I thought I'd use a color in the subject---woo ha ha.)
I'm writing a custom screensaver (in VB6) that some of you may find pretty boring---it displays random text and quotes. However, I'd really appreciate your help with a couple of things:
(1) As usual, I copy the .scr file to Windows/System, then choose it from the Screen Savers list in Display Properties. The screensaver then runs after the designated time.
However, from that point on, Windows no longer shows the screensaver's title in the Screen Savers box; it's reset to "(None)." And yet Windows keeps running the screensaver normally. How come it can't remember the name? And why does it keep using it when the box says "(None)"?
(2) I'd like to add the option to smoothly scroll the text across the screen. I've tried Move (with the text in a picture box)---and it's very fast, even with DoEvents in the loop (which you need, right?). However, when I try to control the speed by adding a timer-check loop:
TimesUp = False
Do
DoEvents
If TimesUp = True then Exit Do
Loop
...everything slows to a crawl---even with the timer set to 1 millisecond.
Am I doing this all wrong? If I need to use API calls, etc., do you think you could explain it so even a non-genius like I could understand?
Thanks for your help!
-
Apr 26th, 2002, 10:46 AM
#2
Fanatic Member
Use gettickcount API. Such as:
VB Code:
TimesUp = Gettickcount + Delay
Do
DoEvents
Loop until TimesUp <= Gettickcount
TimesUp needs to be a long (&), and delay should be a positive value (for obvisus reasons), and should also be a long. The Delay value is the number of milliseconds to delay for.
-
Apr 26th, 2002, 10:48 AM
#3
Fanatic Member
You would have to use the Api Viewer (or a search of the forums) to find the declation of the api. My school didn't bother to install the api viewer (those cheap asses... ).
-
Apr 27th, 2002, 11:41 AM
#4
Declare Function GetTickCount Library "kernel32" () As Long
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 28th, 2002, 05:27 AM
#5
Thread Starter
Junior Member
Thanks, guys! I'll give it a try ASAP.
Cheers, Ander
-
May 1st, 2002, 03:20 AM
#6
Thread Starter
Junior Member
Wow!
Wow---getTickCount is great! I may never use a timer again. :?)
Thanks, guys. You're geniuses.
By the way, the actual declaration is:
Declare Function GetTickCount Lib "kernel32" () As Long
("Lib" instead of "Library".)
-
May 1st, 2002, 03:29 AM
#7
PowerPoster
*smile* YES! YES! Timers are evil
-
May 1st, 2002, 07:29 AM
#8
Good Ol' Platypus
If you need more precision, you can use the QueryPerformanceCounter/Frequency API calls. They offer (depending on the computer) < 1 ms accuracy.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 1st, 2002, 02:16 PM
#9
You know, that Declare thing is the only thing I've ever used in VB, and that's a while ago.
Used it to insert my own lib into someone else's app...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|