Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

screen saver 2

Status
Not open for further replies.

slowATthought

Programmer
Dec 2, 2003
56
US
Is there a way to make a program run as a screen saver in VB?
 
ooops, I thought slowATthought's last post was addressed to me. Hey, slowATthought if you goto and do a search for screen savers you'll get alot of good examples and source code. Great web site.

"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
The preview command is running the screen saver full screen intsead of in that little window.
 
My guess is that the variable preview should be checked and if true, handled in your form load event to prevent hiding the cursor, maximizing the form etc.

"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
Whats the startup object of the project? is it the form? If so change it to sub Main. Project->Properties->StartUp Object

The variable preview is only to cancel the form mousemove event whilst in preview mode

 
Ok, I have looked at some sample code, and I have gotten the modes right, but in the preview mode, the preview is at the corner of the screen because I am using DirectDraw. I need the top and left values of that preview box. Other than that, everything is working fine.
 
Sorry for being so slow with this. It just takes me a while to learn new concepts That's where I got my screen name ;).
 
You should be able to get them from
preview_hwnd.Left
preview_hwnd.Top
in the runPreview sub

"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
preview_hwnd is a long, so I don't think it should have top and left values. When I tried running it, it hit an error titled: "Invalid Qualifier".
 
Haven't had my coffee yet:)
preview_rect.Left
preview_rect.Top

"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
Hmm... I tried that, but it always seems to return 0 as a top value and 0 as the left value. The preview rect apparently is to show how big the preview area is, but not where it is. Come to think of it, the form is being move to 0,0 anyway, so what it is that puts it in the preview screen?

Sorry for the trouble.
 
DirectX is no respecter of client coordiantes versus screen coordinates...you needd to investigate the following API call: ClientToScreen
 
Yay! That worked. Thanks for all of the help. I know you have been answering question after question, and I apreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top