Jump to content











Photo
- - - - -

Change default mouse cursor


  • Please log in to reply
24 replies to this topic

#1 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 24 November 2011 - 02:33 AM

Is there a way to change the default mouse cursor that is used by Win7PE?

#2 enciktangankidal

enciktangankidal

    Member

  • Members
  • 43 posts
  • Interests:Love to learn about developing software. Hope someday can be developer. ^^,
  •  
    Malaysia

Posted 24 November 2011 - 05:30 PM

Is there a way to change the default mouse cursor that is used by Win7PE?


do you want to change it into alienware cursor? :dubbio:

#3 sbaeder

sbaeder

    Gold Member

  • .script developer
  • 1334 posts
  • Location:usa - massachusettes
  •  
    United States

Posted 24 November 2011 - 05:51 PM

Is there a way to change the default mouse cursor that is used by Win7PE?

there isn;t a built in way (yest) to do this, but it is probably just a matter of writing some script to write the correct registry entries into the PE...

#4 RoyM

RoyM

    Frequent Member

  • .script developer
  • 415 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 24 November 2011 - 07:55 PM

Win7RecuePE/Joshua's project used to use an animated little devil cursor for his peloader.exe
so there was a lot of interest in changing it.

google this:
joshuas project mouse cursor site:reboot.pro

Here is some hits from that search that might help.
http://reboot.pro/87...dpost__p__93969

#5 enciktangankidal

enciktangankidal

    Member

  • Members
  • 43 posts
  • Interests:Love to learn about developing software. Hope someday can be developer. ^^,
  •  
    Malaysia

Posted 25 November 2011 - 12:18 AM

TQ RoyM

#6 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 26 November 2011 - 03:19 AM

Thanks for the link, Roy. I did exactly what the post said and it doesn't work.

I verified that my custom cursors are being copied into the WindowsCursors folder correctly and that the registry keys exist. In fact, if I go into the Control Panel > Mouse I see the custom pointers!!! If I click OK, without changing anything, THEN the pointer changes to the custom pointer.

I think I am missing something but I don't know what. Any suggestions???

#7 RoyM

RoyM

    Frequent Member

  • .script developer
  • 415 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 26 November 2011 - 04:39 PM

.
Go through the same procedure that you did above but don't click OK yet.
Take a snapshot with regshot
Now click the OK
Take second snapshot and compare.

See if you can identify a registry value that was missed.

#8 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 26 November 2011 - 07:07 PM

@RoyM: Thanks for the awesome utility, however I don't see any of the changes from regshot that indicate the change to the mouse cursors. I have uploaded the results after doing the steps above: http://www.mediafire...39zi1936410g4jj

Maybe you can see something that I don't.

#9 RoyM

RoyM

    Frequent Member

  • .script developer
  • 415 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 27 November 2011 - 12:57 AM

Hi vbguyny good thinkin' with the regshot post.

The 3 entries with stars below will be the important ones to add to a script.

What I would suggest:
Use RegShot2 Unicode, It will give you a cleaner output in the ~RedoReg0000.txt file which is formatted more like a .reg file.
http://www.mediafire...gzqradpeq1qkl11

rename ~RedoReg0000.txt to ~RedoReg0000.reg then run RegCpe on it.
http://galapo.net/ge...s/RegCPE.script
RegCpe will give you an output that you can directly add to your .script file

Or you can experiment first in your running PE with ~RedoReg0000.reg
This is faster and provides more control.

#1 start your PE, then import ~RedoReg0000.reg (import the registry entries)
and see if that works to change your mouse cursor.

If it does work just like it is, then it's time to remove the unnecessary entries.
You should be able to safely remove all registry entries that start with:
HKUS-1-5-18
HKLMSOFTWAREMicrosoftWindows NTCurrentVersionPerflibCurrentLanguageCounter

#2 restart your VM then import the edited ~RedoReg0000.reg.
If mouse cursor fails, then you have deleted a necessary entry

There are many other methods like this to narrow down the necessary registry entries.
But since you have only a few registry entries, it should be doable for you.

