Sign in to follow this  
Followers 0
wnight77

LParam Array?

18 posts in this topic

#1 ·  Posted (edited)

Hmmmm ok i think i might of found one of the problems with this.... i was sitting in my MS Visual studio using the "window spy" tool to check windows Messaging to see why this was not working and i think ive located the one Difference between the 2 msg's.... ive recorded one ones i send when i actually do the action and then recorded the ones ive sent and the only Difference i see is one is "Sent" and one is "Posted" i wonder if that makes a difference?

$iWord = MakeDWord(0x1B8, 0x1B8);This is X440=1B8-Y440=1B8

Func MakeDWord($iLoWord, $iHiWord)

Return BitOR($iHiWord*0x10000,BitAND($iLoWord,0xFFFF))

EndFunc

_SendMessage(0x00EC0438, $WM_LBUTTONDOWN, $MK_LBUTTON, $iWord, 0, "int", "int")

sleep(100)

_SendMessage(0x00EC0438, $WM_LBUTTONUP, $MK_LBUTTON, $iWord, 0, "int", "int")

_SendMessage(0x00EC0438, $WM_LBUTTONDOWN, $MK_LBUTTON, $iWord, 0, "int", "int")

sleep(100)

_SendMessage(0x00EC0438, $WM_LBUTTONUP, $MK_LBUTTON, $iWord, 0, "int", "int")

Status Update.

Edited by wnight77

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

LOL ok ill try posting it again with ALL of the details to try and make more since...

_SendMessage ( hWnd, msg [, wParam = 0 [, lParam = 0 [, return = 0 [, wParam Type = "int" [, lParam Type = "int" ]]]]] )

_SendMessage ( 0x007409E2, 0x201,0, 500, 0, "int" , "int" ) - this is my Test case "sends a msg to hWnd 0x007409E2 sends a left mouse clock at location it appears to be Y location 500 X location 0

Windows API

WM_LBUTTONDOWN

WPARAM wParam

LPARAM lParam;

wParam

Indicates whether various virtual keys are down. This parameter can be one or more of the following values.

lParam

The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.

The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.

Edited by wnight77

Share this post


Link to post
Share on other sites

Hmmmm i was looking at the DLL call in Misc.a3u it looks like if i just Create my own _send Fucntion i should be able to get this to work but im not positive

Share this post


Link to post
Share on other sites

no one has any ideas? bump

Share this post


Link to post
Share on other sites

Here is an example of what you need to pass (I think)

$iWord = MakeWord(0x34,0x12)
ConsoleWrite("0x" & Hex($iWord) & @CRLF)
ConsoleWrite("0x" & Hex(LoByte($iWord)) & @CRLF);These output original values passed to MakeWord()
ConsoleWrite("0x" & Hex(HiByte($iWord)) & @CRLF)

Func LoByte($iWord)
    Return BitAND($iWord, 0xFF)
EndFunc   ;==>LoByte

Func HiByte($iWord)
    Return BitAND($iWord, 0xFF00) / 0x100
EndFunc   ;==>HiByte

Func MakeWord($iLoByte, $iHiByte)
    If $iHiByte < 0x80 Then
        Return BitOR($iHiByte * 0x100, $iLoByte)
    Else
        Return BitOR($iHiByte, 0xFF00) * BitOR(0x100, $iLoByte)
    EndIf
EndFunc   ;==>MakeWord

Using $lParam = MakeWord(x value, y value)

All information is from http://www.geocities.com/practicalvb/vb/math/words.html


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

So i was alittle confused at first but... its not an "array" like i thought but 1 16 bit number that contains 2 seperate 8bit number? and this function is a Methode to take the 2 8bit numbers and combine them into 1 16bit Word that the windows API can then interpitate? so if i wanted to send coords of X = 500 and Y= 500 X= 0x1F4 and Y= 0x1F4 i would use 2 hex values passed into MakeWord that would then combine it into 1 16bit Int/Word that i could then send as my Lparam and windows API will Translate that 16Bit word into the 2 X/Y coordinates ?

well im still not getting the desired results imma keep playing with it and see if i can figure it out basically ive got...

$iWord = MakeWord(0x276,0x163);This is X coord 630 Y coord 355

;=====Code Snippet====

Func LoByte($iWord)

Return BitAND($iWord, 0xFF)

EndFunc ;==>LoByte

Func HiByte($iWord)

Return BitAND($iWord, 0xFF00) / 0x100

EndFunc ;==>HiByte

Func MakeWord($iLoByte, $iHiByte)

If $iHiByte < 0x80 Then

Return BitOR($iHiByte * 0x100, $iLoByte)

