Results 1 to 2 of 2

Thread: Whats the deal with this API?

  1. #1

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336

    Whats the deal with this API?

    I need to use this API to create a Motion trail behind the Mouse cursor. I Also Have to have it in a loop because i switch it on or off depending on where the mouse is.

    Paste this in an Empty Form and tell me if your Screen and mouse icon doesnt flicker. In the toolbar Area of VB and Internet explorer also if you grab the edge of a form to stretch the mouse cursor flickers between 2 icons.

    VB Code:
    1. Dim change As Boolean
    2. Private Const SPI_SETMOUSETRAILS = 93
    3. Private Const SPIF_UPDATEINIFILE = &H1
    4. Private Const SPIF_SENDWININICHANGE = &H2
    5. Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
    6. Private Sub Form_Click()
    7. change = True
    8. Do
    9. DoEvents
    10. If change = False Then Call SystemParametersInfo(SPI_SETMOUSETRAILS, 0, ByVal 0&, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE): Exit Sub
    11. Call SystemParametersInfo(SPI_SETMOUSETRAILS, 7, ByVal 0&, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
    12. Loop
    13. End Sub
    14. Private Sub Form_DblClick()
    15. change = False
    16. End Sub
    17. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    18. Me.Cls
    19. Me.Print "Single Click the Form to Start Loop and create Mouse Trail"
    20. Me.Print "Double Click the Form to Stop Loop and stop Mouse Trail"
    21. End Sub

    Anyone know how i can stop the flickering? Or can suggest a better way to do this?

    Thanks!

    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  2. #2
    jim mcnamara
    Guest
    Outside of the IDE it no longer twitters.

    Try compiling your code and running it standalone.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width