473,385 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VB.net ScreenSaver, /p parameter - Help Needed

I am creating 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

There is probably something really simple missing, but I cannot figure out
what it is.

Thanks,

Any help will be appreciated.
S. Shawn Mehaffie
Nov 20 '05 #1
1 2643
* "Shawn Mehaffie" <PC************@hotmail.com> scripsit:
I am creating 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
How do you display the form? Do you display the same instance? This
may cause re-parenting of 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.


Does text you draw directly onto the form show up (drawn in the form's
'OnPaint' method)?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: klappnase | last post by:
Hello everyone, does anyone know a way to stop the screensaver under linux from starting up while a certain process is running? I need this because I experience a memory leak while recording...
6
by: Michele Simionato | last post by:
I would like to disable/enable the screensaver on a Win98 box with a Python script. Any suggestion? Thanks, Michele
0
by: Luke | last post by:
I am trying to capture an event when the screensaver starts. I have code working on Windows XP etc when the Password/Welcome Screen is enabled . Using the Fast User Switching Notifications. ...
2
by: DanielB | last post by:
Does anyone know what the command line argumentto launch a screensaver's options/configuration dialog is on Windows XP Pro? From most of the example source code I can find on the web, it would...
0
by: Paul Smith | last post by:
I have been given an unusual task to create a Windows Service to do something periodically to make the screensaver timer reset. We have a general policy of locking computers automatically after 10...
4
by: Paul Smith | last post by:
I have been given an unusual task to create a Windows Service to do something periodically to make the screensaver timer reset. We have a general policy of locking computers automatically after 10...
1
by: DanielB | last post by:
Does anyone know what the command line argumentto launch a screensaver's options/configuration dialog is on Windows XP Pro? From most of the example source code I can find on the web, it would...
4
by: Simon Mercer | last post by:
I have been trying to build a screensaver that will connect to a database and display specific data depending on the user that is logged in. I have managed to get a simple data access screensaver...
0
by: Shawn Mehaffie | last post by:
I am creating 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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.