New pandora on its way to check it when the TBS_TOOLTIPS style is being used.
Added:
Ok check with this, and tell me if this is what you want.
void SetThumbLocation(IN HWND hWnd, IN long x, IN long y) {
RECT rc = {0}; float sIncrement = 0.0f;
long tx = 0, ty = 0, tMin = 0, tMax = 0, tVal = 0, nRange = 0, nWidth = 0, nHeight = 0, imgW = 0, imgH = 0;
UINT uMsg = 0;
skGetBitmapSize(g_BtnTrack, imgW, imgH);
imgW = imgW / 2;
tMin = (long) SendMessage(hWnd, TBM_GETRANGEMIN, 0, 0);
tMax = (long) SendMessage(hWnd, TBM_GETRANGEMAX, 0, 0);
GetClientRect(hWnd, &rc);
nWidth = rc.right; nHeight = rc.bottom;
if (TrackOrientation(hWnd) == TRACK_HORZ) {
tx = min(max(x - imgW / 2, 0), nWidth - imgW);
ty = (nHeight - imgW) / 2;
nRange = nWidth - imgW;
sIncrement = (float) ((float) (tMax - tMin) / (float) nRange);
tVal = (long) ((sIncrement * tx) + tMin);
uMsg = WM_HSCROLL; }
else {
tx = (nWidth - imgW) / 2;
ty = min(max(y - imgH / 2, 0), nHeight - imgH);
nRange = nHeight - imgH;
sIncrement = (float) ((float)(tMax - tMin) / (float) nRange);
tVal = (long) ((sIncrement * ty) + tMin);
uMsg = WM_VSCROLL;
}
SendMessage(hWnd, TBM_SETPOS, 0, tVal);
SendMessage(skPopupOwner(hWnd), uMsg, MAKLNG(GetDlgCtrlID(hWnd), tVal), (LPARAM) hWnd);
if (CheckWindowStyle(hWnd, TBS_TOOLTIPS)) { skSetToolTipText(hWnd, STRL(tVal)); }
}
Note: You must have first used something like this:
skCreateToolTip(hCtrl, L" Stray light intensity ");
at the time of the control skinning.