Click to See Complete Forum and Search --> : Usage of LOWORD windows macro


liordeck
June 8th, 2004, 03:34 AM
Hello colleagues,
I have a fairly simple question. However, I do not know if the is the most correct forum to post this question.
I am trying to implement the usage of the LOWORD macro in a 3rd party software called WinRunner which is used for automatic testing.
My questions are:
1. Since I have to load DLL prior to the usage of their funcitons, which DLL contains this macro?
2. Can someone please provide an explicit example on how to use this function with a decimal and a hex number, when the numbers are sent explicitily or through a prarmeter.

Thank-you.

Marc G
June 8th, 2004, 04:23 AM
LOWORD is a macro not a function, so it is not defined in any DLL.
It is defined as follows:

#define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))

If you give that macro a 32 bit integer, the result will be the 16 low order bits. Your 32 bit integer is ANDed with 0xffff.

liordeck
June 8th, 2004, 07:20 AM
Thanks for the reply Marc.
I have very limited knowledge in programming.
Can you please provide an example where you use this function and retrieve the new value from it?

For example, for the value 04090409 in hex, how would you use it with the function?

Thanks again.

Marc G
June 8th, 2004, 08:34 AM
int result = LOWORD(0x04090409);

result will be 0x0409 (hex)

liordeck
June 8th, 2004, 09:27 AM
Thanks Marc.