RE:Cambiar Protector de Pantalla
necesitas poner en una forma un drive1, un dir1, un file1,un label1,dos botones
en el file1 en pattern ponle *.Scr(todos los protectores de pantalla)
este es el codigo fuente a usar: ponlo en declaraciones
Private Sub Command1_Click()
'Enlazamos la libreria Shell para cambiar el protector de pantalla
Set reg = CreateObject("wscript.shell")
' si no hay nada seleccionado
If Label1 = "" Then Exit Sub
'preguntar si se desea continuar
pregunta = MsgBox("Estas seguro de cambiarlo?", 20, "Mensaje")
Select Case pregunta
'si deseo cambiarlo
Case 6
' registramos el protector de pantalla seleccionado
reg.regWrite "HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE.EXE", Label1
MsgBox "el protector es " & Label1
Case 7
Exit Sub
MsgBox "Proceso abortado"
End Select
End Sub
Private Sub Command2_Click()
' sacamos de la memoria la forma
Set Form1 = Nothing
'finalizamos el programa
End
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub File1_Click()
'al dar el click en file1
'si de casualidad el protector esta en alguna unidad raiz mandamos el path al label1
If Len(Dir1) = 3 Then
Label1 = File1.Path & File1.FileName
'si el protector esta en c:\windows... mandamos el path al label1
ElseIf Len(Dir1) > 3 Then
Label1 = File1.Path & "\" & File1.FileName
End If
End Sub
Private Sub Form_Load()
ChDir "c:\windows\system32"
Command1.Caption = "Cambiar"
Command2.Caption = "Salir"
End Sub