27-08-15, 09:22 PM
السلام عليكم
فى كثير من المشاريع نحتاج الغاء ظهور النافزة التى تطلب الازن بتشغيل البرنامج as administrator
اليوم احضرت لكم هذا الكود بعد البحث المطول على وجدت طريقة من خلال الرجسترى
و اليكم كود الالغاء
كود :
Dim key As Microsoft.Win32.RegistryKey
key = Microsoft.Win32.Registry.LocalMachine
key = key.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
key.SetValue("ConsentPromptBehaviorAdmin", "0", Microsoft.Win32.RegistryValueKind.DWord) 'Enable 5
Dim key2 As Microsoft.Win32.RegistryKey
key2 = Microsoft.Win32.Registry.LocalMachine
key2 = key2.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
key2.SetValue("PromptOnSecureDesktop", "0", Microsoft.Win32.RegistryValueKind.DWord) 'Enable 1
MsgBox("done")
كود اعادة النافذة
كود :
Dim key As Microsoft.Win32.RegistryKey
key = Microsoft.Win32.Registry.LocalMachine
key = key.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
key.SetValue("ConsentPromptBehaviorAdmin", "5", Microsoft.Win32.RegistryValueKind.DWord) 'Enable 5
Dim key2 As Microsoft.Win32.RegistryKey
key2 = Microsoft.Win32.Registry.LocalMachine
key2 = key2.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
key2.SetValue("PromptOnSecureDesktop", "1", Microsoft.Win32.RegistryValueKind.DWord) 'Enable 1
MsgBox("done")
اتمنى ان اكون قد افدتكم