Hi,
Can anyone tell me why you need to shl eax,16 when setting the max range for the progress bar? Does anyone know the max number the progress bar can receive?

mov eax,1000
shl eax,16
invoke SendMessage,hwndProgress,PBM_SETRANGE,0,eax


Thank You
Posted on 2002-12-30 17:17:39 by bgong68
Maybe this can help:

The PBM_SETRANGE message sets the minimum and maximum values for a progress bar and redraws the bar to reflect the new range.

PBM_SETRANGE
wParam = 0;
lParam = MAKELPARAM(nMinRange, nMaxRange);

Parameters
nMinRange
Minimum range value. By default, the minimum value is zero.

nMaxRange
Maximum range value. By default, the maximum value is 100.


Why he does a word sized shift I don't know, maybe he finds it easier to remember the way the lParam is built.

The maximum value, I think that would be 0FFFFh (65535) since the nMaxRAnge is a word.

I should way that the quote is from the win32.hlp, great reference.
Posted on 2002-12-30 17:24:16 by scientica
Because you pass 2 values inside eax:



(LPARAM) lParam // = (LPARAM) MAKELPARAM (nMinRange, nMaxRange)


with shl eax,16 you shift it into the upper word of eax.
So it looks like: 03 E8 00 00 after the shift of 16.

The max range possible is FF FF (65535d)


Posted on 2002-12-30 17:25:17 by JimmyClif
Hi Jimmy,

So when I

invoke SendMessage,hwndProgress,PBM_SETRANGE,0,eax

I am actually setting the min AND max range at the same time?

Is that why you need the shl eax,16 becasue the high word carries the max and the low word carries the min? (So it looks like: 03 E8 00 00 after the shift of 16.)

Thank You
Posted on 2002-12-30 17:46:29 by bgong68

I am actually setting the min AND max range at the same time?

Is that why you need the shl eax,16 becasue the high word carries the max and the low word carries the min? (So it looks like: 03 E8 00 00 after the shift of 16.)
Thats correct! just look at the re-quoted information from above.
(LPARAM) lParam // = (LPARAM) MAKELPARAM (nMinRange, nMaxRange)
Posted on 2002-12-30 18:03:51 by natas
Thanks for all of your help.
Posted on 2002-12-30 21:07:40 by bgong68