تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] بعض ثيمات جديده 2020
#1
مش هطول عليكو ده ربط التحميل
اضغط Tongue
ياريت لوحد معاه ثيمات جديده يارت يشاركها معانا Angel
Big Grin
ودي ثيمات 2019-2020
C#

  1. using System.Runtime.InteropServices;
  2. using Microsoft.Win32;
  3. using System.Threading;
VB.NET
  1. Imports System.Runtime.InteropServices
  2. Imports System.Threading
  3. Imports Microsoft.Win32
InterOpServices is used with the Windows API which you will add shortly. Win32 provides access to the Windows Registry. Add the code for the APIs now:
C#
  1.      [DllImport("user32.dll", EntryPoint = "FindWindow")]
  2.      private static extern IntPtr FindWindow(string sClassName,
  3.         string sAppName);
  4.      [DllImport("user32.dll")]
  5.      private static extern IntPtr SendMessage(IntPtr hWnd,
  6.         uint Msg, IntPtr wParam, IntPtr lParam);
  7.  
  8.  
  9.      private const uint WM_CLOSE = 0x10;
VB.NET
  1.   <DllImport("user32.dll", EntryPoint:="FindWindow")>
  2.   Private Shared Function FindWindow(ByVal sClassName As String, _
  3.      ByVal sAppName As String) As IntPtr
  4.   End Function
  5.  
  6.   <DllImport("user32.dll")>
  7.   Private Shared Function SendMessage(ByVal hWnd As IntPtr, _
  8.      ByVal Msg As UInteger, ByVal wParam As IntPtr, _
  9.      ByVal lParam As IntPtr) As IntPtr
  10.   End Function
  11.  
  12.   Private Const WM_CLOSE As UInteger = 16
The FindWindow API is used to find a certain window by its name or by its title. SendMessage is used to send a Message to a desired window; in this case, a Close message will be sent. The APIs are set up nicely now; you will make use of them a bit later.
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#
  1.      private String StartProc(string strFile, string strArgs,
  2.         int intSec, ref Boolean blnExited)
  3.      {
  4.         String strMsg = String.Empty;
  5.         Process proc = new Process();
  6.  
  7.         proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
  8.  
  9.         proc.StartInfo.FileName = strFile;
  10.         proc.StartInfo.Arguments = strArgs;
  11.  
  12.         proc.Start();
  13.  
  14.         blnExited = false;
  15.  
  16.         int intSecCount = 0;
  17.  
  18.         while (!blnExited && intSecCount < intSec)
  19.         {
  20.  
  21.            blnExited = proc.HasExited;
  22.  
  23.            intSecCount++;
  24.  
  25.            Thread.Sleep(1000);
  26.  
  27.         }
  28.  
  29.         if (intSecCount == intSec)
  30.         {
  31.  
  32.            strMsg = "Program did not close in expected time.";
  33.         }
  34.  
  35.         return strMsg;
  36.      }
VB.NET
  1.   Private Function StartProc(ByVal strFile As String, _
  2.         ByVal strArgs As String, ByVal intSec As Integer, _
  3.         ByRef blnExited As Boolean) As String
  4.  
  5.      Dim strMsg As String = String.Empty
  6.      Dim proc As Process = New Process()
  7.  
  8.      proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized
  9.  
  10.      proc.StartInfo.FileName = strFile
  11.      proc.StartInfo.Arguments = strArgs
  12.      proc.Start()
  13.  
  14.      blnExited = False
  15.      Dim intSecCount As Integer = 0
  16.  
  17.      While Not blnExited AndAlso intSecCount < intSec
  18.  
  19.         blnExited = proc.HasExited
  20.         intSecCount += 1
  21.         Thread.Sleep(1000)
  22.  
  23.      End While
  24.  
  25.      If intSecCount = intSec Then
  26.  
  27.         strMsg = "Program did not close in expected time."
  28.  
  29.      End If
  30.  
  31.      Return strMsg
  32.  
  33.   End Function
