Solved

Screensaver: Preview Window

Posted on 1998-03-30
3
303 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

706 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