IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   Visual Basic (https://www.ircforumlari.net/visual-basic/)
-   -   Programın Windows açılışında otomatik başlaması (https://www.ircforumlari.net/visual-basic/124757-programin-windows-acilisinda-otomatik-baslamasi.html)

Cemalizim 21 Temmuz 2008 19:16

Programın Windows açılışında otomatik başlaması
 
PHP- Kodu:

 '// Kaynak: vbaccelerator.com

Public Enum eAutoRunTypes 
    eNever 
    eOnce 
    eAlways 
End Enum 

Public Property Let AutoRun(ByVal eType As eAutoRunTypes) 
Dim ***e As String 

    ***e = App.Path 
    If (Right$(***e, 1) <> "\") Then ***e = ***e & "\" 
    ***e = ***e & App.EXEName 
    
    Dim cR As New cRegistry 
    cR.ClassKey = HKEY_LOCAL_MACHINE 
    If (eType = eNever) Then 
        ' 
Remove entry from always Run if it is there
        
cR.SectionKey "Software\Microsoft\Windows\CurrentVersion\Run" 
        
cR.ValueKey App.EXEName 
        On Error Resume Next 
        cR
.DeleteValue 
        Err
.Clear 
        
' Remove entry from RunOnce if it is there: 
        cR.SectionKey = "Software\Microsoft\Windows\CurrentVersion\RunOnce" 
        On Error Resume Next 
        cR.DeleteValue 
        Err.Clear 
    ElseIf eType = eOnce Then 
        ' 
Remove entry from always Run if it is there
        
cR.SectionKey "Software\Microsoft\Windows\CurrentVersion\Run" 
        
cR.ValueKey App.EXEName 
        On Error Resume Next 
        cR
.DeleteValue 
        Err
.Clear 
        
' Add an entry to RunOnce (or just ensure the exe name and path 
        ' 
is correct if it is already there): 
        
cR.SectionKey "Software\Microsoft\Windows\CurrentVersion\RunOnce" 
        
cR.ValueKey App.EXEName 
        cR
.ValueType REG_SZ 
        cR
.Value ***e 
    
Else 
        
' Remove entry from RunOnce if it is there: 
        cR.SectionKey = "Software\Microsoft\Windows\CurrentVersion\RunOnce" 
        cR.ValueKey = App.EXEName 
        On Error Resume Next 
        cR.DeleteValue 
        Err.Clear 
        ' 
Add an entry to RunOnce (or just ensure the exe name and path 
        
' is correct if it is already there): 
        cR.SectionKey = "Software\Microsoft\Windows\CurrentVersion\Run" 
        cR.ValueKey = App.EXEName 
        cR.ValueType = REG_SZ 
        cR.Value = ***e 
    End If 
        
End Property 

Public Property Get AutoRun() As eAutoRunTypes 
    Dim cR As New cRegistry 
    cR.ClassKey = HKEY_LOCAL_MACHINE 
    cR.SectionKey = "Software\Microsoft\Windows\CurrentVersion\Run" 
    cR.ValueKey = App.EXEName 
    cR.Default = "?" 
    cR.ValueType = REG_SZ 
    If (cR.Value = "?") Then 
        cR.SectionKey = "Software\Microsoft\Windows\CurrentVersion\RunOnce" 
        If (cR.Value = "?") Then 
            AutoRun = eNever 
        Else 
            AutoRun = eOnce 
        End If 
    Else 
        AutoRun = eAlways 
    End If
End Property 

Alıntıdır


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 23:19.

Powered by vBulletin® Version 3.8.8 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2024 IRCForumlari.Net