P.S. After you have it refined and working, please post results for the
benefit of others who want to change their cursor. Thanks in advance.
RoyM
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Regshot 1.8.2
Comments:
Datetime:2011/11/26 21:48:47 , 2011/11/26 21:48:59
Computer:COSMOS-PC , COSMOS-PC
Username:SYSTEM , SYSTEM
----------------------------------
Keys added:2
----------------------------------
*** See if there is more info here that you need to add to your script ***
*** Or just export this whole path and add to your script, AFTER you have mouse cursor working ***
* HKU.DEFAULTSoftwareMicrosoftWindowsCurrentVersionThemes
HKUS-1-5-18SoftwareMicrosoftWindowsCurrentVersionThemes
----------------------------------
Values deleted:2
----------------------------------
HKU.DEFAULTControl PanelCursors: "DMZ White"
HKUS-1-5-18Control PanelCursors: "DMZ White"
----------------------------------
Values added:4
----------------------------------
* HKU.DEFAULTControl PanelCursors: "DMZ White"
* HKU.DEFAULTSoftwareMicrosoftWindowsCurrentVersionThemesThemeChangesMousePointers: 0x00000001
HKUS-1-5-18Control PanelCursors: "DMZ White"
HKUS-1-5-18SoftwareMicrosoftWindowsCurrentVersionThemesThemeChangesMousePointers: 0x00000001

#10 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 27 November 2011 - 03:32 AM

I am adding the reg keys/values as your have indicated with the asterick. I have discovered that some of the cursors are taking affect (IBeam and resize arrows) but some aren't (normal pointer, busy, etc). I tried what you indicated using the regshot trying to first import the .reg file from the regshot unicode version (thanks again for the links). However it seems like there is something that needs to be invoked to refresh the pointer.

Again, the mouse properties show the custom pointer is currently in use but I still need to go into the properties and click OK for it to take affect. ARRGH!

#11 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 27 November 2011 - 05:23 AM

BTW, I used RegCPE and added the keys/values script to my custom script. I got the same result where some were custom and some were the Windows default.

#12 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 27 November 2011 - 06:24 AM

Ok, I got it!

First of all I would like to say that there wasn't anything wrong with the method of adding the cursor as indicated from the initial link that RoyM posted. I think the difference is that in Win7PE, the program windowssystem32winpeshl.exe starts first and sets the default mouse pointer for the arrow, busy, and app starting cursors.

What I did to override this was to open winpeshl.exe in Resource Hacker and replaced the following resources:

CURSOR > 1 > 1033 (This is were the arrow cursor is)
ANICURSORS > 100 > 1033 (This is the busy animated cursor)
ANICURSORS > 101 > 1033 (This is the app starting animater cursor)

I know that it isn't the best solution but it works.

#13 sbaeder

sbaeder

    Gold Member

  • .script developer
  • 1334 posts
  • Location:usa - massachusettes
  •  
    United States

Posted 27 November 2011 - 07:38 PM

