Solved

Screensaver: Preview Window

Posted on 1998-03-30
3
305 Views
Last Modified: 2006-11-17
How do you show a preview of your VB screensaver under Display Properties inside of that little monitor?  In Sub Main() the Command$ has a '/p' and what looks like a window handle. What do I do with it?
0
Comment
Question by:VBert
3 Comments
 
LVL 7

Accepted Solution

by:
tward earned 100 total points
ID: 1460028
Untested code that I have just sitting here waiting for me to have some time to play with it!

Public Sub PreviewDisplay()
 
  ' this routine displays a form in the little screen saver preview display
  ' note: code based on source by Jeff Hack
   
  ' the preview window handle will be in the right 3 chars of the calling arguments
  Dim Temp%, PrevHWND As Long
   
  ' note we don't show the "Main_Form" here as it tries to maximize itself
  ' against the entire screen and besides a mouse move/key press could end the
  ' display instead of clicking on a button.
   
  PrevHWND = CLng(Right$(Command$, Len(Command$) - 3))
  Temp% = SetParent(PreviewForm.Picture1.hWnd, PrevHWND) 'set active window to the preview window
 
  ' show the graphic in the window, this is a static display but
  ' a active one could be done here
  PreviewForm.Picture1.Left = 0
  PreviewForm.Picture1.Top = 0
  DoEvents        'allow Windows to check for other events
 
  Do While IsWindowVisible(PrevHWND) <> 0 ' wait around until the window dissapears (ok or cancel)
   
    DoEvents  'allow Windows to check for other events
 
  Loop
   
  End
   
End Sub


0
 
LVL 1

Author Comment

by:VBert
ID: 1460029
Had to do some tweaking.  But very good.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1460030
Bought This Question.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now