By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,253 Members | 1,701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,253 IT Pros & Developers. It's quick & easy.

VB.Net Screen Saver (/p parameter), Help Needed

P: n/a
I am creatign a screen saver and am having a problem with showing the
screensaver form in the preview pane. The code works correctly in the the
form does display within the preview window. I created a simple for for
testing called Preview that only had a label on it and the text "This is a
Test" is hardcoded. By doing this I know that it is not other code I have
written that is causing this. The problems I am having are:

1) The Preview form shows up in the preview window, but it goes away after
displaying the form.
2) Although it does show up in the preview window, it does not show any of
the controls on the preview form. A label that says "This is a Test". The
fom shows on the screen, but there is not text on the scree either.

I have the following code for that /p parameter:

Case Is = "/p"

Dim style As Integer
Dim commonVideoSS As New Common
Dim PreviewHandle As Integer = Int32.Parse(CType(args(1), String))
Dim corners As Win32RECT = New Win32RECT

If commonVideoSS.MediaPlayerSetup(frmVideoSS.wmpVideo SS) Then
'Get WindowRec for preview window
corners.GetClientRect(PreviewHandle, corners)

'Reset form to size of preview window
frmPreview.WindowState = FormWindowState.Normal
frmPreview.Width = corners.Width
frmPreview.Height = corners.Height
frmPreview.wmpVideoSS.fullScreen = False
frmPreview.wmpVideoSS.Width = corners.Width
frmPreview.wmpVideoSS.Height = corners.Height

'Set the style
style = GetWindowLong(frmVideoSS.Handle.ToInt32, GWL_STYLE)
style = style Or WS_CHILD

'Set properties so form displays in preview window
SetWindowLong(frmVideoSS.Handle.ToInt32, GWL_STYLE, style)
SetParent(frmVideoSS.Handle.ToInt32, PreviewHandle)
SetWindowLong(frmVideoSS.Handle.ToInt32, GWL_HWNDPARENT,
SetWindowPos(frmVideoSS.Handle.ToInt32, 0, 0, 0, corners.right,
End If
End Catch


Any help will be appreciated.
S. Shawn Mehaffie
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.