Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Setting 3D Text Screen Saver

Posted on 2002-05-29
3
Medium Priority
?
260 Views
Last Modified: 2010-05-02
Does anyone know how to set the text of the 3D Text screen saver via code? I have a request from an engaged co-worker who wants her screen saver to dynamically display the number of days to her wedding. I figure I could write a small vb program and put it in her startup folder, and it would be able to update the text when she logs into her machine in the morning.

TIA,

:) dapperry
0
Comment
Question by:dapperry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
CarlJWhite earned 300 total points
ID: 7043980
This alters the registry value of 3d screen saver text

Check the registry path I used is the same on her machine.

You need code to work out how many days are left to the big day so it changes the value each day

You also need to add the reference Windows Script Host Model
(Project>>References)


Dim wshReadRegistry     As IWshShell
Set wshReadRegistry = CreateObject("Wscript.Shell")


Dim strRegistryPath     As String

'Get the path from the Registry
On Error Resume Next

   'Build path to key
   
   strRegistryPath = "HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText\Text"
     
     
   wshReadRegistry.RegWrite strRegistryPath, "newvaluegoeshere"
   
   Set wshReadRegistry = Nothing
   
       

0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 7044543
This does the same thing without using the windows scripting host:

Option Explicit
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal Hkey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal Hkey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Const HKEY_CURRENT_USER = &H80000001
Private Const ERROR_SUCCESS = 0&
Private Const REG_SZ = 1
Private X As Long

Private Sub SaveString(Hkey As Long, strpath As String, strValue As String, strdata As String)
    Dim keyhand As Long
    Dim r As Long
    X = RegCreateKey(Hkey, strpath, keyhand)
    X = RegSetValueEx(keyhand, strValue, 0, REG_SZ, ByVal strdata, Len(strdata))
    X = RegCloseKey(keyhand)
End Sub

Private Sub Command1_Click()
Call SaveString(HKEY_CURRENT_USER, "Control Panel\Screen Saver.3DText", "Text", "Days till wedding!")
End Sub
0
 
LVL 3

Author Comment

by:dapperry
ID: 7044801
I tried CarlJWhite's method, and it works just fine. Thanks.

:) dapperry
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 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