Jhd.Honza
Jan 22nd, 2000, 06:28 PM
How can I start applications found in StartUp menu (I need to get list of them)
------------------
Thanks,
John, 14 years old
DiGiTaIErRoR
Jan 22nd, 2000, 06:37 PM
Well since it's ONLY a folder and it's located at:
C:\WINDOWS\START MENU\PROGRAMS\STARTUP
it can be done easily
Trying to make your own shell eh?
Good Luck!
------------------
DiGiTaIErRoR
cjwares
Jan 23rd, 2000, 12:53 AM
But don't be fooled!! if the computer you are running has Windows Login enabled, or a network, the startup folder would be located:
C:\WINDOWS\PROFILES\[username]\START MENU\PROGRAMS\STARTUP
Be sure to add a User Login item, to see if a user is currently logged on.
If the form, have a directory box named dir1 and a command button named command1 and a textbox named text1 (make it a pass box)
Private Sub command1_Click()
MsgBox "The password you supplied was " & VerifyWindowsLoginUserPassword(text1.Text)
end sub
Private Sub Form_Load()
on error goto 10
uname = GetWindowsLoginUserID
dir1.path = "c:\windows\profiles\" & uname & "\start menu\programs\startup\"
exit sub
10
if err = 76 then 'Path not found
dir1.path = "c:\windows\start menu\programs\startup\"
end if
resume next
end sub
in the declares of the form:
Option Explicit
In a module file, put this:
Option Explicit
Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, _
nSize As Long) As Long
Private Declare Function WNetVerifyPassword Lib "mpr.dll" Alias _
"WNetVerifyPasswordA" (ByVal lpszPassword As String, _
ByRef pfMatch As Long) As Long
Public Function GetWindowsLoginUserID() As String
Dim rtn As Long
Dim sBuffer As String
Dim lSize As Long
lSize = Len(sBuffer)
rtn = GetUserName(sBuffer, lSize)
If rtn Then
GetWindowsLoginUserID = sBuffer
Else
'error!
GetWindowsLoginUserID = ""
End If
End Function
Public Function VerifyWindowsLoginUserPassword(ByVal Password As String) As Boolean
Dim rtn As Long, Match As Long
rtn = WNetVerifyPassword(Password, Match)
If rtn Then
VerifyWindowsLoginUserPassword = False
Else
VerifyWindowsLoginUserPassword = (Match <> 0)
End If
End Function
Hope this helps you out! :)
Email me with questions.
------------------
Charlie Jacquez
16 Year Old Software Developer
Email: cjwares@hotmail.com
Web: CJWARES Online (http://www.geocities.com/cjwares)
AIM: CJWARES, SlimmShadee2000, or BIOSzapper
ICQ: 58493454
I program: Basic, Visual Basic, HTML, and TI-Calculators
My System Specs: Click here (http://www.geocities.com/SiliconValley/Office/4476/myspecs.htm)
[This message has been edited by cjwares (edited 01-23-2000).]