Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 21, 2020 How to use GET_X_LPARAM in D ? | ||||
---|---|---|---|---|
| ||||
Hi all, I need to use the macro GET_X_LPARAM. But compiler says that "undefined identifier GET_X_LPARAM". I cant find any modules with GET_X_LPARAM defined. Do i miss something ? |
May 21, 2020 Re: How to use GET_X_LPARAM in D ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vinod K Chandran | On Thursday, 21 May 2020 at 18:42:47 UTC, Vinod K Chandran wrote: > Hi all, > I need to use the macro GET_X_LPARAM. But compiler says that "undefined identifier GET_X_LPARAM". I cant find any modules with GET_X_LPARAM defined. Do i miss something ? I search all modules in " C:\D\dmd2\src\druntime\src\core\sys\windows ". But no luck. |
May 21, 2020 Re: How to use GET_X_LPARAM in D ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vinod K Chandran | On Thursday, 21 May 2020 at 18:42:47 UTC, Vinod K Chandran wrote:
> Hi all,
> I need to use the macro GET_X_LPARAM. But compiler says that "undefined identifier GET_X_LPARAM". I cant find any modules with GET_X_LPARAM defined. Do i miss something ?
GET_X_LPARAM isn't defined in Phobos's Windows bindings, so you'll need to
provide the definition yourself.
GET_X_LPARAM is defined as a macro in the windowsx.h header of the Windows SDK, as:
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
Which can trivially be translated to D as a function, like so:
int GET_X_LPARAM (T) (T lp)
{
import core.sys.windows.windef : LOWORD;
return cast(int) cast(short) LOWORD(lp);
}
Hope this helps :)
|
May 21, 2020 Re: How to use GET_X_LPARAM in D ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Harry Gillanders | On Thursday, 21 May 2020 at 20:12:13 UTC, Harry Gillanders wrote:
> On Thursday, 21 May 2020 at 18:42:47 UTC, Vinod K Chandran wrote:
>> Hi all,
>> I need to use the macro GET_X_LPARAM. But compiler says that "undefined identifier GET_X_LPARAM". I cant find any modules with GET_X_LPARAM defined. Do i miss something ?
>
> GET_X_LPARAM isn't defined in Phobos's Windows bindings, so you'll need to
> provide the definition yourself.
>
> GET_X_LPARAM is defined as a macro in the windowsx.h header of the Windows SDK, as:
> #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
>
> Which can trivially be translated to D as a function, like so:
>
> int GET_X_LPARAM (T) (T lp)
> {
> import core.sys.windows.windef : LOWORD;
>
> return cast(int) cast(short) LOWORD(lp);
> }
>
> Hope this helps :)
Thank you for the code and guidance. Let me check it. :)
|
Copyright © 1999-2021 by the D Language Foundation