Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to change the shape of mouse pointer
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sun Dec 01, 2019 7:46 am    Post subject: Reply with quote

Dark Byte wrote:
Code:

f=createForm()

cursor=executeCodeLocalEx("LoadCursorFromFileA","c:\\pass_over.cur")

f.OnMouseMove=function()
  ExecuteCodeLocalEx("SetCursor", cursor)
end
Cur loaded successfully, but it blinked
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Dec 01, 2019 8:02 am    Post subject: Reply with quote

I think maybe able to change windows registry.

Code:

reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors\Default /d "cursor_name" /f


or by command line, example.

Code:
"copy %SystemRoot%\System32\TEMP\proj\aero_arrow.cur %SystemRoot%\Cursors\ /y"

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Sun Dec 01, 2019 8:19 am    Post subject: Reply with quote

The following code works fine.
The @DB and @ Corroder examples developed this idea.
Here's how it works.

Code:
mypath = TrainerOrigin or getMainForm()

file1 = 'aero_arrow_l.cur'
file2 = 'aero_link_l.cur'
file3 = 'aero_move_l.cur'
file4 = 'lnodrop.cur'

if mypath then
findTableFile(file1).saveToFile(mypath..'\\'..file1)
findTableFile(file2).saveToFile(mypath..'\\'..file2)
findTableFile(file3).saveToFile(mypath..'\\'..file3)
findTableFile(file4).saveToFile(mypath..'\\'..file4)
end

cursor1=executeCodeLocalEx("LoadCursorFromFileA",""..mypath..file1.."") -- print(cursor1)
cursor2=executeCodeLocalEx("LoadCursorFromFileA",""..mypath..file2.."")
cursor3=executeCodeLocalEx("LoadCursorFromFileA",""..mypath..file3.."")
cursor4=executeCodeLocalEx("LoadCursorFromFileA",""..mypath..file4.."")

local f=createForm()
f.Height = 90
f.Width = 230
f.Position = poDesktopCenter

local p1 = createPanel(f)
p1.Height = 50
p1.Left = 20
p1.Top = 20
p1.Width = 50
p1.Color = '0x56ffff'

local p2 = createPanel(f)
p2.Height = 50
p2.Left = 90
p2.Top = 20
p2.Width = 50
p2.Color = '0x56ffff'

local p3 = createPanel(f)
p3.Height = 50
p3.Left = 160
p3.Top = 20
p3.Width = 50
p3.Color = '0x56ffff'

f.OnMouseMove=function()
  ExecuteCodeLocalEx("SetCursor", cursor4)
end

p1.OnMouseMove=function()
  ExecuteCodeLocalEx("SetCursor", cursor1)
end

p2.OnMouseMove=function()
  ExecuteCodeLocalEx("SetCursor", cursor2)
end

p3.OnMouseMove=function()
  ExecuteCodeLocalEx("SetCursor", cursor3)
end


And a .CT file that runs.
https://www.dosyaupload.com/fhR7

Note: CE 7.0 Wink
Enjoy it.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
gibberishh
Cheater
Reputation: 1

Joined: 30 Aug 2021
Posts: 37

PostPosted: Sat Feb 17, 2024 1:37 am    Post subject: Reply with quote

As of CE 7.2, the Cursor property is not inherited by child controls. If I want to set the cursor to crHourGlass while some code is executing, I have to find and set the Cursor property of the form AND every child control.

"Inherit" is also not an option for the Cursor property of controls in Design mode. Neither is there any property named ParentCursor (like ParentShowHint).

Has this been changed in later versions of CE? It is quite unwieldy to have to change the cursor for all controls in multiple nested for loops, and then to run those loops again to set them back to crDefault. It gets even worse if you use panels or any grouping controls because then the nesting has to go keep going deeper and deeper.

frmReadfile > pnlButtons > btnLoadfile

I can access all properties and methods of btnLoadfile via frmReadfile.btnLoadfile, but frmReadfile.Controls[counter] does not expose it. It has to be frmReadfile.Controls[0].Controls[0]. Hence the deep nesting of loops.

Before anyone curses me for requiring the hourglass at all, it is necessary for one of my forms which takes time to parse a large text file. The source and format of the text file are not within my control so I cannot format it or break it up for "quick" reading.

Thanks.

_________________
It's not cheating. It's playing by my rules.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites