• Need to Identify a Windows Process

    Home » Forums » AskWoody support » Windows » Windows 10 » Questions: Win10 » Need to Identify a Windows Process

    Author
    Topic
    #2410600

    I’m hoping some guru can shed light on the following situation.  I want to know the name of a particular software process that is invoked that causes the refresh of a registry entry alteration after clicking Apply/OK and NOT require one to either reboot the computer or have to log out and then back in to effect the registry refresh.
    Case in point:  If one goes into the Control Panel to Ease of Use and selects Make the Mouse easier to use and ticks a box,  an alteration in a registry entry occurs and the system invokes the change immediately when clicking OK.  No reboot is required.  If a user makes the same registry change manually, then a reboot is required.
    Can someone tell exactly what function is occurring and how I could invoke the same one via, say, a Powershell or CMD entry?  I want to make a batch file to reduce 6 steps to one.  Thanks

    Viewing 3 reply threads
    Author
    Replies
    • #2410707

      The change is made to the registry and then Windows is told to re-read the registry values.

      I can’t find a guaranteed method to cause a re-read apart from ending the program you want, possible via Task Manager.

      cheers, Paul

    • #2410772

      You can use SystemParametersInfo to do that but only if the particular parameter you want to change actually takes effect when invoked via it’s normal mode (i.e. thru settings/control panel) without requiring a reboot.

      For example, the following powershell script enables mouse trails by setting the value in the registry to 7 and takes effect “immediately” just as if you set it using the mouse control panel:

      Set-ItemProperty -Path ‘HKCU:\Control Panel\Mouse’ -Name MouseTrails -Value ‘7’ -Force

      Add-Type @”
      using System.Runtime.InteropServices;
      public class PInvoke {
      [DllImport(“user32.dll”)] public static extern int SystemParametersInfo(int uiAction, int uiParam, int[] pvParam, int fWinIni);
      [DllImport(“user32.dll”)] public static extern int SystemParametersInfo(int uiAction, int uiParam, System.IntPtr pvParam, int fWinIni);
      }
      “@

      $mouse = Get-ItemProperty ‘HKCU:\Control Panel\Mouse’

      # MouseTrails -> SPI_SETMOUSETRAILS
      [PInvoke]::SystemParametersInfo(0x005D, $mouse.MouseTrails, $null, 0)

      1 user thanked author for this post.
      • #2418988

        alejr,

        I greatly appreciate your post on the use of system parameters info.  I know very little about programming so had to research on how to use Powershell and attempt to understand the statements in the example you provided on mouse trails.  But I still need some help.

        What I am attempting to do is simplify 6 mouse clicks down to one or two in turning on/off mouse hover to activate a window.  To turn it on the UI is: Control Panel\Ease of Access Center\Make the mouse easier to use\Make it easier to manage windows\Activate a window by hovering over it with the mouse,  Check the box, then OK.  Uncheck box to turn off.  No  reboot or log out/in is required.

        When the box is checked, a change occurs in the registry:

        HKEY_CURRENT_USER\Control Panel\Desktop

        Checked:     “UserPreferencesMask”=hex:df,7e,07,80,12,00,00,00

        Unchecked: “UserPreferencesMask”=hex:9e,7e,07,80,12,00,00,00

        The first hex pair gets changed from 9e to df for hover activation

        When a manual change is done in the registry, a reboot or log out/in is required.

        You suggested system parameter info to do this task–something I am just learning about.  I notice that a hex code for the mouse trails example is 0x005D.  I don’t know how to find a hex value for the mouse hover activate window instance.

        Your guidance would be very appreciated.  Thanks

    • #2419094

      The 0x005D value I used for SPI_SETMOUSETRAILS came from Microsoft’s System Parameters Info list.

      Looking at that list it appears you need to use SPI_SETACTIVEWINDOWTRACKING (0x1001) to turn that feature on/off.

        • Sets active window tracking (activating the window the mouse is on) either on or off. Set pvParam to TRUE for on or FALSE for off.

      Since it doesn’t use a “variable” value like the 0-7 mousetrails uses to set how long the trail is, you shouldn’t need to change the UserPreferencesMask value in the registry before invoking it.

      FYI, you can use SPI_GETACTIVEWINDOWTRACKING (0x1000) to read the current setting.

    • #2419395

      Again, alejr, thanks for your help and insight.  I’ll work with information you provided.

    Viewing 3 reply threads
    Reply To: Need to Identify a Windows Process

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: