[Last Call] Learn how to a build a cloud-first strategyRegister Now


I need to change the mouse trails setting in .net

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

Accepted Solution

Matti earned 1000 total points
ID: 19675214

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month18 days, 1 hour left to enroll

830 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