|
When the Display Properties window selects a screen saver, the screensaver program is invoked with /p. The screen saver form is then made a child of the Display Properties window. Problem is, when the display properties window is closed, the screen saver form is hidden, but the program/process does not terminate.
I've placed code in events as follows:
Private Sub Form_Deactivate() End End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) End End Sub
Private Sub Form_LostFocus() SaveSetting App.Title, "Settings", "PrevInstance", 0 SaveSetting App.Title, "Settings", "PrevPID", 0 End End Sub
Private Sub Form_Terminate() End End Sub
Private Sub Form_Unload(Cancel As Integer) SaveSetting App.Title, "Settings", "PrevInstance", 0 SaveSetting App.Title, "Settings", "PrevPID", 0 Unload Me End End Sub
None of these events are triggered when the parent window closes. I placed a timer on the form that checked to see if the parent window is still open, but the program stops getting cpu time after the parent window closes.
Any ideas? Using VB6 'cause I don't want to do .NET.
|