So, just so I understand, the registry settings DID get into the registry, and if you went into the control panel, they showed up as the ones that should be used, and if you clicked on the OK, then they took effect? (post#6 above)...

BUT, the winpeshl.exe was somehow over-riding the ones displayed, and NOT picking up the ones that the registry specified...

Sounds like we might need some sort of exe that could be run after the shell is started (you were using "explorer" as the shell - right?) that does the equiv of the "OK" (i.e. force the refresh from the registry...)

Scott

#14 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 27 November 2011 - 11:25 PM

@sbaeder: That is correct! However continued playing with the resources in winpeshl.exe and I ended up deleting all of the cursor resources and discovered that the program still works and the custom mouse works with the custom script. I will post my version of winpeshl.exe which is based from Win7 SP0.

#15 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 27 November 2011 - 11:46 PM

winpeshl.exe that does not have resources: http://www.mediafire...it3qqbnstskq7nr
This file needs to be in copied to the target windowssystem32 folder. You could either have a script do this. For example, embed the exe in a script that copies it to the target folder.

Or, you could mount the boot.wim file using imagex in rw mode and overwrite the existing winpeshl.exe (this is what I did because my source windows 7 source is on my hard drive - and I am lazy).

I will post the script that I used to change the cursor following this post.

#16 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 28 November 2011 - 12:18 AM

Below is my script. Note that I included the cursors as attachments to my script, but you can obiviously copy the cursors another way. Also the reg commands I use below aren't from RegCPE but they will wrote either way.


DirMake,"%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Normal Select.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Working In Background.ani","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Busy.ani","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Alternate Select.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Diagonal Resize 1.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Diagonal Resize 2.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Handwriting.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Help Select.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Horizontal Resize.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Link Select.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Move.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Precision Select.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Text Select.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Unavailable.cur","%target_win%\Cursors"

ExtractFile,%ScriptFile%,"Cursor","Vertical Resize.cur","%target_win%\Cursors"



hive_load,HKCU

reg_add,0x4,"%reg%\Control Panel\Cursors","Scheme Source","1"

reg_add,0x2,"%reg%\Control Panel\Cursors","","DMZ White"

reg_add,0x2,"%reg%\Control Panel\Cursors","Arrow","#$pSystemRoot#$p\Cursors\Normal Select.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","AppStarting","#$pSystemRoot#$p\Cursors\Working In Background.ani"

reg_add,0x2,"%reg%\Control Panel\Cursors","Wait","#$pSystemRoot#$p\Cursors\Busy.ani"

reg_add,0x2,"%reg%\Control Panel\Cursors","Crosshair","#$pSystemRoot#$p\Cursors\Precision Select.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","Hand","#$pSystemRoot#$p\Cursors\Link Select.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","Help","#$pSystemRoot#$p\Cursors\Help Select.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","IBeam","#$pSystemRoot#$p\Cursors\Text Select.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","No","#$pSystemRoot#$p\Cursors\Unavailable.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","NWPen","#$pSystemRoot#$p\Cursors\Handwriting.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","SizeAll","#$pSystemRoot#$p\Cursors\Move.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","SizeNESW","#$pSystemRoot#$p\Cursors\Diagonal Resize 2.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","SizeNS","#$pSystemRoot#$p\Cursors\Vertical Resize.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","SizeNWSE","#$pSystemRoot#$p\Cursors\Diagonal Resize 1.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","SizeWE","#$pSystemRoot#$p\Cursors\Horizontal Resize.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors","UpArrow","#$pSystemRoot#$p\Cursors\Alternate Select.cur"

reg_add,0x2,"%reg%\Control Panel\Cursors\Schemes","",""

reg_add,0x2,"%reg%\Control Panel\Cursors\Schemes","DMZ White","#$pSystemRoot#$p\Cursors\Normal Select.cur,#$pSystemRoot#$p\Cursors\Help Select.cur,#$pSystemRoot#$p\Cursors\Working In Background.ani,#$pSystemRoot#$p\Cursors\Busy.ani,#$pSystemRoot#$p\Cursors\Precision Select.cur,#$pSystemRoot#$p\Cursors\Text Select.cur,#$pSystemRoot#$p\Cursors\Handwriting.cur,#$pSystemRoot#$p\Cursors\Unavailable.cur,#$pSystemRoot#$p\Cursors\Vertical Resize.cur,#$pSystemRoot#$p\Cursors\Horizontal Resize.cur,#$pSystemRoot#$p\Cursors\Diagonal Resize 1.cur,#$pSystemRoot#$p\Cursors\Diagonal Resize 2.cur,#$pSystemRoot#$p\Cursors\Move.cur,#$pSystemRoot#$p\Cursors\Alternate Select.cur,#$pSystemRoot#$p\Cursors\Link Select.cur"

hive_unload



#17 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 28 November 2011 - 12:31 AM

Instead of adding a pre-fixed winpeshl.exe, it would be better (more legal) to have a script remove the cursors from the winpeshl in %target%.
Maybe in optiizations.script?

:cheers:

#18 RoyM

RoyM

    Frequent Member

  • .script developer
  • 415 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 28 November 2011 - 12:39 AM

Very cool vbguyny

I'm glad you got it all working and thanks for sharing your findings

I could easily see this evolving into a new script included in the projects for all to use.

The trick will be automating the hack of winpeshl.exe as
redistrubiting yours may not be allowed.

Like MedEvil suggested above.

What tipped you off about winpeshl and editing it,
That's not something that comes to my mind first off.

Anyhow, Keep up the good work.
RoyM

#19 sbaeder

sbaeder

    Gold Member

  • .script developer
  • 1334 posts
  • Location:usa - massachusettes
  •  
    United States

Posted 28 November 2011 - 03:26 AM

short google session found this "free" utility... http://www.angusj.com/resourcehacker/ I bet we could use a tool like this to remove the resources...I may play with this tomorrow...

#20 vbguyny

vbguyny

    Member

  • Members
  • 41 posts
  •  
    United States

Posted 28 November 2011 - 08:22 PM

@sbaeder: That is the same utility that I used to remove the cursor resources from the file.

@RoyM: What tiped me off was that the cursors were all working acccept for the arrow and busy icons. I assumed that maybe some program was getting to load the cursors before the usual windows processes start. I then found this site: http://technet.micro...977(WS.10).aspx which indicated that winpeshl.exe was the first program to load. So I decided to look at it with Resource Hacker and hit gold!

@MedEvil: I don't understand what the difference would be, but I wish there was a way to remove the cursors without having to res hack the file.

#21 RoyM

RoyM

    Frequent Member

  • .script developer
  • 415 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 28 November 2011 - 09:22 PM

Hi vbguyny
Yes, you did hit gold, I didn't much use Resource Hacker before,
but I will certainly put it my toolbox now and make use of it.

I assumed like sbaeder that it was all defined in the registry,
However we are dealing with a PE environment here, so I learned
something new, "Thanks",

Steve must not have seen your prior post #12,
sometimes he sleep types like some of us here.

And yes Microsoft Technet is already in my browser favorites, I use it quite often.

The reason winpeshl.exe can't be resdistributed is, it is a
MS Windows file which is covered by the EULA - "End User License Agreement",
which clearly states that you cannot redistribute MS files.

Good news is, Resource Hacker does have command line support:
So the possibility to automate the hack may be possible.

From Resouce Hacker Website (Tutorial)
Using Scripts in Resource Hacker
We can also run Resource Hacker using Command Prompt and can use scripts
to automate lots of repeatative tasks to save our time.
You can use scripts in 2 ways:
Single Command
Multiple Commands

[Single Command]
You can use following commands in Command Prompt to perform actions using Resource Hacker:
-add ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-addskip ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-addoverwrite ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-modify ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-extract ExeFileName, ResourceAddress, ResourceType, ResourceName,
-delete ExeFileName, ResultingFileName, ResourceType, ResourceName,

Where:
ExeFileName - Source file name
ResultingFileName - Output file name
ResourceAddress - Resource location (e.g. Bitmap path stored in your hard disk)
ResourceType - Resource type (e.g. Bitmap, AVI, etc.)
ResourceName - Resource name (e.g. 131, 1020, etc.)

Example:
ResHacker.exe -addoverwrite explorer.exe, explorer1.exe, MyImage.bmp , bitmap, 143,

[Multiple Commands]
You can also run a series of commands using script. First you'll need to
create the script file using Notepad and then you can run it using following command:
ResHacker.exe -script ScriptFileName

Where, ScriptFileName is the name of the script file which you created in Notepad.
Following is the required format of the script file:
[FILENAMES]
Exe=
SaveAs=
Log=
[COMMANDS]
-addoverwrite ResourceAddress, ResourceType, ResourceName
Where:
EXE= contains source file name
SaveAs= contains output file name
Log= contains LOG file name which will store a detailed log of the operation
[COMMANDS] section contains the command-set which we want to perform on the source file.

PS: You can omit the LOG= entry in script file. In this case, Resource Hacker will
automatically create a LOG file with the name "ResHacker.log".
NOTE: If you are facing problems while saving a file after editing in resource hacker,
then make sure you have disabled WFP (Windows File Protection) service using
"WFP Patcher" or use "Replacer" to replace the file. Both utilities can be found in our "Download" section.
Also if you are getting error "Can't create file...", that means you have edited and saved
the same file in past and there is a backup file which needs to be deleted before saving
this file again. Go to the folder containing this file and you'll see a similar file having
"_original" in its name. Delete it and try to save the file in resource hacker.

#22 DarkPhoeniX

DarkPhoeniX

    Frequent Member

  • Team Reboot
  • 452 posts
  • Location:In the middle of nowhere
  • Interests:Interesting Things
  •  
    South Africa

Posted 16 February 2013 - 10:54 PM

I just made a script based on this tread but it seems that the conclusions found here is invaled

well at least for Win7PE_SE

I will make a new script that may work tomorrow

but if you want to test it for yourself here it is :

http://www.mediafire...3wz50ncas2cma77



#23 DarkPhoeniX

DarkPhoeniX

    Frequent Member

  • Team Reboot
  • 452 posts
  • Location:In the middle of nowhere
  • Interests:Interesting Things
  •  
    South Africa

Posted 17 February 2013 - 12:32 PM

The Cursors seems to be in a file called user32.dll

These are non animated .....



#24 DarkPhoeniX

DarkPhoeniX

    Frequent Member

  • Team Reboot
  • 452 posts
  • Location:In the middle of nowhere
  • Interests:Interesting Things
  •  
    South Africa

Posted 17 February 2013 - 07:57 PM

I got the script working

Needs Some polish before i upload it



#25 NexusFred

NexusFred
  • Members
  • 4 posts
  •  
    France

Posted 28 September 2015 - 08:21 PM

Hello,

 

I try to use the DarkPhoenix's cursor script available in the download section and I have a small problem.

 

The script work but only few seconds :dubbio:

 

When I boot i can see the custom cursors are installed but 2 secs later the standard cursor, the wait and busy version are replaced by the default version ?

 

Best Regard

 

Nexus


Edited by NexusFred, 28 September 2015 - 08:22 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users