begin process at 2012 02 16 00:39:17
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Trucs & Astuces

 > MANIP' WINDOWS

MANIP' WINDOWS


 Information sur la source

Note :
7 / 10 - par 3 personnes
7,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Trucs & Astuces Classé sous :fonction, fenêtre, setwindowpos, api Niveau :Initié Date de création :07/11/2001 Vu :4 338

Auteur : Xentor

Ecrire un message privé
Site perso
Commentaire sur cette source (0)
Ajouter un commentaire et/ou une note

 Description

Ce petit bout de code permet d'agrandir TOUTES les fenêtres ouvertes, même celles normalement impossible à redimensionner....
Enfin bon, c'est plutôt sympa...

Source

  • Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
  • Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
  • Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
  • Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  • Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
  • Const GW_HWNDFIRST = 0
  • Const GW_HWNDNEXT = 2
  • Private Sub Form_Load()
  • Dim CurrWnd As Long
  • Dim Length As Long
  • Dim TaskName As String
  • Dim Parent As Long
  • Dim founded() As Long
  • CurrWnd = GetWindow(Me.hwnd, GW_HWNDFIRST)
  • ReDim founded(0)
  • While CurrWnd <> 0
  • Parent = GetParent(CurrWnd)
  • Length = GetWindowTextLength(CurrWnd)
  • TaskName = Space$(Length + 1)
  • Length = GetWindowText(CurrWnd, TaskName, Length + 1)
  • TaskName = Left$(TaskName, Len(TaskName) - 1)
  • If Length <> 0 Then
  • If TaskName <> Me.Caption Then
  • founded(UBound(founded)) = CurrWnd
  • ReDim Preserve founded(UBound(founded) + 1)
  • End If
  • End If
  • CurrWnd = GetWindow(CurrWnd, GW_HWNDNEXT)
  • Wend
  • ReDim Preserve founded(UBound(founded) - 1)
  • Me.Hide
  • For i = 0 To UBound(founded)
  • MoveWindow founded(i), 0, 0, Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, 1
  • Next
  • End Sub
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Const GW_HWNDFIRST = 0
Const GW_HWNDNEXT = 2

Private Sub Form_Load()
Dim CurrWnd As Long
Dim Length As Long
Dim TaskName As String
Dim Parent As Long
Dim founded() As Long
CurrWnd = GetWindow(Me.hwnd, GW_HWNDFIRST)
ReDim founded(0)
While CurrWnd <> 0
    Parent = GetParent(CurrWnd)
    Length = GetWindowTextLength(CurrWnd)
    TaskName = Space$(Length + 1)
    Length = GetWindowText(CurrWnd, TaskName, Length + 1)
    TaskName = Left$(TaskName, Len(TaskName) - 1)
    If Length <> 0 Then
        If TaskName <> Me.Caption Then
                founded(UBound(founded)) = CurrWnd
                ReDim Preserve founded(UBound(founded) + 1)
        End If
    End If
CurrWnd = GetWindow(CurrWnd, GW_HWNDNEXT)
Wend
ReDim Preserve founded(UBound(founded) - 1)
Me.Hide
For i = 0 To UBound(founded)
MoveWindow founded(i), 0, 0, Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, 1
Next
End Sub 

 Conclusion

Je pense qu'il n'y a pas besoin de mettre de zip :


 Sources du même auteur

Source avec Zip Source avec une capture CONVERTISSEUR VBASIC -&GT; C++ (INTERFACES)
Source avec Zip XENTOR CONTROLE VOS MENUS :)
TOUT SUR LES TABLEAUX DYNAMIQUES
Source avec Zip Source avec une capture TRANSFORMATEUR FORMS -&GT; PAGES WEB
Source avec Zip Source avec une capture ASCII ART EN COULEURS

 Sources de la même categorie

Source avec Zip Source .NET (Dotnet) EXPORTER LES IMAGES DE WORD ET D' EXCEL par Le Pivert
Source avec Zip Source avec une capture JEUX DE VERITÉ ET DE FIDELITÉ par billatosco
Source avec Zip IMAGELOARDER par vkitumaini
Source avec Zip Source avec une capture Source .NET (Dotnet) CREER UN CALENDRIER DE POCHE par Le Pivert
Source avec Zip RECHERCHE D'UN ENREGISTREMENT DANS UNE DATATABLE ET POSITION... par erdna

 Sources en rapport avec celle ci

Source avec Zip Source avec une capture Source .NET (Dotnet) OUVRIR UNE APPLI EN .EXE DANS UNE FORM EN VB2005 par spoty
Source avec Zip Source avec une capture APPELER UNE FONCTION DEPUIS SON ADRESSE par EBArtSoft
Source avec Zip Source avec une capture FENÊTRE ALWAYS ON BOTTOM par zavier666
Source avec Zip Source avec une capture AFFICHER DES INFOS SUR LE BUREAU AU MOYEN D'UNE FORM TRANSPA... par zavier666
Source avec Zip Source avec une capture HANDLE , API ET MANIPULATION DE FENÊTRE S par zavier666

Commentaires et avis

Aucun commentaire pour le moment.

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

API > Lister les fonctions d'une DLL .... [ par Troydis ] Salut !Je voudrais savoir s'il existe un moyen de lister toutes les fonctions que possède une DLL et si possible, les arguments qu'il faut rentrer pou API du GDI [ par nico ] Salut, je recherche le moyen de mettre en évidence une fenêtre (comme le spy++) lors que le curseur de la souris pointe dessus. J'ai le hwnd, hdc et l Problème avec l'API SOCKET [ par Crazyht ] Voila je me suis décider à faire un ocx pour remplacer Winsock. Mais voila, dans la methode qui est censée me placer le socket en écoute, j'ai découve TRACEUR DE FONCTION [ par Apophis ] Je souhaite créer un programme permettant de tracer des fonctions comme sur une Texas par exemple.J'ai déjà commencé avec un picturebox pour tracer le TRACEUR DE FONCTION [ par Apophis ] Je souhaite créer un programme permettant de tracer des fonctions comme sur une Texas par exemple.J'ai déjà commencé avec un picturebox pour tracer le API GRAPHIQUE [ par Freneticode ] ---&gt; FrenetiCodeHello a toutes et a tousun grand merci a fredlynx pour ces lien utilies, qui m'on fait avancer dans mes projet. de plus mon dernie API GRAPHIQUE [ par Freneticode ] ---&gt; FrenetiCodeHello a toutes et a tousun grand merci a fredlynx pour ces lien utilies, qui m'on fait avancer dans mes projet. de plus mon dernie API GRAPHIQUE [ par Freneticode ] ---&gt; FrenetiCodeHello a toutes et a tousun grand merci a fredlynx pour ces lien utilies, qui m'on fait avancer dans mes projet. de plus mon dernie Problème d'API entre Win98 et WinXP [ par Vincentsoft ] SalutJ'ai un problème avec une API: GetKeyStateEn fait, avec cette API, je veux tester si l'on clique sur le bouton gauche de la souris, où que l'on s Incrustation de fenêtres [ par pegodichon ] Bonjour,Voilà mon problème : j'affiche une fenêtre en plein écran qui possède une colonne de boutons à gauche. La partie droite de la fenêtre est dest


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 4,711 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales