Posts: 1,058
Threads: 367
Joined: Oct 2007
Is there any simple way to convert a double variable to its high and low order word. I need it to get the lang id and device handle for the physical layout of the keyboard, using GetKeyboardLayout.
Thank you in advance.
Posts: 12,147
Threads: 143
Joined: Dec 2002
Why double? Values containing hi/lo word usually are stored in int.
Macro
Macro1526
int i=0x00010002
int hi=i>>16
int lo=i&0xffff
out hi
out lo
int hilo=MakeInt(lo hi)
out "0x%08X" hilo
If need signed words:
Macro
Macro1548
int i=0xfffffffe
int hi=i>>16
int lo=i&0xffff
;unsigned word
out hi
out lo
;signed word (C short)
hi=ConvertSignedUnsigned(hi 2)
lo=ConvertSignedUnsigned(lo 2)
out hi
out lo
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
Many thanks, Best personal regards,
Simos