473,794 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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"

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

If commonVideoSS.M ediaPlayerSetup (frmVideoSS.wmp VideoSS) Then
'Get WindowRec for preview window
corners.GetClie ntRect(PreviewH andle, corners)

'Reset form to size of preview window
frmPreview.Wind owState = FormWindowState .Normal
frmPreview.Widt h = corners.Width
frmPreview.Heig ht = corners.Height
frmPreview.wmpV ideoSS.fullScre en = False
frmPreview.wmpV ideoSS.Width = corners.Width
frmPreview.wmpV ideoSS.Height = corners.Height

'Set the style
style = GetWindowLong(f rmVideoSS.Handl e.ToInt32, GWL_STYLE)
style = style Or WS_CHILD

'Set properties so form displays in preview window
SetWindowLong(f rmVideoSS.Handl e.ToInt32, GWL_STYLE, style)
SetParent(frmVi deoSS.Handle.To Int32, PreviewHandle)
SetWindowLong(f rmVideoSS.Handl e.ToInt32, GWL_HWNDPARENT,
PreviewHandle)
SetWindowPos(fr mVideoSS.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
0 1065

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

Similar topics

2
2516
by: Card.Starzinger | last post by:
Hi! I need help to simulate programmatically user interaction on WinNT 4.0, to avoid screen saver activation. I try with key injection event. SendInput API and keybd_event API work correctly with Win2000 and WinXP system. Screen saver don't start.
3
2365
by: Thom Little | last post by:
How do I invoke the current screen saver with C#? Where did you find the information on how to do it? -- -- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd. --
1
2276
by: Daniel | last post by:
Hi all, i have a doubt related to the screen saver ability. After developing the asp.net webform, can i add screen saver ability in this webform? which means, i open the asp.net webform, after a few minutes the web form will act as a screen saver. In the screen, it only show summary of each product in real time(which mean the webform is still performing in background and the screen saver will be real time update the summary). Will it...
6
1278
by: Shawn Mehaffie | last post by:
Does anyone know where to go for a good example of the code that needs to be written to display your screen saver in the windows dialog preview pane? I know how to do it in VB6, but the same code does not work in VB.Net. Any help would be really appreciated so I can finish up a screen saver I have created. S. Shawn Mehaffie PCResourcesLLC@hotmail.com
2
4920
by: Claire | last post by:
Hi, Our software runs on a XP system attached to a touch screen monitor and smartcard USB reader. We run our own simple corporate screen saver. When the screen is touched the screen saver vanishes, but when a user inserts a smartcard (we're polling for inserts) the screen saver doesn't vanish. Is there any way we can awaken the system and stop the screen saver from code please?
4
2651
by: =?Utf-8?B?SmltIE9ybXNiZWU=?= | last post by:
Hopefully my solution will help others. I have a MacBook Pro on which I am running WindowsXP Home Edition. It is running totally separate from the Mac OS. I have to reboot to switch between OS's. After running my system for about 3 months successfully with a combination Microsoft wireless mouse & keyboard, I developed the common screen saver will not start problem. I tried everything in the community newsgroups I could find with no success....
1
2381
by: ashwiniappajigowda | last post by:
Hi, I have an simple MFC dialog based application. On launch of that application 'Password protected screen saver' is not getting activated after the screen saver timeout. If 'On resume, password protect' option unchecked, I am getting the Screen saver. Application not generating any of the keyboard or any user events to
3
5765
by: KK | last post by:
Dear All I want to prevent the screen saver getting activated when my application is running. I have the following code, but still screen saver is activated. What corrections I should make to prevent screen saver running to the following code. public class MainForm : System.Windows.Forms.Form { private static readonly int SC_SCREENSAVE = 0xF140;
0
1264
by: rehanrana | last post by:
I built application in VB6, my application appear in system tray, when I double click on icon of my application, it run screen saver, my screen saver shows images and news. Screen saver functionality is that when user press F2 key, my screen saver open news detail in browser. But the problem is that when screen saver stop (close), browser also close with the screen saver. following line i use to start screen saver lRet =...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10435
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.