Deanna Earley
2013-12-09 17:32:49 UTC
Hi all.
I've just tried setting up a scrolling marquee progress bar in one of my
applications, and while it seems to switch into marquee mode, the
automatic timer (set via PBM_SETMARQUEE) either fails or is ignored.
I have an appropriate visual style manifest.
I have called InitCommonControls in the form's Initialize event.
I am using the v5 SP2 common controls.
The project is compiled.
I have set the PBS_MARQUEE style and confirmed it has applied.
The PBM_SETMARQUEE message returns 1.
If I minimise and restore the window it progresses.
If I set .Value it progresses.
If I send PBM_STEPIT it progresses.
If I send PBM_SETMARQUEE it sits there doing nothing.
This is the same issue discussed here:
http://www.vbforums.com/showthread.php?462116-Marquee-Progressbar
Does anyone have any deeper insight as to why the VB wrapper is dropping
the PBM_SETMARQUEE message or the associated timer events and why I need
to do it "manually"?
Thanks
Here's the sample code I was using to test:
=====================================
Option Explicit
Private Const GWL_STYLE = (-16)
Private Const PBS_MARQUEE = &H8
Private Const WM_USER = &H400
Private Const PBM_STEPIT = WM_USER + 5
Private Const PBM_SETMARQUEE = WM_USER + 10
Private Declare Function GetWindowLong Lib "user32" Alias
"GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias
"SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal
dwNewLong As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long
Private Sub Form_Load()
Dim Style As Long
Style = GetWindowLong(ProgressBar1.hWnd, GWL_STYLE)
Style = Style Or PBS_MARQUEE
SetWindowLong ProgressBar1.hWnd, GWL_STYLE, Style
SendMessage ProgressBar1.hWnd, PBM_SETMARQUEE, 1, ByVal 0
End Sub
Private Sub Timer1_Timer()
SendMessage ProgressBar1.hWnd, PBM_STEPIT, 0, ByVal 0&
End Sub
I've just tried setting up a scrolling marquee progress bar in one of my
applications, and while it seems to switch into marquee mode, the
automatic timer (set via PBM_SETMARQUEE) either fails or is ignored.
I have an appropriate visual style manifest.
I have called InitCommonControls in the form's Initialize event.
I am using the v5 SP2 common controls.
The project is compiled.
I have set the PBS_MARQUEE style and confirmed it has applied.
The PBM_SETMARQUEE message returns 1.
If I minimise and restore the window it progresses.
If I set .Value it progresses.
If I send PBM_STEPIT it progresses.
If I send PBM_SETMARQUEE it sits there doing nothing.
This is the same issue discussed here:
http://www.vbforums.com/showthread.php?462116-Marquee-Progressbar
Does anyone have any deeper insight as to why the VB wrapper is dropping
the PBM_SETMARQUEE message or the associated timer events and why I need
to do it "manually"?
Thanks
Here's the sample code I was using to test:
=====================================
Option Explicit
Private Const GWL_STYLE = (-16)
Private Const PBS_MARQUEE = &H8
Private Const WM_USER = &H400
Private Const PBM_STEPIT = WM_USER + 5
Private Const PBM_SETMARQUEE = WM_USER + 10
Private Declare Function GetWindowLong Lib "user32" Alias
"GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias
"SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal
dwNewLong As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long
Private Sub Form_Load()
Dim Style As Long
Style = GetWindowLong(ProgressBar1.hWnd, GWL_STYLE)
Style = Style Or PBS_MARQUEE
SetWindowLong ProgressBar1.hWnd, GWL_STYLE, Style
SendMessage ProgressBar1.hWnd, PBM_SETMARQUEE, 1, ByVal 0
End Sub
Private Sub Timer1_Timer()
SendMessage ProgressBar1.hWnd, PBM_STEPIT, 0, ByVal 0&
End Sub
--
Deanna Earley (***@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/
iCode Systems
(Replies direct to my email address will be ignored. Please reply to the
group.)
Deanna Earley (***@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/
iCode Systems
(Replies direct to my email address will be ignored. Please reply to the
group.)