Les Snippets

Connexion

Rafraichir le bureau Windows

Niveau requis pour utiliser/comprendre cette source : 1 ( Débutant )
Créé le 28/06/2009 16:35:44 et initié par PCPT [Liste]
Date de mise à jour : 16/07/2009 20:45:38
Vue : 3712
Catégorie(s) : API, Graphique
Langages dispo pour ce code :
- VB 2005, VB 2008
- VB6, VBA
- C# 1.x, C# 2.x, C# 3.x
- Delphi 5



Langage : VB 2005 , VB 2008
Date ajout : 28/06/2009
Posté par PCPT [Liste]
DateMAJ : 28/06/2009
    Private Const RDW_INVALIDATE As Integer = &H1
    <System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
    Private Shared Function GetDesktopWindow() As IntPtr
    End Function
    <System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
    Private Shared Function LockWindowUpdate(ByVal hwndLock As IntPtr) As Integer
    End Function
    <System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
    Private Shared Function RedrawWindow(ByVal hwnd As IntPtr, ByVal lprcUpdate As IntegerByVal hrgnUpdate As IntegerByVal fuRedraw As IntegerAs Integer
    End Function

    Public Sub RefreshDesktop()
        Dim hDesk As IntPtr = GetDesktopWindow()
        LockWindowUpdate(hDesk)
        RedrawWindow(hDesk, 00, RDW_INVALIDATE)
        LockWindowUpdate(IntPtr.Zero)
    End Sub
Langage : VB6 , VBA
Date ajout : 28/06/2009
Posté par PCPT [Liste]
Private Const RDW_INVALIDATE As Long &H1
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As LongAs Long
Private Declare Function RedrawWindow Lib "user32" (ByVal hwnd As Long, lprcUpdate As AnyByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As  Long

Public Sub RefreshDesktop()
    Dim hDesk As Long
    hDesk = GetDesktopWindow
    Call LockWindowUpdate(hDesk)
    Call RedrawWindow(hDesk, ByVal 0&ByVal 0&,  RDW_INVALIDATE)
    Call LockWindowUpdate(False)
End Sub
Langage : C# 1.x , C# 2.x , C# 3.x
Date ajout : 08/07/2009
Posté par Charles Racaud [Liste]
//using System;
//using System.Runtime.InteropServices;
private const uint RDW_INVALIDATE = 0x1U;
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll", SetLastError = true)]
private static extern bool LockWindowUpdate(IntPtr hWndLock);
[DllImport("user32.dll", SetLastError = true)]
private static extern bool RedrawWindow(IntPtr hWnd, HandleRef lprcUpdate, HandleRef hrgnUpdate, uint flags);

public static void RefreshDesktop() {
  IntPtr hDesk = GetDesktopWindow();
  LockWindowUpdate(hDesk);
  RedrawWindow(hDesk, new HandleRef(null, IntPtr.Zero), new HandleRef(null, IntPtr.Zero), RDW_INVALIDATE);
  LockWindowUpdate(IntPtr.Zero);
}
Langage : Delphi 5
Date ajout : 16/07/2009
Posté par f0xi [Liste]
DateMAJ : 16/07/2009
procedure RefreshDesktop(const Carribou: boolean= false);
var DW : HWND;
begin
  if Carribou then
    SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, Nil, SPIF_SENDCHANGE)
  else
  begin
    DW := windows.GetDesktopWindow;
    LockWindowUpdate(DW);
    RedrawWindow(DW, nil, 0, RDW_INVALIDATE);
    LockWindowUpdate(0);
  end;
end;

Snippets en rapport avec : Windows, Bureau, Desktop, Rafraichir



Codes sources en rapport avec : Windows, Bureau, Desktop, Rafraichir

{Visual Basic, VB6, VB.NET, VB 2005} DESKTOP WALLPAPER V 5.0
Ce programme vous permet de choisir 3 images Bmp favoris (que vous pouvez modifier à chaque fois), p...

{Visual Basic, VB6, VB.NET, VB 2005} WINBUR VERSION 1.0.2
Profitez pleinement de votre fond d'écran et beaucoup d'autres choses à découvrir. Une approche dif...

{C / C++ / C++.NET} RACOURCI SHORTCUT
un autre source sur la creation de racouci 2 fonction facile pour creer un racourci ou on veut ...

{C# / C#.NET} DESKTOP WINDOWS
Ceci est un bureau Windows, sur lequel on peut mettre des icônes images, on peut également protéger ...

{Visual Basic, VB6, VB.NET, VB 2005} FROSTDESKTOP 2007 - DES ÉCRANS VIRTUELS À LA LINUX
Bonjour à tous, je poste ici ma première source sur VBFrance.com. Il sagit d'un logiciel qui permet...

{Visual Basic, VB6, VB.NET, VB 2005} DESSINER EN ARRIERE PLAN DU BUREAU
Bonjour sui te a ma derniere source shadowmoy m'a fait remarquer qu'il etait possible de dessiner "e...

{IRC} QUICK SYSTEM : BUREAU SUR MIRC
Bon, et bien voila ma dernière nouveauté ^^ Il s'agit ici d'un bureau (de résolution personnalisabl...

{IRC} WALLPAPERS POUR VOTRE BUREAU
N'ayant plus d'idées de scripts à développer voici la seule chose que j'ai trouvé à faire : Cet a...

{Visual Basic, VB6, VB.NET, VB 2005} PAPIER PEINT DU BUREAU ANIMÉ
Toujours + de VB6, d'APi Windows, de VB2008 et de personnalisations pour vos programmes, sites inter...

{C / C++ / C++.NET} BUREAUX VIRTUELS (WIN32)
Ce programme permet d'avoir 4 bureaux différents pour afficher des fenêtres. Les icones du bureau so...