|
-
Mar 28th, 2007, 09:14 AM
#1
Thread Starter
Junior Member
How to run timer events when a CommonDialog Control is open
I've got an application with a timer that runs in the background. Every minute it counts and after 5 minutes of inactivity it shuts the app down.
But I've noticed that if a user leaves a FileOpen CommonDialog control on the screen that the timer doesn't work anymore.
Anyone know of a way I can do this?
Thanks,
Lance
-
Mar 28th, 2007, 09:23 AM
#2
Member
Re: How to run timer events when a CommonDialog Control is open
You could try CreateThread to create a new thread in you application, so far as I knon, none of other method can do it.
-
Mar 28th, 2007, 09:39 AM
#3
Re: How to run timer events when a CommonDialog Control is open
Creating a new thread will still not work as VB is not a true multithreaded environment. The dialog is modal so all processing on the parent form comes to a hault. However timers are not supossed to be affected by this. In the IDE it will apear to stop but if you compile an exe the timer should function.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 28th, 2007, 10:12 AM
#4
Thread Starter
Junior Member
Re: How to run timer events when a CommonDialog Control is open
Well, it kinda works when I compile.
The timer counts correctly and but the "end" statement only goes active when I close the Dialog box.
Lance
-
Mar 28th, 2007, 10:18 AM
#5
Re: How to run timer events when a CommonDialog Control is open
What end statement?
Please tell me you are not using the End Keyword.
-
Mar 28th, 2007, 10:19 AM
#6
Thread Starter
Junior Member
Re: How to run timer events when a CommonDialog Control is open
Here is my code. The timer interval is 60,000.
Code:
Private Sub ShutDown_Timer()
ShutDownCount = ShutDownCount + 1
If ShutDownCount >= 5 Then
End
End If
End Sub
-
Mar 28th, 2007, 11:22 AM
#7
Re: How to run timer events when a CommonDialog Control is open
Thats because the dialog is modal and End should never be used in a project with classes and forms. Use Unload Me instead.
The timer event continues to fire but the code may not until the modal dialog is dismissed. You may want to see if you can use some APIs to programmatically close the dialog in the Timer event when time is up..
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|