Else

Return BitOR($iHiByte, 0xFF00) * BitOR(0x100, $iLoByte)

EndIf

EndFunc ;==>MakeWord

======And then the Send=====

_SendMessage ( 0x007409E2, 204,0, $iWord, 0, "int" , "int" )(Real Code)

_SendMessage ( Some hWND, 204, 0, $iWord, 0, "int" , "int" )(not Real Code)

This in Theory should send a WM_RBUTTTON to "some" window with Lparam $iWord

I must be doing something wrong here because im not getting the desired results.

that being a Rightmouse click Registered in the Window with ID "some" window in this "case"

Edited by wnight77

Share this post


Link to post
Share on other sites

Edited last Reply/Bump

Share this post


Link to post
Share on other sites

Ok after reading even more on the subject i think that i would be using a D word and not a Word that way i can use 2 16Bit ints to combine into 1 single 32Bit Dword and visa versa what do u think?

Share this post


Link to post
Share on other sites

...the Lparam is an array of 2 ints 1being the X coord and 1 being the y coord of the mouse when this click takes place.

i think you mean that lParam is a pointer to an struct of 2 int's right?

My question is how do i alter this code to make that work? OR is this function not able to overload in that matter and i will need to go into Misc.a3u and edit the function to allow for this?

Use DllStructCreate("int;int") to create the struct(or call it array...),

DllStructSetData() to set the two values and pass the pointer returned by

DllStructGetPtr() to _SendMessage().

Set the lParam type to "ptr".


CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

ok i was completely wrong...

your on the right track :whistle:

but you could compare the results of your MAKEWORD implementation to this.

Edited by piccaso

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

maybe...

#include <misc.au3>
Const $WM_LBUTTONDOWN = 0x201
Const $MK_LBUTTON = 1

$iWord = MakeWord(0x276, 0x163);This is X coord 630 Y coord 355
Func MakeWord($LoByte,$HiByte)
  Return BitOR($LoByte,0x100 * $HiByte)
EndFunc
_SendMessage(0x007409E2, $WM_LBUTTONDOWN, $MK_LBUTTON, $iWord, 0, "int", "int")
Edited by piccaso

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map

Share this post


Link to post
Share on other sites

ill give it a try

Share this post


Link to post
Share on other sites

well im still not getting the desired results ive narrowed it down to 2 things tho i "think" 1 it might be a "child window issue" because i have the "Main" window but that menus has other childwindows and such drawn on it and that might mean they do not see the _send that i send to the Main window. OR (what i think the main problem is) becasue i have tried to confirm the first problem by sending a msg that would effect something on the main screen with no results Is that the Lparam is still not being Built/Sent correctly so the Params arnt being interpeted correctly

Share this post


Link to post
Share on other sites

Func MakeDWord($iLoWord, $iHiWord)
    Return BitOR($iHiWord*0x10000,BitAND($iLoWord,0xFFFF))
EndFunc

Just looked on msdn and it uses The hi and loword values, try that function.


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

ok i thought i got it working but it wasnt hehe i AM sending a double L click with this so i know that part is working but the Lparam still isnt sending the X/Y coords i think... ill keep checking with it..

$iWord = MakeDWord(0x1B8, 0x1B8);This is X440=1B8-Y440=1B8

Func MakeDWord($iLoWord, $iHiWord)

Return BitOR($iHiWord*0x10000,BitAND($iLoWord,0xFFFF))

EndFunc

_SendMessage(0x00EC0438, $WM_LBUTTONDOWN, $MK_LBUTTON, $iWord, 0, "int", "int")

sleep(100)

_SendMessage(0x00EC0438, $WM_LBUTTONUP, $MK_LBUTTON, $iWord, 0, "int", "int")

_SendMessage(0x00EC0438, $WM_LBUTTONDOWN, $MK_LBUTTON, $iWord, 0, "int", "int")

sleep(100)

_SendMessage(0x00EC0438, $WM_LBUTTONUP, $MK_LBUTTON, $iWord, 0, "int", "int")

Edited by wnight77

Share this post


Link to post
Share on other sites

Hmmmm ok i think i might of found one of the problems with this.... i was sitting in my MS Visual studio using the "window spy" tool to check windows Messaging to see why this was not working and i think ive located the one Difference between the 2 msg's.... ive recorded one ones i send when i actually do the action and then recorded the ones ive sent and the only Difference i see is one is "Sent" and one is "Posted" i wonder if that makes a difference?

Share this post


Link to post
Share on other sites

It means PostMessage was used rather than SendMessage... the difference? SendMessage waits for the app to process the message before returning, PostMessage returns immediately.


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0