0
0

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

  • You must to post comments
0
0

Let me guess, you are running the Spectrum under a VB timer routine? If so, it only happens while in the IDE, if running the EXE alone, it will not happen

  • You must to post comments
0
0

No, I am not running it through a timer but through a loop

  • You must to post comments
0
0

Did you try the “running the EXE alone” part?

  • You must to post comments
0
0

Try putting this at the end of your loop
[code:xcboeasq]
Call Sleep(1)
DoEvents
[/code:xcboeasq]

  • You must to post comments
0
0

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

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

Thanx, but this is where I need your help. How do you set up an API timer in VB?

An example would be appreciated, if you don’t mind.

  • You must to post comments
0
0

Ok, heres an example of an API timer:

API Declarations
[code:smet4m76]
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
[/code:smet4m76]

[code:smet4m76]
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!

End Sub

‘In your form_unload event
Call KillTimer(Form.hWnd, TimerProc)
[/code:smet4m76]

  • You must to post comments
0
0

Thanx Paranoid_Android

TBE

  • You must to post comments
Showing 9 results
Your Answer

Please first to submit.