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 


Retrieving the high-order word value from wParam?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Mon Apr 02, 2007 6:02 pm    Post subject: Retrieving the high-order word value from wParam? Reply with quote

wParam
The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.

How do I obtain this value?
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Mon Apr 02, 2007 7:25 pm    Post subject: Reply with quote

Using the macro HIWORD. EG:
Code:
HIWORD(wParam)


What it does basically is to perform the bitwise and operation on wParam to extract the high order word. EG:

Code:
 wParam & 0xFFFF0000

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Mon Apr 02, 2007 7:28 pm    Post subject: Reply with quote

DeltaFlyer wrote:
Using the macro HIWORD. EG:
Code:
HIWORD(wParam)


What it does basically is to perform the bitwise and operation on wParam to extract the high order word. EG:

Code:
 wParam & 0xFFFF0000


Sorry, forgot to mention I"m using vb6. Can you translate that? lol.... something like

wParam & &ffff0000

dunno.....Help would be awesome. Wanna implement scroll wheel in my macro recorder.
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Mon Apr 02, 2007 7:34 pm    Post subject: Reply with quote

Knowing VB, it probably uses the "and" keyword. So replace & with "and". Then use whatever VB uses to signify hex values. I think it was the # last time my friend showed me something in VB, not sure though. Just look it up with google.
Code:
 wParam and #FFFF0000

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Mon Apr 02, 2007 7:36 pm    Post subject: Reply with quote

Testing now.....

not working. I've tried different combinations. Help file shows Hex() statement, that didnt work either.

I get 3 digit numbers for .paramL and .paramH, and trying to add the hex number to it yields a 0

Public Type EVENTMSG
message As Long
paramL As Long
paramH As Long
time As Long
hwnd As Long
End Type


When I get a wm_mousewheel event, I copy the memory to the eventmsg structure. From what I understand I think paramH, should contain this >>>>>>>>>>>

wParam The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.

I just got this code from microsoft forum Rolling Eyes

Code:
Public Shared Function HighWord(ByVal i As Int32) As Int16
       Return CShort((i And &HFFFF0000) \ &H10000)
  End Function


Lets see what it does....Probably give me a blue screen.....LMAO

Yep, didnt work... Not even vb6 code....lol...looks like .net.....figures


Last edited by Traps on Mon Apr 02, 2007 8:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
Madman
I post too much
Reputation: 1

Joined: 04 May 2006
Posts: 3976

PostPosted: Mon Apr 02, 2007 8:05 pm    Post subject: Reply with quote

Traps wrote:
DeltaFlyer wrote:
Using the macro HIWORD. EG:
Code:
HIWORD(wParam)


What it does basically is to perform the bitwise and operation on wParam to extract the high order word. EG:

Code:
 wParam & 0xFFFF0000


Sorry, forgot to mention I"m using vb6. Can you translate that? lol.... something like

wParam & &ffff0000

dunno.....Help would be awesome. Wanna implement scroll wheel in my macro recorder.


well theres your problem!

_________________
Back to top
View user's profile Send private message
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Mon Apr 02, 2007 8:09 pm    Post subject: Reply with quote

Madman340000 wrote:
well theres your problem!


Can you please elaborate.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25295
Location: The netherlands

PostPosted: Mon Apr 02, 2007 8:17 pm    Post subject: Reply with quote

and don't forget to shift 16 bits to the right
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Mon Apr 02, 2007 8:25 pm    Post subject: Reply with quote

I know nothing about manipulating bits/bytes/ whateva's, so i'm at the complete mercy of my lack of knowledge.

I tried this

Private Function HighWord(ByVal i As Long) As Integer
HighWord = ((i And &HFFFF0000) \ &H10000)
End Function

the variable i = 312 and the function returns 0. Something not right ...... I dont see how you can extract what I"m looking for from the number 312
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25295
Location: The netherlands

PostPosted: Mon Apr 02, 2007 8:31 pm    Post subject: Reply with quote

just make it into one 32-bit integer and then divide by 65536, and the whole value is what you need

and yes, i=312 has as result 0

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Mon Apr 02, 2007 8:44 pm    Post subject: Reply with quote

Dark Byte wrote:
just make it into one 32-bit integer and then divide by 65536, and the whole value is what you need

and yes, i=312 has as result 0


number 1, I have no idea how to do that Crying or Very sad

Number 2, this value is supposed to have a negative number as a possability representing mouse wheel scrolling down. I'm really confused, wish I had some source code on using mouse_event to send scroll up or down, from data in the eventmsg structure.

Here is a sample of my source code. If the value of code = WM_MOUSEWHEEL when entering JournalRecordProc, then according to microsoft, the high-order word of wParam should contain the distance the wheel was rotated, postive or negative number(in this case either 120 or -120 because it should only record 1 click of the wheel) !!!!!! wtf!!!!!!! Mad Mad Mad

Code:
Public Type EVENTMSG
    message As Long
    paramL As Long
    paramH As Long
    time As Long
    hwnd As Long
End Type


 

Public Function JournalRecordProc(ByVal Code As Long, ByVal wParam As Long, ByVal lParam As Long) As Long


    If Code < 0 Then
   
        'Pass this message along...
        JournalRecordProc = CallNextHookEx(lHookID, Code, wParam, ByVal lParam)
   
    Else
   
        'Grab the Event Message Structure
        CopyMemory EVENTMSG, ByVal lParam, Len(tEVENTMSG)


    End If

End Function
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Mon Apr 02, 2007 8:51 pm    Post subject: Reply with quote

Didn't I say to use google? ...

Here, search "vb extracting high word from dword"

and get:

http://www.geocities.com/practicalvb/vb/math/words.html

as second link. It explains everything you need.

That took me 30 secs...

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Mon Apr 02, 2007 8:58 pm    Post subject: Reply with quote

DeltaFlyer wrote:
Didn't I say to use google? ...

Here, search "vb extracting high word from dword"

and get:

http://www.geocities.com/practicalvb/vb/math/words.html

as second link. It explains everything you need.

That took me 30 secs...


LOL, come on man, I've been using the googler, but I dont even know what to google..... THank you though, I will check it out!!!

Ok it simply shows what the guy at microsoft showed me except for the dword declaration in the function entry....I'll try it out.......


Code:
' Returns the low-order word of a double word as an integer
' ranging in value from -32768 to 32767.
Public Function LoWord(ByVal DWord As Long) As Integer
    If (DWord And &H8000&) = 0 Then
        LoWord = DWord And &HFFFF&
    Else
        LoWord = DWord Or &HFFFF0000
    End If
End Function

'[color=red] Returns the high-order word of a double word as an integer
' ranging in value from -32768 to 32767.
Public Function HiWord(ByVal DWord As Long) As Integer
    HiWord = (DWord And &HFFFF0000) \ &H10000
End Function[/color]
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Mon Apr 02, 2007 9:06 pm    Post subject: Reply with quote

Code:

Dim HiWord As Integer = (wParam And &HFFFF0000) \ &H10000


Doesn't work?

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Mon Apr 02, 2007 9:11 pm    Post subject: Reply with quote

I see now, that the function requires a double word value for input. However the value I have from the eventmsg structure is a long. Every sample code I've found that uses this structure to capture windows events has the paramL and ParamH values as LONG.... however the structure accurately records all the wm_mouse and keyboard events correctly, except for what it seems the wm_mousewheel
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 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