Hi, it’s me again.
I can move a form around when using a borderless window and the spectrum continues to run, but when I call the Common Dialog routine (using the built in ocx or not) the spectrum stops until I close it. Does anybody have a way of loading a new file/playlist with the spectrum still running in the background?
Thanx – TBE
- tbe asked 13 years ago
Yes, I tried the compiled exe but still the same issue. I have now added the call sleep(1) but I do not really understand how this is going to help, and it doesn’t.
I can put the routine into a timer and this does work but there must be a way of using the loop as I do not like using timers unless absolutely necessary.
Thanx – TBE
When I use a loop with Sleep(1) and DoEvents it always has worked. The sleep call will give it 1ms wait before it loops back which makes it more efficient. But DoEvents, I believe, should fix the problem, but I guess not! It may be that the CommonDialog window halts all active loops for some reason. You might want to try using an API timer, which is a lot better than the crappy VB timer.
Ok, heres an example of an API timer:
Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Public Timer as long
Timer = SetTimer(Form.hWnd, 0, 85, AddressOf TimerProc)
‘In a module
Public Sub TimerProc(ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
‘Whatever you want the timer to do!
‘In your form_unload event
Call KillTimer(Form.hWnd, TimerProc)
Please login first to submit.