04-01-2005, 04:40 AM
I guess your right, I didn't try that big one that had everything on it, I only tried the ones that wouldn't work before. I just thought it was fixed, sorry.
It seems that the MakeFont routine isn't working in xp now with ver13. It's now doing gpf in XP.
To top that, my memory stick thing went out on me, to the store I go.
qbos:
I read everything I could find on Progress bar Control, and most of it didn't make sense at the start. I came up with this one to start out with, and I think I'll probably use it for a Sample. Maybe in a sub menu let it change colors to the background and bar.
Later...........Jerry Fielden
It seems that the MakeFont routine isn't working in xp now with ver13. It's now doing gpf in XP.
To top that, my memory stick thing went out on me, to the store I go.
qbos:
I read everything I could find on Progress bar Control, and most of it didn't make sense at the start. I came up with this one to start out with, and I think I'll probably use it for a Sample. Maybe in a sub menu let it change colors to the background and bar.
Code:
FUNCTION ProcessWindow (BYVAL hDlg AS Uinteger, BYVAL wMsg AS Uinteger, BYVAL wParam _
AS Uinteger, BYVAL lParam AS LONG, BYVAL hInstance AS LONG) AS LONG
dim hCtrl as long
dim wmid as long, wmEvent as long
Static advance As long
InitCommonControls
If wMsg = WM_CREATE then
hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, "msctls_progress32", "", _
WS_CHILD OR WS_VISIBLE OR WS_CLIPSIBLINGS Or CCS_BOTTOM, _
50, 50, 100, 30, _
hdlg, 101, 0, BYVAL NULL)
SendMessage hctrl, PBM_SETBKCOLOR, 0, &HB8E989' clrbk changes background color
hCtrl = CreateWindowEx (0, "button", "Start", _
WS_CHILD OR WS_VISIBLE OR BS_Pushbutton , _
0, 50, 50, 30, _
hdlg, 102, 0, BYVAL NULL)
ELSEIF wMsg = WM_COMMAND THEN ' Messages sent for Command Items
wmID = wParam and &hFFFF 'Control ID
wmEvent = wParam shr 16 'Window Event
IF wmEvent = BN_CLICKED THEN ' Intercept a Mouse click
IF wmID = 102 THEN ' If start Button is clicked
hCtrl = GetDlgItem(hDlg, 101) 'get handle for bar
SendMessage hctrl, PBM_SETBARCOLOR, 0, &H400080' change bar color
Sendmessage hCtrl, TBM_SETRANGE, 0, 100
for advance = 1 to 100
Sendmessage hCtrl, pbm_setpos, advance, 0
SLEEP 50
next
PostQuitMessage 0 ' shutdown after progress bar is done
END IF
END IF
ELSEIF wMsg = WM_CLOSE THEN ' Message from Clicking on system close Icon
PostQuitMessage 0
END IF
ProcessWindow = DefWindowProc(hdlg, wMsg, wParam, lParam)
END FUNCTION
Later...........Jerry Fielden