I'd like to select a date in my calendar with a AHK script. For this, i'm using the function sendMessage because i'd like to select a date from an external app. I'd like to use the SETCURSEL_MCM message from Microsoft documentation. How could i find the corresponding number from this message ? Bc it's not on this page https://learn.microsoft.com/en-us/windows/win32/controls/mcm-setcursel SendMessage, myCorrespondingNumberAsParam???, 0, lparam(which is my date),control, wintitle
By analogy, if i want to send a text to an edit control in notepad, i should send the WM_SETTEXT. The value of this message is clearly referenced by ahk doc as 12 for that control. But it's not the case for MCM_SETCURSEL message.
I tried to put the send message in a loop, an stop the loop when it executed the message, but it's too long, and it send bugs to the program.
If anyone could help me,
Thank you,
Gilles
You see from the documentation that this message is defined in the
Commctrl.h
header.So you want to open that header from your Windows SDK files, the path might be e.g.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um
, but really I recommend just using some proper Windows search engine (such as Everything), and searching that header name to find it quickly.Then you'll see in that header that the message is defined as follows:
And there's your value,
0x1000 + 2
.