473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

WM_LBUTTONDOWN and the lParam parameter

Hi there,

I'm trying to emulate mouse clicks using WM_LBUTTONDOWN, and
WM_LBUTTONUP respectively. I can't quite remember how I am to create the
lParam from the x and y coordinates, any imput on this would be greatly
appreciated...

--
Nick Pateman

---------------------------------------------------------------
Please do not reply directly to me, but the entire newsgroup.
Any views expressed above are my own
Without predjudice
Jan 10 '06 #1
3 3964
Dim lParam as Long = MAKELONG(x, y)

Public Shared Function MAKELONG(ByVal low As Integer, ByVal high As Integer)
As Long
Return (low And &HFFFF) Or ((high And &HFFFF) << 16)
End Function
--
Colin Neller
http://www.colinneller.com/blog
"Nick" <no****@nospam.com> wrote in message
news:O6**************@TK2MSFTNGP14.phx.gbl...
Hi there,

I'm trying to emulate mouse clicks using WM_LBUTTONDOWN, and
WM_LBUTTONUP respectively. I can't quite remember how I am to create the
lParam from the x and y coordinates, any imput on this would be greatly
appreciated...

--
Nick Pateman

---------------------------------------------------------------
Please do not reply directly to me, but the entire newsgroup.
Any views expressed above are my own
Without predjudice

Jan 10 '06 #2
Cheers Colin, just what I was after... :-)

Nick.

"Colin Neller" <cn*****@gmail.com> wrote in message
news:ue**************@TK2MSFTNGP09.phx.gbl...
Dim lParam as Long = MAKELONG(x, y)

Public Shared Function MAKELONG(ByVal low As Integer, ByVal high As
Integer) As Long
Return (low And &HFFFF) Or ((high And &HFFFF) << 16)
End Function
--
Colin Neller
http://www.colinneller.com/blog
"Nick" <no****@nospam.com> wrote in message
news:O6**************@TK2MSFTNGP14.phx.gbl...
Hi there,

I'm trying to emulate mouse clicks using WM_LBUTTONDOWN, and
WM_LBUTTONUP respectively. I can't quite remember how I am to create the
lParam from the x and y coordinates, any imput on this would be greatly
appreciated...

--
Nick Pateman

---------------------------------------------------------------
Please do not reply directly to me, but the entire newsgroup.
Any views expressed above are my own
Without predjudice


Jan 10 '06 #3
Hi Nick,

Try this:

~
lParam = CInt(y) << 16 Or x

~

"Nick" <no****@nospam.com> сообщил/сообщила в новостях следующее:
news:O6**************@TK2MSFTNGP14.phx.gbl...
Hi there,

I'm trying to emulate mouse clicks using WM_LBUTTONDOWN, and
WM_LBUTTONUP respectively. I can't quite remember how I am to create the lParam from the x and y coordinates, any imput on this would be greatly appreciated...

--
Nick Pateman

---------------------------------------------------------------
Please do not reply directly to me, but the entire newsgroup.
Any views expressed above are my own
Without predjudice

Jan 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
3
by: BruceR | last post by:
Hello, I am currently trying to respond to custom messages sent via SendMessage/PostMessage from my unmanaged C++ dll in my C# application. I am responding to these types of messages by...
1
by: Dean Redmond | last post by:
How do i send the WM_LBUTTONDOWN message. As you can probably tell, im not that proficiant in c# so the simpler the answer the better. I've been google-ing this for hours any help will be...
2
by: Ryan Ross | last post by:
Hello, I need some help with the SendMessage method. I've imported it into C# with the following statement: public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, long wparam, int...
4
by: crafuse | last post by:
Hello, I've overridden the WndProc function in my form to hand some special behavior. Specifically, I look for the WM_NCMOUSEMOVE event to tell me when the user is trying to move the window by...
5
by: SpotNet | last post by:
Hi Newsgroup, While trying to customise my common dialogs and learn C#, I'm having trouble getting this to work; OFNOTIFY ofny = (OFNOTIFY)Marshal.PtrToStructure(lParam, typeof(OFNOTIFY)); ...
1
by: mtczx232 | last post by:
LParam (intPtr) in WM_MOUSEMOVE contain the x,y of mouse position. how retrieves this value in vb.net code?
0
by: nash | last post by:
Thanks all for reply.. one thing is sure we cant modify by using WH_KEYBOARD/WH_KEYBOARD_LL hook... I am using WH_GETMESAGE hhok to capture and modify the character.By Using wParam definitely we...
7
by: dzar | last post by:
I have an application that sends messages to other applications through PostMessage(HWND_BROADCAST, MY_MESSAGE_ID, wparam_float, lparam_float); in C (and this works... I can typecast and built byte...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.