12-08-20, 03:14 AM
مش هطول عليكو ده ربط التحميل
اضغط
ياريت لوحد معاه ثيمات جديده يارت يشاركها معانا
ودي ثيمات 2019-2020
C#
C#
Add the logic to start a process. The process that you will start will be the Theme window (the same as when you right-click on your desktop and choose Personalize).
C#
C#
On to your Form…
Add the following namespaces to your Form.
C#
C#
Add code to display the Current theme behind button1.
C#
C#
C#
ده ربط فيه كل الثيمات المنشور 2020 https://github.com/search?q=VB.Net-Themes:D
اضغط
ياريت لوحد معاه ثيمات جديده يارت يشاركها معانا
ودي ثيمات 2019-2020
C#
- using System.Runtime.InteropServices;
- using Microsoft.Win32;
- using System.Threading;
- Imports System.Runtime.InteropServices
- Imports System.Threading
- Imports Microsoft.Win32
C#
- [DllImport("user32.dll", EntryPoint = "FindWindow")]
- private static extern IntPtr FindWindow(string sClassName,
- string sAppName);
- [DllImport("user32.dll")]
- private static extern IntPtr SendMessage(IntPtr hWnd,
- uint Msg, IntPtr wParam, IntPtr lParam);
-
-
- private const uint WM_CLOSE = 0x10;
- <DllImport("user32.dll", EntryPoint:="FindWindow")>
- Private Shared Function FindWindow(ByVal sClassName As String, _
- ByVal sAppName As String) As IntPtr
- End Function
-
- <DllImport("user32.dll")>
- Private Shared Function SendMessage(ByVal hWnd As IntPtr, _
- ByVal Msg As UInteger, ByVal wParam As IntPtr, _
- ByVal lParam As IntPtr) As IntPtr
- End Function
-
- Private Const WM_CLOSE As UInteger = 16
Add the logic to start a process. The process that you will start will be the Theme window (the same as when you right-click on your desktop and choose Personalize).
C#
- private String StartProc(string strFile, string strArgs,
- int intSec, ref Boolean blnExited)
- {
- String strMsg = String.Empty;
- Process proc = new Process();
-
- proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
-
- proc.StartInfo.FileName = strFile;
- proc.StartInfo.Arguments = strArgs;
-
- proc.Start();
-
- blnExited = false;
-
- int intSecCount = 0;
-
- while (!blnExited && intSecCount < intSec)
- {
-
- blnExited = proc.HasExited;
-
- intSecCount++;
-
- Thread.Sleep(1000);
-
- }
-
- if (intSecCount == intSec)
- {
-
- strMsg = "Program did not close in expected time.";
- }
-
- return strMsg;
- }
- Private Function StartProc(ByVal strFile As String, _
- ByVal strArgs As String, ByVal intSec As Integer, _
- ByRef blnExited As Boolean) As String
-
- Dim strMsg As String = String.Empty
- Dim proc As Process = New Process()
-
- proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized
-
- proc.StartInfo.FileName = strFile
- proc.StartInfo.Arguments = strArgs
- proc.Start()
-
- blnExited = False
- Dim intSecCount As Integer = 0
-
- While Not blnExited AndAlso intSecCount < intSec
-
- blnExited = proc.HasExited
- intSecCount += 1
- Thread.Sleep(1000)
-
- End While
-
- If intSecCount = intSec Then
-
- strMsg = "Program did not close in expected time."
-
- End If
-
- Return strMsg
-
- End Function
C#
- public Boolean SwitchTheme(string strPath)
- {
-
- try
- {
-
- Boolean blnExit = false;
- String ThemeOutput = this.StartProc("rundll32.exe",
- System.Environment.GetFolderPath(Environment
- .SpecialFolder.System) + @"\shell32.dll,
- Control_RunDLL " + System.Environment
- .GetFolderPath(Environment.SpecialFolder.System) +
- "\\desk.cpl desk,@Themes /Action:OpenTheme /file:\""
- + strPath + "\"", 30, ref blnExit);
-
- MessageBox.Show(ThemeOutput);
-
- Thread.Sleep(1000);
-
- // FindWindow(Nothing, "Personalization")
- IntPtr hWndTheme = FindWindow("CabinetWClass", null);
-
- SendMessage(hWndTheme, WM_CLOSE, IntPtr.Zero,
- IntPtr.Zero);
-
- }
-
- catch (Exception ex)
- {
-
- MessageBox.Show(ex.Message);
-
-
- return false;
-
- }
-
- return true;
-
- }
-
- public string CurrentTheme()
- {
-
- string strReg = @"HKEY_CURRENT_USER\Software\Microsoft\
- Windows\CurrentVersion\Themes";
-
- string strTheme = (string)Registry.GetValue(strReg,
- "CurrentTheme", string.Empty);
-
- return strTheme;
-
- }
- Public Function SwitchTheme(strPath As String) As Boolean
-
- Try
-
- Dim blnExit As Boolean = False
-
- Dim ThemeOutput As String = StartProc("rundll32.exe", _
- System.Environment.GetFolderPath(Environment _
- .SpecialFolder.System) & "\shell32.dll, _
- Control_RunDLL " + System.Environment.GetFolderPath _
- (Environment.SpecialFolder.System) & _
- "\desk.cpl desk,@Themes /Action:OpenTheme /file:""" _
- & strPath & """", 30, blnExit)
-
- MessageBox.Show(ThemeOutput)
- Thread.Sleep(1000)
-
- 'FindWindow(Nothing, "Personalization")'
- Dim hWndTheme As IntPtr = FindWindow("CabinetWClass", _
- Nothing)
-
- SendMessage(hWndTheme, WM_CLOSE, IntPtr.Zero, IntPtr.Zero)
-
- Catch ex As Exception
-
- MessageBox.Show(ex.Message)
-
- Return False
-
- End Try
-
- Return True
-
- End Function
-
- Public Function CurrentTheme() As String
-
- Dim strReg As String = "HKEY_CURRENT_USER\Software\ _
- Microsoft\Windows\CurrentVersion\Themes"
- Dim strTheme As String = CStr(Registry.GetValue(strReg, _
- "CurrentTheme", String.Empty))
-
- Return strTheme
-
- End Function
On to your Form…
Add the following namespaces to your Form.
C#
- using System.Globalization;
- using System.Runtime.InteropServices;
- Imports System.Globalization
- Imports System.Runtime.InteropServices
C#
- [DllImport("dwmapi.dll")]
- public static extern IntPtr DwmIsCompositionEnabled(out bool
- pfEnabled);
-
- bool blnAero = false;
- clsThemeDetails thm = new clsThemeDetails();
- <DllImport("dwmapi.dll")>
- Public Shared Function DwmIsCompositionEnabled(<Out> _
- ByRef pfEnabled As Boolean) As IntPtr
- End Function
-
- Private blnAero As Boolean = False
-
- Private thm As clsThemeDetails = New clsThemeDetails()
Add code to display the Current theme behind button1.
C#
- private void button1_Click(object sender, EventArgs e)
- {
-
- MessageBox.Show("Current Theme = " + thm.CurrentTheme());
-
- Console.WriteLine(thm.CurrentTheme());
- }
- Private Sub button1_Click(ByVal sender As Object, _
- ByVal e As EventArgs) Handles button1.Click
-
- MessageBox.Show("Current Theme = " & thm.CurrentTheme())
-
- Console.WriteLine(thm.CurrentTheme())
-
- End Sub
C#
- private void button2_Click(object sender, EventArgs e)
- {
-
- DwmIsCompositionEnabled(out blnAero);
- thm.SwitchTheme(textBox1.Text); //C:\\Users\\Hannes\\
- AppData\\Local\\Microsoft\\Windows\\Themes\\
- African W;//
- }
- Private Sub button2_Click(ByVal sender As Object, _
- ByVal e As EventArgs) Handles button2.Click
-
- DwmIsCompositionEnabled(blnAero)
- 'C:\Users\Hannes\AppData\Local\Microsoft\Windows\Themes\'
- 'African W'
- thm.SwitchTheme(textBox1.Text)
-
- End Sub
C#
- private void button3_Click(object sender, EventArgs e)
- {
-
- Process.Start("explorer.exe", "/n,shell:::{ED834ED6-4B5A
- -4bfe-8F11-A626DCB6A921} ");
- }
- Private Sub Button3_Click(sender As Object, e As EventArgs) _
- Handles Button3.Click
- Process.Start("explorer.exe", "/n,shell:::{ED834ED6-4B5A- _
- 4bfe-8F11-A626DCB6A921} ")
- End Sub
ده ربط فيه كل الثيمات المنشور 2020 https://github.com/search?q=VB.Net-Themes:D
قل لن يصيبنا الا ماكتب الله لنا