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
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
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.
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.
Because you pass 2 values inside eax:
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)
(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)
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
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
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.)
(LPARAM) lParam // = (LPARAM) MAKELPARAM (nMinRange, nMaxRange)
Thanks for all of your help.