A Windows data type, used as a message parameter.
Questions tagged [lparam]
18 questions
8
votes
1 answer
Win32. How to convert POINT to LPARAM
I need to send WM_MOUSEWHEEL message.
How to convert POINT to LPARAM?

Ufx
- 2,595
- 12
- 44
- 83
2
votes
1 answer
Is there something like MAKELPARAM in Java / JNA?
I would like to realize the code taken from this answer and simulate a click without simulating mouse movement inside non-java app window. I know about JNA which, in theory, should have all WinAPI functions. The latest JNA version is 5.6.0 but I…

Gepard
- 67
- 6
2
votes
1 answer
How can lParam be casted into more than one structures?
I saw this piece of code below in here. I tested it and it works all right.
// g_hLink is the handle of the SysLink control.
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) // CAST TO NMHDR*
{
case NM_CLICK: //…

hkBattousai
- 10,583
- 18
- 76
- 124
2
votes
2 answers
How to simulate desktop click at (x,y) position with python?
I'm trying to click somewhere on the desktop, I'm using python with win32 api, I'm using python 32 bit but my computer is a 64 bit computer. I believe the lParam variable isn't holding the value I'm expecting, and I'm still a bit confused about this…

TheCodingGent
- 110
- 2
- 10
2
votes
0 answers
SendMessage to window, lparam changes? (Spy++, C#)
I'm trying to send the Ctrl + C command (Copy text) to a custom handle, so it doesn't get the focus.
I looked the messages in Spy++ up:
<000001> 00540824 S WM_GETDLGCODE wParam:00000011 lParam:0018D218
<000002> 00540824 R WM_GETDLGCODE…

Mariusz B.
- 240
- 4
- 15
2
votes
1 answer
Casting pointers to/from LRESULT
I'm looking for confirmation on this windows programming idiom, am I correct in thinking that many different types of "handles" are passed around as not only LRESULT objects but also lParam and wParam objects?
I'm guessing that as long as we know…

Trae Barlow
- 83
- 5
2
votes
1 answer
SendMessage with an int as a parameter for lParam or wParam?
Say that I want to send a message to my WndProc, but I want to also send an integer.
SendMessage (m_hWnd, WM_DISPLAYCHANGE, NULL, int?);
My WndProc will receive it right? Then I want to send that lParam(integer) to a function.
case…

Mickael Bergeron Néron
- 1,472
- 1
- 18
- 31
2
votes
1 answer
How to convert LParam to Struct in c#
I have the following c++ struct
typedef struct {
char szAccountNo[11];
char szAccountName[40];
char act_pdt_cdz3[3];
char amn_tab_cdz4[4];
char expr_datez8[8];
char …

icewall
- 111
- 6
1
vote
0 answers
SendMessage with Point not working
I feel really stupid because I can't find the problem in my code...
I want to send mouse clicks with SendMessage. So my code is the following
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg,…

syc
- 73
- 1
- 8
0
votes
1 answer
How to read WM_SETTINGCHANGE LParam in C#?
In my WndProc I receive a WM_SETTINGCHANGE message, and I want to see what category the caller sent in the LParam field of the incoming message. Try as I might (and after searching everywhere), I cannot find anything that shows how to get the…

Kevin
- 1,548
- 2
- 19
- 34
0
votes
1 answer
Error trying to pass a LPARAM when going through windows
I'm trying to go through all windows (using Windows API) and get a list of the windows, but when I try to pass through a vector as a LPARAM then I get an error:
non-primitive cast: *mut Vec as LPARAM an as expression can only be used to…

YummyOreo
- 15
- 3
0
votes
1 answer
What is the behaviour of lParam when WM_KEYDOWN message recived?
I started learning winapi using c++ language.
I am trying to understand the lParam on WM_KEYDOWN message.
From the Microsoft documentation:
0-15: The repeat count for the current message. The value is the number
of times the keystroke is…

Don2Quixote
- 228
- 2
- 12
0
votes
1 answer
Changing the value that lParam points at
I'm using Visual C++ /MFC and I'm sending a message as SendMessage(GetParent(hDlg) ,MY_MESSAGE , 0 , LPARAM(x) );
How could I change the value of x inside the hDlg parent callback function ?
For example if I send the message SendMessage(hWnd ,…

Omar Natour
- 101
- 10
0
votes
1 answer
setting/getting lParam value using CTreeCtrl
I'm using CTreeCtrl to display some data. With each entry in the tree, I have some associated data which I keep in a struct. I save this data with the item by putting the pointer to the struct in the lParam value in each entry in the tree.
This is…

l3utterfly
- 2,106
- 4
- 32
- 58
0
votes
1 answer
Something wrong either with lParam or with WCHAR[]
First, this function is called many times. It should be noted that wString[] does contain the character constant '\n'.
void D2DResources::PutToLog(WCHAR wString[])
{
int strLen=wcslen(wString);
int logLen=wcslen(log);
…

Mickael Bergeron Néron
- 1,472
- 1
- 18
- 31