Thursday, January 21, 2016

The primary problem! About scrollbar problem




            


Brother, I wrote a program in multispectral up on the use needs in a dialog with slider lets the user select a number in a range, I did not use CreateWindow to create a slider, but joined in the resource, and then ID with the slider and SetScrollRange () and SetScrollPos () to set the scope and initial position, but these two functions do not work properly, the first function returns false, the second returns 0 (0 not my set The initial value), with that of the first function GetLastError error code is 87, the second error function it is 1447 (the window does not scroll bar? I do not know what does it mean this wrong), I do not know which people will give up brother an answer, be grateful.
Reply:
HWND hwndSlider = GetDlgItem (hDlg, IDC_SLIDER1);
SendMessage (hwndSlider, TBM_SETRANGEMAX, TRUE, 100);
SendMessage (hwndSlider, TBM_SETRANGEMIN, FALSE, -100);
SendMessage (hwndSlider, TBM_SETPOS, FALSE, 50);


No comments:

Post a Comment