I need to change the mouse trails setting in .net

Posted on 2007-08-10
Last Modified: 2013-11-07
I need a .net, change mouse trails settings
Question by:Micki-Weaver
    1 Comment
    LVL 14

    Accepted Solution


    I made this quick in VB 6.0 and opened it in the VB 2005, should work in this case.


    Option Strict Off
    Option Explicit On
    Friend Class Form1
          Inherits System.Windows.Forms.Form

          Private Const SPI_GETMOUSETRAILS As Short = 94
          Private Const SPI_SETMOUSETRAILS As Short = 93
          Private Const SPIF_SENDCHANGE As Short = 1
        Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Integer, ByVal uParam As Integer, ByRef lpvParam As Object, ByVal fuWinIni As Integer) As Integer
          Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
                Dim x As Object
            x = SystemParametersInfo(SPI_SETMOUSETRAILS, 8, 0, SPIF_SENDCHANGE)
                'Note number 8 is the lenght of the trail, 0 means no trail.
          End Sub
          Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
                Dim x As Object
            x = SystemParametersInfo(SPI_SETMOUSETRAILS, 0, 0, SPIF_SENDCHANGE)
                'This removes the trail
          End Sub
    End Class

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now