home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. CD ROM (Annual Premium Edition)
/
premium.zip
/
premium
/
WINUTIL2
/
SYSWIT.ZIP
/
PLANS.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-10-26
|
5KB
|
135 lines
DefInt A-Z
Dim ReadString As String * 255
Sub Frame (F As Form, L, T, H, W)
OFFSET = 4
BIGOFFSET = 6
F.DrawWidth = 1
F.forecolor = &HE0E0E0
'bottom:
F.Line (L + F.DrawWidth, T + H + OFFSET)-(L + W - F.DrawWidth, T + H + OFFSET)
'right:
F.Line (L + W + OFFSET, T + F.DrawWidth)-(L + W + OFFSET, T + H + OFFSET - F.DrawWidth)
F.forecolor = &H808080
'top:
F.Line (L - BIGOFFSET + F.DrawWidth, T - BIGOFFSET)-(L + W + BIGOFFSET - F.DrawWidth, T - BIGOFFSET)
'left:
F.Line (L - BIGOFFSET, T + F.DrawWidth - BIGOFFSET)-(L - BIGOFFSET, T + H + BIGOFFSET - F.DrawWidth)
End Sub
Sub Frame2 (F As Form, L, T, H, W)
OFFSET = 4
BIGOFFSET = 6
F.DrawWidth = 2
F.forecolor = &H808080
'bottom:
F.Line (L + F.DrawWidth, T + H + OFFSET)-(L + W - F.DrawWidth, T + H + OFFSET)
'right:
F.Line (L + W + OFFSET, T + F.DrawWidth)-(L + W + OFFSET, T + H + OFFSET - F.DrawWidth)
F.forecolor = &HE0E0E0
'top:
F.Line (L - BIGOFFSET + F.DrawWidth, T - BIGOFFSET)-(L + W + BIGOFFSET - F.DrawWidth, T - BIGOFFSET)
'left:
F.Line (L - BIGOFFSET, T + F.DrawWidth - BIGOFFSET)-(L - BIGOFFSET, T + H + BIGOFFSET - F.DrawWidth)
End Sub
Sub ReadProf ()
X = GetPrivateProfileString("Syswitch", "ConfigName1", "Default Configuration", ReadString, 255, "Syswitch.INI")
ConfigName(1) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigName2", "Default Configuration File", ReadString, 255, "Syswitch.INI")
ConfigName(2) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigName3", "Default System Configuration", ReadString, 255, "Syswitch.INI")
ConfigName(3) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigName4", "Use File Configure to Change Default", ReadString, 255, "Syswitch.INI")
ConfigName(4) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigName5", "Default", ReadString, 255, "Syswitch.INI")
ConfigName(5) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigFile1", "SYSTEM.INI", ReadString, 255, "Syswitch.INI")
ConfigFile(1) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigFile2", "SYSTEM.INI", ReadString, 255, "Syswitch.INI")
ConfigFile(2) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigFile3", "SYSTEM.INI", ReadString, 255, "Syswitch.INI")
ConfigFile(3) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigFile4", "SYSTEM.INI", ReadString, 255, "Syswitch.INI")
ConfigFile(4) = stripstring(ReadString)
X = GetPrivateProfileString("Syswitch", "ConfigFile5", "SYSTEM.INI", ReadString, 255, "Syswitch.INI")
ConfigFile(5) = stripstring(ReadString)
End Sub
Function stripstring (SOURCE As String) As String
L = Len(SOURCE)
For X = 1 To L
If Asc(Mid$(SOURCE, X, 1)) < 32 Then Exit For
Next X
stripstring = Left$(SOURCE, X - 1)
End Function
Sub WritProf ()
X = WRitePrivateProfileString("Syswitch", "ConfigFile1", ConfigFile(1), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigFile2", ConfigFile(2), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigFile3", ConfigFile(3), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigFile4", ConfigFile(4), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigFile5", ConfigFile(5), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigName1", ConfigName(1), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigName2", ConfigName(2), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigName3", ConfigName(3), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigName4", ConfigName(4), "Syswitch.Ini")
X = WRitePrivateProfileString("Syswitch", "ConfigName5", ConfigName(5), "Syswitch.Ini")
End Sub
Sub CopyFile (SOURCE As String)
X = FALSE
If UCase$(SOURCE) = "SYSTEM.INI" Then X = MsgBox("Restart using current SYSTEM.INI?", 4, "No Change")
If X = IDYES Then RestartProc
If X = IDNO Then Exit Sub
Windir = Windir + "\"
Destination$ = Windir + "System.ini"
DestinationBack$ = Windir + "system.bak"
SOURCE$ = Windir + SOURCE
On Error Resume Next
Kill DestinationBack$
Name Destination$ As DestinationBack$
On Error GoTo ErrProc
Open SOURCE$ For Binary As #1
Whole = LOF(1) \ 32000
part = LOF(1) Mod 32000
buffer$ = String$(32000, 0)
start& = 1
Open Destination$ For Binary As #2
For X = 1 To Whole
Get #1, start&, buffer$
Put #2, start&, buffer$
start& = start& + 32000
Next X
buffer$ = String$(part, 0)
Get #1, start&, buffer$
Put #2, start&, buffer$
Close
Call RestartProc
Exit Sub
ErrProc:
MsgBox "Disk error"
Kill Destination$
Name DestinationBack$ As Destination$
End
End Sub
Sub RestartProc ()
Okay% = ExitWindows(&H42, 0)
If Okay% = 0 Then MsgBox "Cannot Restart Windows", 32, "Win Restart"
End
End Sub