For MIKEP - ScreenSaver

(I'm using VB5 Enterprise Edition)
I saw your post on ScreenSavers and like it very much.
But I keep getting "Compile Error: Invalid use of
ME keyword" in the following code:

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    Dim PWOK As Boolean

    ' If passwords are turned on and we are not on NT check     ' the password.
If RunMode = RM_NORMAL Then
       If PWMode = 1 And CurrOS = "95" Then
          ShowCursor True ' Need the cursor for the dialog                            ' box

' compiler doesn't like this!
          PWOK = VerifyScreenSavePwd(Me.hwnd)

          If PWOK = False Then Cancel = True
          ShowCursor False ' Get rid of cursor - turn back                             ' on if exiting
       End If
    End If

Can you give me any help for this? How could I
rewrite it to not use Me keyword?
P.S. Is this code I call when mouse is moved? Or, does
it work automatically somehow?

Any help apreciated............Jerry
Who is Participating?
watyConnect With a Mentor Commented:
Tell me what you think about this screen saver. I have used this one to make the one of the company.
If you want a complete code source for screen saver, give me your e-mail, I will send it to you or you can download it from my web site :

It implements sprites accross the screen...
It worth to take a look
jgoreAuthor Commented:
Thanks Waty, but I really just wanted the above question answered about the
Me keyword. I really just wanted the Skeleton code ,that MikeP gave us, to work.
It would be much simpler for me to build on.

Incedently, I got the following errors when trying to compile your code:
'Your program won't compile because of this line:
Private WithEvents m_tmr  As CTimer

Which gives this error:
MISSING: Subclassing and Timer Assistant (with
configurable message response, multi-control support + timer bug fix)

There may be others, but it wouldn't let me get past this.
I'm not really interested in your code, although it does look nice, becuase
I wanted to start from scratch. Thanks anyways.

Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

This code is not supposed to be called from anyware. You just paste it into the code window of your form (click on your form and then F7). This will be called when the program unloads automaticly
To run my screen saver, you need to download the the Subclasser DLL

jgoreAuthor Commented:
Thanks, I'll try the Subclasses DLL, just downloaded it.
I have the other Screensaver working, but would like to play with yours
because of the sprites.
Now that I have all I need to run yours, go ahead and "Answer" this question
and I'll throw you 50 pts and an"A" (otherwise it will stay in limbo  ;-).  
If you like.

Thanks also to MikeP!  You have both helped me alot!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.