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 


sendMessage()

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Oxijen
Expert Cheater
Reputation: 0

Joined: 07 May 2020
Posts: 163
Location: On The Moon

PostPosted: Fri May 29, 2020 12:23 pm    Post subject: sendMessage() Reply with quote

I know this is the second time, but I have some questions does the SendMessage() work on Unity games??
I have tried using this code
Code:
sleep(2000)


local part_1 = getForegroundWindow() -- get handle
local part_2 = getWindowClassName(part_1) -- get window's class name through handle

local hWndNotepad = findWindow(part_2);
local hWndChild = getWindow(hWndNotepad, 5); -- Get the child edit control..


sendMessage(hWndChild, 0x0100, 0x48, 0); -- Send WM_KEYDOWN
sendMessage(hWndChild, 0x0101, 0x48, 0); -- Send WM_KEYUP
sendMessage(hWndChild, 0x0102, 0x48, 0); -- Send WM_CHAR

and it worked fine on notepad Confused
Unlikely...
I also tried printing part_2 I got UnityWndClass
Do you have any info on what sendMessage() works??
And if you know whats the reason for my error, tell me pls : D

_________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum Wink
Back to top
View user's profile Send private message
exohaxor
Expert Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 101

PostPosted: Sat May 30, 2020 4:25 am    Post subject: Reply with quote

it wont work on 3d games
_________________
hi
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat May 30, 2020 8:25 pm    Post subject: Reply with quote

Not all games make use of window messages to deal with input. Games that make use of things like DirectInput or other custom input handling will not work with basic 'SendMessage' calls. (DirectInput, under the hood, creates an invisible window and processes raw input internally.)
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Oxijen
Expert Cheater
Reputation: 0

Joined: 07 May 2020
Posts: 163
Location: On The Moon

PostPosted: Sun May 31, 2020 4:17 am    Post subject: Reply with quote

Makes sense, Thank you for the help.
But [/quote] will not work with basic 'SendMessage' calls
Quote:

So what would it work with??

_________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum Wink
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
Page 1 of 1

 
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