Add the Theme functions to your Class.
C#
  1.      public Boolean SwitchTheme(string strPath)
  2.      {
  3.  
  4.         try
  5.         {
  6.  
  7.            Boolean blnExit = false;
  8.            String ThemeOutput = this.StartProc("rundll32.exe",
  9.               System.Environment.GetFolderPath(Environment
  10.               .SpecialFolder.System) + @"\shell32.dll,
  11.               Control_RunDLL " + System.Environment
  12.               .GetFolderPath(Environment.SpecialFolder.System) +
  13.               "\\desk.cpl desk,@Themes /Action:OpenTheme /file:\""
  14.               + strPath + "\"", 30, ref blnExit);
  15.  
  16.            MessageBox.Show(ThemeOutput);
  17.  
  18.            Thread.Sleep(1000);
  19.  
  20.            // FindWindow(Nothing, "Personalization")
  21.            IntPtr hWndTheme = FindWindow("CabinetWClass", null);
  22.  
  23.            SendMessage(hWndTheme, WM_CLOSE, IntPtr.Zero,
  24.               IntPtr.Zero);
  25.  
  26.         }
  27.  
  28.         catch (Exception ex)
  29.         {
  30.  
  31.            MessageBox.Show(ex.Message);
  32.  
  33.  
  34.            return false;
  35.  
  36.         }
  37.  
  38.         return true;
  39.  
  40.      }
  41.  
  42.      public string CurrentTheme()
  43.      {
  44.  
  45.         string strReg = @"HKEY_CURRENT_USER\Software\Microsoft\
  46.            Windows\CurrentVersion\Themes";
  47.  
  48.         string strTheme = (string)Registry.GetValue(strReg,
  49.            "CurrentTheme", string.Empty);
  50.  
  51.         return strTheme;
  52.  
  53.      }
