467,169 Members | 985 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,169 developers. It's quick & easy.

VB.Net ScreenSaver Question (Preview, /p) - Need Help Deperately

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 now 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"

Try
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, PreviewHandle)
SetWindowPos(frmVideoSS.Handle.ToInt32, 0, 0, 0, corners.right, corners.bottom, SWP_NOZORDER Or SWP_NOACTIVATE Or SWP_SHOWWINDOW)
End If
End Catch

Thanks,

Any help will be appreciated.
S. Shawn Mehaffie

Nov 20 '05 #1
  • viewed: 1512
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by klappnase | last post: by
reply views Thread by Luke | last post: by
reply views Thread by Paul Smith | last post: by
4 posts views Thread by Paul Smith | last post: by
4 posts views Thread by Simon Mercer | last post: by
1 post views Thread by Shawn Mehaffie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.