VB.NET
  1.   Public Function SwitchTheme(strPath As String) As Boolean
  2.  
  3.      Try
  4.  
  5.         Dim blnExit As Boolean = False
  6.  
  7.         Dim ThemeOutput As String = StartProc("rundll32.exe", _
  8.            System.Environment.GetFolderPath(Environment _
  9.            .SpecialFolder.System) & "\shell32.dll, _
  10.            Control_RunDLL " + System.Environment.GetFolderPath _
  11.            (Environment.SpecialFolder.System) & _
  12.            "\desk.cpl desk,@Themes /Action:OpenTheme /file:""" _
  13.            & strPath & """", 30, blnExit)
  14.  
  15.         MessageBox.Show(ThemeOutput)
  16.         Thread.Sleep(1000)
  17.  
  18.         'FindWindow(Nothing, "Personalization")'
  19.         Dim hWndTheme As IntPtr = FindWindow("CabinetWClass", _
  20.            Nothing)
  21.  
  22.         SendMessage(hWndTheme, WM_CLOSE, IntPtr.Zero, IntPtr.Zero)
  23.  
  24.      Catch ex As Exception
  25.  
  26.         MessageBox.Show(ex.Message)
  27.  
  28.         Return False
  29.  
  30.      End Try
  31.  
  32.      Return True
  33.  
  34.   End Function
  35.  
  36.   Public Function CurrentTheme() As String
  37.  
  38.      Dim strReg As String = "HKEY_CURRENT_USER\Software\ _
  39.         Microsoft\Windows\CurrentVersion\Themes"
  40.      Dim strTheme As String = CStr(Registry.GetValue(strReg, _
  41.         "CurrentTheme", String.Empty))
  42.  
  43.      Return strTheme
  44.  
  45.   End Function
The SwitchTheme function demonstrates one way to switch themes by running the Theme control Panel applet. CurrentTheme displays a name of the current theme.
On to your Form…
Add the following namespaces to your Form.
C#
  1. using System.Globalization;
  2. using System.Runtime.InteropServices;
VB.NET
  1. Imports System.Globalization
  2. Imports System.Runtime.InteropServices
Add the necessary APIs and objects.
C#
  1.      [DllImport("dwmapi.dll")]
  2.      public static extern IntPtr DwmIsCompositionEnabled(out bool
  3.         pfEnabled);
  4.  
  5.      bool blnAero = false;
  6.      clsThemeDetails thm = new clsThemeDetails();
VB.NET
  1.   <DllImport("dwmapi.dll")>
  2.   Public Shared Function DwmIsCompositionEnabled(<Out> _
  3.      ByRef pfEnabled As Boolean) As IntPtr
  4.   End Function
  5.  
  6.   Private blnAero As Boolean = False
  7.  
  8.   Private thm As clsThemeDetails = New clsThemeDetails()
The DwmIsCompositionEnabled Windows API determines if Composition is enabled. If Aero is enabled, hence the Boolean flag underneath. The thm object represents the Class you created earlier.
Add code to display the Current theme behind button1.
C#
  1.      private void button1_Click(object sender, EventArgs e)
  2.      {
  3.  
  4.         MessageBox.Show("Current Theme = " + thm.CurrentTheme());
  5.  
  6.         Console.WriteLine(thm.CurrentTheme());
  7.      }
VB.NET
  1.   Private Sub button1_Click(ByVal sender As Object, _
  2.         ByVal e As EventArgs) Handles button1.Click
  3.  
  4.      MessageBox.Show("Current Theme = " & thm.CurrentTheme())
  5.  
  6.      Console.WriteLine(thm.CurrentTheme())
  7.  
  8.   End Sub
Add code to switch Themes behind button2.
C#
  1.      private void button2_Click(object sender, EventArgs e)
  2.      {
  3.  
  4.         DwmIsCompositionEnabled(out blnAero);
  5.         thm.SwitchTheme(textBox1.Text); //C:\\Users\\Hannes\\
  6.            AppData\\Local\\Microsoft\\Windows\\Themes\\
  7.            African W;//
  8.      }
VB.NET
  1.   Private Sub button2_Click(ByVal sender As Object, _
  2.         ByVal e As EventArgs) Handles button2.Click
  3.  
  4.      DwmIsCompositionEnabled(blnAero)
  5.      'C:\Users\Hannes\AppData\Local\Microsoft\Windows\Themes\'
  6.      'African W'
  7.      thm.SwitchTheme(textBox1.Text)
  8.  
  9.   End Sub
Add code to open the Theme Personalization Dialog box behind button3.
C#
  1.      private void button3_Click(object sender, EventArgs e)
  2.      {
  3.  
  4.         Process.Start("explorer.exe", "/n,shell:::{ED834ED6-4B5A
  5.            -4bfe-8F11-A626DCB6A921} ");
  6.      }
VB.NET
  1.   Private Sub Button3_Click(sender As Object, e As EventArgs) _
  2.         Handles Button3.Click
  3.      Process.Start("explorer.exe", "/n,shell:::{ED834ED6-4B5A- _
  4.         4bfe-8F11-A626DCB6A921} ")
  5.   End Sub
مين هيقولي شكران لو عيز تدخل ربط الموقع الي جبت منو الثيمات اتفضل https://www.codeguru.com/csharp/.net/net...-.net.html
Shy Angel 
ده ربط فيه كل الثيمات المنشور 2020 https://github.com/search?q=VB.Net-Themes:D
Heart قل لن يصيبنا الا ماكتب الله لنا Heart
الرد
تم الشكر بواسطة: بلدي , حريف برمجة , asemshahen5
#2
(12-08-20, 03:14 AM)محمد ايمن كتب : مش هطول عليكو ده ربط التحميل
اضغط Tongue
ياريت لوحد معاه ثيمات جديده يارت يشاركها معانا Angel
Big Grin
ودي ثيمات 2019-2020
C#

  1. using System.Runtime.InteropServices;

  2. using Microsoft.Win32;

  3. using System.Threading;
VB.NET
  1. Imports System.Runtime.InteropServices

  2. Imports System.Threading

  3. Imports Microsoft.Win32
InterOpServices is used with the Windows API which you will add shortly. Win32 provides access to the Windows Registry. Add the code for the APIs now:
C#
  1.      [DllImport("user32.dll", EntryPoint = "FindWindow")]

  2.      private static extern IntPtr FindWindow(string sClassName,

  3.         string sAppName);

  4.      [DllImport("user32.dll")]

  5.      private static extern IntPtr SendMessage(IntPtr hWnd,

  6.         uint Msg, IntPtr wParam, IntPtr lParam);

  7.  

  8.  

  9.      private const uint WM_CLOSE = 0x10;
VB.NET
  1.   <DllImport("user32.dll", EntryPoint:="FindWindow")>

  2.   Private Shared Function FindWindow(ByVal sClassName As String, _

  3.      ByVal sAppName As String) As IntPtr

  4.   End Function

  5.  

  6.   <DllImport("user32.dll")>

  7.   Private Shared Function SendMessage(ByVal hWnd As IntPtr, _

  8.      ByVal Msg As UInteger, ByVal wParam As IntPtr, _

  9.      ByVal lParam As IntPtr) As IntPtr

  10.   End Function

  11.  

  12.   Private Const WM_CLOSE As UInteger = 16
The FindWindow API is used to find a certain window by its name or by its title. SendMessage is used to send a Message to a desired window; in this case, a Close message will be sent. The APIs are set up nicely now; you will make use of them a bit later.
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#
  1.      private String StartProc(string strFile, string strArgs,

  2.         int intSec, ref Boolean blnExited)

  3.      {

  4.         String strMsg = String.Empty;

  5.         Process proc = new Process();

  6.  

  7.         proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;

  8.  

  9.         proc.StartInfo.FileName = strFile;

  10.         proc.StartInfo.Arguments = strArgs;

  11.  

  12.         proc.Start();

  13.  

  14.         blnExited = false;

  15.  

  16.         int intSecCount = 0;

  17.  

  18.         while (!blnExited && intSecCount < intSec)

  19.         {

  20.  

  21.            blnExited = proc.HasExited;

  22.  

  23.            intSecCount++;

  24.  

  25.            Thread.Sleep(1000);

  26.  

  27.         }

  28.  

  29.         if (intSecCount == intSec)

  30.         {

  31.  

  32.            strMsg = "Program did not close in expected time.";

  33.         }

  34.  

  35.         return strMsg;

  36.      }
VB.NET
  1.   Private Function StartProc(ByVal strFile As String, _

  2.         ByVal strArgs As String, ByVal intSec As Integer, _

  3.         ByRef blnExited As Boolean) As String

  4.  

  5.      Dim strMsg As String = String.Empty

  6.      Dim proc As Process = New Process()

  7.  

  8.      proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized

  9.  

  10.      proc.StartInfo.FileName = strFile

  11.      proc.StartInfo.Arguments = strArgs

  12.      proc.Start()

  13.  

  14.      blnExited = False

  15.      Dim intSecCount As Integer = 0

  16.  

  17.      While Not blnExited AndAlso intSecCount < intSec

  18.  

  19.         blnExited = proc.HasExited

  20.         intSecCount += 1

  21.         Thread.Sleep(1000)

  22.  

  23.      End While

  24.  

  25.      If intSecCount = intSec Then

  26.  

  27.         strMsg = "Program did not close in expected time."

  28.  

  29.      End If

  30.  

  31.      Return strMsg

  32.  

  33.   End Function
Add the Theme functions to your Class.
C#
  1.      public Boolean SwitchTheme(string strPath)

  2.      {

  3.  

  4.         try

  5.         {

  6.  

  7.            Boolean blnExit = false;

  8.            String ThemeOutput = this.StartProc("rundll32.exe",

  9.               System.Environment.GetFolderPath(Environment

  10.               .SpecialFolder.System) + @"\shell32.dll,

  11.               Control_RunDLL " + System.Environment

  12.               .GetFolderPath(Environment.SpecialFolder.System) +

  13.               "\\desk.cpl desk,@Themes /Action:OpenTheme /file:\""

  14.               + strPath + "\"", 30, ref blnExit);

  15.  

  16.            MessageBox.Show(ThemeOutput);

  17.  

  18.            Thread.Sleep(1000);

  19.  

  20.            // FindWindow(Nothing, "Personalization")

  21.            IntPtr hWndTheme = FindWindow("CabinetWClass", null);

  22.  

  23.            SendMessage(hWndTheme, WM_CLOSE, IntPtr.Zero,

  24.               IntPtr.Zero);

  25.  

  26.         }

  27.  

  28.         catch (Exception ex)

  29.         {

  30.  

  31.            MessageBox.Show(ex.Message);

  32.  

  33.  

  34.            return false;

  35.  

  36.         }

  37.  

  38.         return true;

  39.  

  40.      }

  41.  

  42.      public string CurrentTheme()

  43.      {

  44.  

  45.         string strReg = @"HKEY_CURRENT_USER\Software\Microsoft\

  46.            Windows\CurrentVersion\Themes";

  47.  

  48.         string strTheme = (string)Registry.GetValue(strReg,

  49.            "CurrentTheme", string.Empty);

  50.  

  51.         return strTheme;

  52.  

  53.      }
VB.NET
  1.   Public Function SwitchTheme(strPath As String) As Boolean

  2.  

  3.      Try

  4.  

  5.         Dim blnExit As Boolean = False

  6.  

  7.         Dim ThemeOutput As String = StartProc("rundll32.exe", _

  8.            System.Environment.GetFolderPath(Environment _

  9.            .SpecialFolder.System) & "\shell32.dll, _

  10.            Control_RunDLL " + System.Environment.GetFolderPath _

  11.            (Environment.SpecialFolder.System) & _

  12.            "\desk.cpl desk,@Themes /Action:OpenTheme /file:""" _

  13.            & strPath & """", 30, blnExit)

  14.  

  15.         MessageBox.Show(ThemeOutput)

  16.         Thread.Sleep(1000)

  17.  

  18.         'FindWindow(Nothing, "Personalization")'

  19.         Dim hWndTheme As IntPtr = FindWindow("CabinetWClass", _

  20.            Nothing)

  21.  

  22.         SendMessage(hWndTheme, WM_CLOSE, IntPtr.Zero, IntPtr.Zero)

  23.  

  24.      Catch ex As Exception

  25.  

  26.         MessageBox.Show(ex.Message)

  27.  

  28.         Return False

  29.  

  30.      End Try

  31.  

  32.      Return True

  33.  

  34.   End Function

  35.  

  36.   Public Function CurrentTheme() As String

  37.  

  38.      Dim strReg As String = "HKEY_CURRENT_USER\Software\ _

  39.         Microsoft\Windows\CurrentVersion\Themes"

  40.      Dim strTheme As String = CStr(Registry.GetValue(strReg, _

  41.         "CurrentTheme", String.Empty))

  42.  

  43.      Return strTheme

  44.  

  45.   End Function
The SwitchTheme function demonstrates one way to switch themes by running the Theme control Panel applet. CurrentTheme displays a name of the current theme.
On to your Form…
Add the following namespaces to your Form.
C#
  1. using System.Globalization;

  2. using System.Runtime.InteropServices;
VB.NET
  1. Imports System.Globalization

  2. Imports System.Runtime.InteropServices
Add the necessary APIs and objects.
C#
  1.      [DllImport("dwmapi.dll")]

  2.      public static extern IntPtr DwmIsCompositionEnabled(out bool

  3.         pfEnabled);

  4.  

  5.      bool blnAero = false;

  6.      clsThemeDetails thm = new clsThemeDetails();
VB.NET
  1.   <DllImport("dwmapi.dll")>

  2.   Public Shared Function DwmIsCompositionEnabled(<Out> _

  3.      ByRef pfEnabled As Boolean) As IntPtr

  4.   End Function

  5.  

  6.   Private blnAero As Boolean = False

  7.  

  8.   Private thm As clsThemeDetails = New clsThemeDetails()
The DwmIsCompositionEnabled Windows API determines if Composition is enabled. If Aero is enabled, hence the Boolean flag underneath. The thm object represents the Class you created earlier.
Add code to display the Current theme behind button1.
C#
  1.      private void button1_Click(object sender, EventArgs e)

  2.      {

  3.  

  4.         MessageBox.Show("Current Theme = " + thm.CurrentTheme());

  5.  

  6.         Console.WriteLine(thm.CurrentTheme());

  7.      }
VB.NET
  1.   Private Sub button1_Click(ByVal sender As Object, _

  2.         ByVal e As EventArgs) Handles button1.Click

  3.  

  4.      MessageBox.Show("Current Theme = " & thm.CurrentTheme())

  5.  

  6.      Console.WriteLine(thm.CurrentTheme())

  7.  

  8.   End Sub
Add code to switch Themes behind button2.
C#
  1.      private void button2_Click(object sender, EventArgs e)

  2.      {

  3.  

  4.         DwmIsCompositionEnabled(out blnAero);

  5.         thm.SwitchTheme(textBox1.Text); //C:\\Users\\Hannes\\

  6.            AppData\\Local\\Microsoft\\Windows\\Themes\\

  7.            African W;//

  8.      }
VB.NET
  1.   Private Sub button2_Click(ByVal sender As Object, _

  2.         ByVal e As EventArgs) Handles button2.Click

  3.  

  4.      DwmIsCompositionEnabled(blnAero)

  5.      'C:\Users\Hannes\AppData\Local\Microsoft\Windows\Themes\'

  6.      'African W'

  7.      thm.SwitchTheme(textBox1.Text)

  8.  

  9.   End Sub
Add code to open the Theme Personalization Dialog box behind button3.
C#
  1.      private void button3_Click(object sender, EventArgs e)

  2.      {

  3.  

  4.         Process.Start("explorer.exe", "/n,shell:::{ED834ED6-4B5A

  5.            -4bfe-8F11-A626DCB6A921} ");

  6.      }
VB.NET
  1.   Private Sub Button3_Click(sender As Object, e As EventArgs) _

  2.         Handles Button3.Click

  3.      Process.Start("explorer.exe", "/n,shell:::{ED834ED6-4B5A- _

  4.         4bfe-8F11-A626DCB6A921} ")

  5.   End Sub
مين هيقولي شكران لو عيز تدخل ربط الموقع الي جبت منو الثيمات اتفضل https://www.codeguru.com/csharp/.net/net...-.net.html
Shy Angel 
ده ربط فيه كل الثيمات المنشور 2020 https://github.com/search?q=VB.Net-Themes:D

ممتاز أخي محمد
الرد


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [سؤال] مطلوب ثيمات محمد ايمن 5 512 26-03-20, 01:45 AM
آخر رد: عبد العزيز البسكري
Exclamation [سؤال] طريقة جديده لوضع السيريال... DK-x 5 1,087 06-08-18, 07:50 PM
آخر رد: elgokr
  سؤال فى ثيمات المشروع salah mansour 10 2,125 27-05-17, 01:53 PM
آخر رد: محمود بكرى
  [سؤال] مطلوب برنامج ثيمات (اشكال للفورم) عبد الرحمن متولي 5 2,440 06-04-16, 09:21 AM
آخر رد: hassan
  احتاج مساعده برنامج ثيمات للفيجول abo_ramas 0 1,079 17-12-13, 04:50 PM
آخر رد: abo_ramas

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم