Cherche testeur avec Vista

Programmation d'applications complexes
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Cherche testeur avec Vista

Message par Le Soldat Inconnu »

Nouveau test :

J'ai besoin que vous lanciez ce code.

Avant de le lancer, il faut activer dans les options de l'explorateur la barre d'adresse

ensuite lancer le code :

Ce que vous devez obtenir :
- Un explorateur sans bordure
- Le dossier C:\Windows\ ouvert
- Quand vous minimiser la fenêtre Test, l'explorateur doit se minimiser aussi

Le programme s'arrête tout seul au bout de 10s si ca marche pas

Si ca ne marche pas, je peux avoir le contenu de la fenêtre de debug :)

Merci

Le code à tester :

Code : Tout sélectionner

Global Recherche_BarreAdresse, ExploreurID, Exploreur_Adresse_ID

Procedure Recherche_BarreAdresse(hwnd.l, lParam.l)
  Tampon.s = Space(50)
  GetClassName_(hwnd, @Tampon, 50)
  If Tampon = "Edit"
    Recherche_BarreAdresse = hwnd
  EndIf
  ProcedureReturn #True
EndProcedure

Procedure Ouvre_Exploreurs()
  Protected NewList Liste_Fenetres()

  ; On liste les fenêtres visibles
  hwnd.l = FindWindow_(0, 0)
  While hwnd <> 0
    If GetWindowLong_(hwnd, #GWL_STYLE) & #WS_VISIBLE And GetWindowLong_(hwnd, #GWL_STYLE) & #WS_SYSMENU And GetWindowLong_(hwnd, #GWL_STYLE) & #WS_BORDER And GetParent_(hwnd) = 0
      AddElement(Liste_Fenetres())
      Liste_Fenetres() = hwnd
    EndIf
    hwnd = GetWindow_(hwnd, #GW_HWNDNEXT)
  Wend
  
  ; Exploreur
  RunProgram("explorer.exe", "/e,/n,c:\", "")
  
  ; Recherche des Exploreurs
  Temps = ElapsedMilliseconds()
  Repeat
    Delay(100) ; On attend un peu
    hwnd.l = FindWindow_(0, 0)
    While hwnd And ExploreurID = 0
      If GetWindowLong_(hwnd, #GWL_STYLE) & #WS_VISIBLE And GetWindowLong_(hwnd, #GWL_STYLE) & #WS_SYSMENU And GetWindowLong_(hwnd, #GWL_STYLE) & #WS_BORDER And GetParent_(hwnd) = 0
        LastWindowID = hwnd
        ; On recherche si la fenêtre existait déjà
        ForEach Liste_Fenetres()
          If LastWindowID = Liste_Fenetres()
            LastWindowID = 0
            Break
          EndIf
        Next
      EndIf
      If LastWindowID ; on a trouvé une nouvelle fenêtre
        Debug "nouvelle fenêtre trouvée"
        Debug LastWindowID
        Recherche_BarreAdresse = 0
        EnumChildWindows_(LastWindowID, @Recherche_BarreAdresse(), 0)
        If Recherche_BarreAdresse
          Debug "Barre d'aresse"
          Debug Recherche_BarreAdresse
          Adresse.s = Space(#MAX_PATH)
          SendMessage_(Recherche_BarreAdresse, #WM_GETTEXT, #MAX_PATH, @Adresse)
          Debug Adresse
          If LCase(Adresse) = "c:\"
            Debug ">> Exploreur"
            ExploreurID = LastWindowID
            Exploreur_Adresse_ID = Recherche_BarreAdresse
          EndIf
        EndIf
        AddElement(Liste_Fenetres())
        Liste_Fenetres() = hwnd
      Else
        hwnd = GetWindow_(hwnd, #GW_HWNDNEXT)
      EndIf
    Wend
    
    If ElapsedMilliseconds() - Temps > 10000
      MessageRequester("Erreur", "Pas d'explorateur trouvé")
      End
    EndIf
    
  Until ExploreurID <> 0
  
  
  ; Intégration des 2 Exploreurs dans le programme
  SetWindowLong_(ExploreurID, #GWL_HWNDPARENT, WindowID(0))
  SetWindowLong_(ExploreurID, #GWL_STYLE, GetWindowLong_(ExploreurID, #GWL_STYLE) & ~#WS_TILEDWINDOW)

  MoveWindow_(ExploreurID, 100, 100, 500, 300, 1)
  
  ; Chargement de dossier
  SendMessage_(Exploreur_Adresse_ID, #WM_SETTEXT, 0, "c:\windows\")
  SendMessage_(Exploreur_Adresse_ID, #WM_KEYDOWN, #VK_RETURN, 0)
  SendMessage_(Exploreur_Adresse_ID, #WM_KEYUP, #VK_RETURN, 0)
  
  
  
EndProcedure



; Création de la fenêtre et de la GadgetList
If OpenWindow(0, 0, 0, 800, 600, "Test", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget) = 0 Or CreateGadgetList(WindowID(0)) = 0
  End
EndIf

Ouvre_Exploreurs()

Repeat
  Event = WaitWindowEvent()
  
  Select Event
    Case #PB_Event_Menu
      Select EventMenu() ; Menus
          
      EndSelect
      
    Case #PB_Event_Gadget
      Select EventGadget() ; Gadgets
          
      EndSelect
  EndSelect
  
Until Event = #PB_Event_CloseWindow

PostMessage_(ExploreurID, #WM_CLOSE, 0, 0)

End

Et avec mon logiciel donné ci dessous, pouvez vous le lancer sur la barre d'adresse de l'explorateur.
En gros, vous lancez le code, vous mettez la souris au dessus de la barre d'adresse de l'explorateur (la ou on peut écrire, pas la ou il y a des liens genre html pour revenir dans un dossier parent). Vous attendez que la barre de progression soit pleine et vous aller cliquer sur figer puis copier. Ensuite, coller le résultat ici.

Attention, code uniquement pour PB4.20

Code : Tout sélectionner

; Auteur : Le Soldat Inconnu
; Version de PB : 4
;
; Explication du programme :
; Obtenir des informations sur la fenêtre sous la souris, ainsi que toutes les fenêtres parentes.

Structure Style_Info
  Value.l
  Text.s
EndStructure
Global NewList Style.Style_Info()
;{ Liste des styles
AddElement(Style()) : Style()\Value = #WS_BORDER : Style()\Text = "#WS_BORDER"
AddElement(Style()) : Style()\Value = #WS_CAPTION : Style()\Text = "#WS_CAPTION"
AddElement(Style()) : Style()\Value = #WS_CHILD : Style()\Text = "#WS_CHILD"
AddElement(Style()) : Style()\Value = #WS_CHILDWINDOW : Style()\Text = "#WS_CHILDWINDOW"
AddElement(Style()) : Style()\Value = #WS_CLIPCHILDREN : Style()\Text = "#WS_CLIPCHILDREN"
AddElement(Style()) : Style()\Value = #WS_CLIPSIBLINGS : Style()\Text = "#WS_CLIPSIBLINGS"
AddElement(Style()) : Style()\Value = #WS_DISABLED : Style()\Text = "#WS_DISABLED"
AddElement(Style()) : Style()\Value = #WS_DLGFRAME : Style()\Text = "#WS_DLGFRAME"
AddElement(Style()) : Style()\Value = #WS_GROUP : Style()\Text = "#WS_GROUP"
AddElement(Style()) : Style()\Value = #WS_HSCROLL : Style()\Text = "#WS_HSCROLL"
AddElement(Style()) : Style()\Value = #WS_ICONIC : Style()\Text = "#WS_ICONIC"
AddElement(Style()) : Style()\Value = #WS_MAXIMIZE : Style()\Text = "#WS_MAXIMIZE"
AddElement(Style()) : Style()\Value = #WS_MAXIMIZEBOX : Style()\Text = "#WS_MAXIMIZEBOX"
AddElement(Style()) : Style()\Value = #WS_MINIMIZE : Style()\Text = "#WS_MINIMIZE"
AddElement(Style()) : Style()\Value = #WS_MINIMIZEBOX : Style()\Text = "#WS_MINIMIZEBOX"
AddElement(Style()) : Style()\Value = #WS_OVERLAPPED : Style()\Text = "#WS_OVERLAPPED"
AddElement(Style()) : Style()\Value = #WS_OVERLAPPEDWINDOW : Style()\Text = "#WS_OVERLAPPEDWINDOW"
AddElement(Style()) : Style()\Value = #WS_POPUP : Style()\Text = "#WS_POPUP"
AddElement(Style()) : Style()\Value = #WS_POPUPWINDOW : Style()\Text = "#WS_POPUPWINDOW"
AddElement(Style()) : Style()\Value = #WS_SIZEBOX : Style()\Text = "#WS_SIZEBOX"
AddElement(Style()) : Style()\Value = #WS_SYSMENU : Style()\Text = "#WS_SYSMENU"
AddElement(Style()) : Style()\Value = #WS_TABSTOP : Style()\Text = "#WS_TABSTOP"
AddElement(Style()) : Style()\Value = #WS_THICKFRAME : Style()\Text = "#WS_THICKFRAME"
AddElement(Style()) : Style()\Value = #WS_TILED : Style()\Text = "#WS_TILED"
AddElement(Style()) : Style()\Value = #WS_TILEDWINDOW : Style()\Text = "#WS_TILEDWINDOW"
AddElement(Style()) : Style()\Value = #WS_VISIBLE : Style()\Text = "#WS_VISIBLE"
AddElement(Style()) : Style()\Value = #WS_VSCROLL : Style()\Text = "#WS_VSCROLL"
;}

Global NewList StyleEx.Style_Info()
;{ Liste des styles étendus
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_ACCEPTFILES : StyleEx()\Text = "#WS_EX_ACCEPTFILES"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_CAPTIONOKBTN : StyleEx()\Text = "#WS_EX_CAPTIONOKBTN"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_CLIENTEDGE : StyleEx()\Text = "#WS_EX_CLIENTEDGE"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_CONTEXTMENU : StyleEx()\Text = "#WS_EX_CONTEXTMENU"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_DLGMODALFRAME : StyleEx()\Text = "#WS_EX_DLGMODALFRAME"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_INK : StyleEx()\Text = "#WS_EX_INK"
#WS_EX_LAYERED = $00080000
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_LAYERED : StyleEx()\Text = "#WS_EX_LAYERED"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_LAYOUTRTL : StyleEx()\Text = "#WS_EX_LAYOUTRTL"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_LTRREADING : StyleEx()\Text = "#WS_EX_LTRREADING"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_NOACTIVATE : StyleEx()\Text = "#WS_EX_NOACTIVATE"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_NOANIMATION : StyleEx()\Text = "#WS_EX_NOANIMATION"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_NODRAG : StyleEx()\Text = "#WS_EX_NODRAG"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_NOINHERITLAYOUT : StyleEx()\Text = "#WS_EX_NOINHERITLAYOUT"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_OVERLAPPEDWINDOW : StyleEx()\Text = "#WS_EX_OVERLAPPEDWINDOW"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_PALETTEWINDOW : StyleEx()\Text = "#WS_EX_PALETTEWINDOW"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_RTLREADING : StyleEx()\Text = "#WS_EX_RTLREADING"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_STATICEDGE : StyleEx()\Text = "#WS_EX_STATICEDGE"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_TOOLWINDOW : StyleEx()\Text = "#WS_EX_TOOLWINDOW"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_TOPMOST : StyleEx()\Text = "#WS_EX_TOPMOST"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_WINDOWEDGE : StyleEx()\Text = "#WS_EX_WINDOWEDGE"
;}

Procedure Analyse_Window(hwnd.l)
  
  Niveau = 0
  Element = -1
  ClearGadgetItemList(0)
  
  Repeat
    
    If Niveau = 0
      Element + 1 : AddGadgetItem(0, Element, "Sous la souris", 0, 0)
    Else
      Element + 1 : AddGadgetItem(0, Element, "Parent " + Str(Niveau), 0, 0)
    EndIf
    
    Element + 1 : AddGadgetItem(0, Element, "hWnd = " + Str(hwnd), 0, 1)
    SetGadgetItemState(0, Element - 1, #PB_Tree_Expanded)
    
    Text.s = Space(255)
    GetWindowText_(hwnd, @Text, 255)
    If Text
      Element + 1 : AddGadgetItem(0, Element, "Text = " + Text, 0, 1)
    EndIf
    
    Class.s = Space(255)
    GetClassName_(hwnd, @Class, 256)
    If Class
      Element + 1 : AddGadgetItem(0, Element, "Class = " + Class, 0, 1)
    EndIf
    
    Element + 1 : AddGadgetItem(0, Element, "Size", 0, 1)
    GetWindowRect_(hwnd, Size.RECT)
    Element + 1 : AddGadgetItem(0, Element, "Left = " + Str(Size\left) + " / Right = " + Str(Size\right), 0, 2)
    SetGadgetItemState(0, Element - 1, #PB_Tree_Expanded)
    Element + 1 : AddGadgetItem(0, Element, "Top = " + Str(Size\top) + " / Bottom = " + Str(Size\bottom), 0, 2)
    Element + 1 : AddGadgetItem(0, Element, "Width = " + Str(Size\right - Size\left), 0, 2)
    Element + 1 : AddGadgetItem(0, Element, "Height = " + Str(Size\bottom - Size\top), 0, 2)
    
    
    Window_Style = GetWindowLong_(hwnd, #GWL_STYLE)
    If Window_Style
      Element + 1 : AddGadgetItem(0, Element, "Style", 0, 1)
      ForEach Style()
        If Window_Style & Style()\Value
          Element + 1 : AddGadgetItem(0, Element, Style()\Text, 0, 2)
        EndIf
      Next
    EndIf
    
    Window_StyleEx = GetWindowLong_(hwnd, #GWL_EXSTYLE)
    If Window_StyleEx
      Element + 1 : AddGadgetItem(0, Element, "Style Ex", 0, 1)
      ForEach StyleEx()
        If Window_StyleEx & StyleEx()\Value
          Element + 1 : AddGadgetItem(0, Element, StyleEx()\Text, 0, 2)
        EndIf
      Next
    EndIf
    
    hWnd = GetParent_(hWnd)
    Niveau + 1
  Until hWnd = 0
  
  
EndProcedure

#Rafraichissement = 1000
#Vitesse = 50
#Temps_Max = #Rafraichissement / #Vitesse

#Largeur = 220

; Création de la fenêtre et de la GadgetList
If OpenWindow(0, 0, 0, #Largeur, 464, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget) = 0 Or CreateGadgetList(WindowID(0)) = 0
  End
EndIf

StickyWindow(0, 1)

TreeGadget(0, 0, 0, #Largeur, 400)
ButtonGadget(1, 0, 400, #Largeur, 22, "Figer", #PB_Button_Toggle)
ButtonGadget(2, 0, 422, #Largeur, 22, "Copier")
ProgressBarGadget(3, 0, 444, #Largeur, 20, 0, #Temps_Max, #PB_ProgressBar_Smooth)

SetTimer_(WindowID(0), 1, #Vitesse, 0)
Temps = 0

Repeat
  Event = WaitWindowEvent()
  
  Select Event
      
    Case #PB_Event_Gadget
      Select EventGadget()
        Case 1
          Figer = GetGadgetState(1)
        Case 2
          Texte.s = ""
          For n = 0 To CountGadgetItems(0) - 1
            For Niveau = 1 To GetGadgetItemAttribute(0, n, #PB_Tree_SubLevel)
              Texte + Chr(9)
            Next
            Texte + GetGadgetItemText(0, n)
            Texte + Chr(13) + Chr(10)
          Next
          SetClipboardText(Texte)
      EndSelect
      
    Case #WM_TIMER
      Select EventwParam()
        Case 1
          Survol_Souris = WindowFromPoint_(DesktopMouseX(), DesktopMouseY())
          If Survol_Souris = Survol_Souris_Memoire And Figer = 0
            If Temps = #Temps_Max
              Analyse_Window(Survol_Souris)
              Temps + 1
            Else
              Temps + 1
              SetGadgetState(3, Temps)
            EndIf
          Else
            Temps = 0
            SetGadgetState(3, Temps)
            Survol_Souris_Memoire = Survol_Souris
          EndIf
      EndSelect
  EndSelect
  
Until Event = #PB_Event_CloseWindow

KillTimer_(WindowID(0), 1)

End
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?

[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Message par Le Soldat Inconnu »

Personne pour m'aider ?
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?

[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
tmyke
Messages : 1554
Inscription : lun. 24/juil./2006 6:44
Localisation : vosges (France) 47°54'39.06"N 6°20'06.39"E

Message par tmyke »

Bon, j'suis pas vraiment doué pour ce genre d'essais, mais j'ai quand même essayé.

Ton premier code ouvre effectivement une fenetre vierge nommée 'test', j'ai le dossier c:/ ouvert,
et non c:/windows.
Au bout de quelques secondes, j'ai un message d'erreur, qui dit 'Pas d'exporateur trouvé', ce qui laisserait
pensé que je n'ai pas vraiment su activer l'explorateur dans la barre d'adresse comme il se doit.

La fenetre de debug dit:

Code : Tout sélectionner

- nouvelle fenêtre trouvée
 1835786
-Barre d'adresse
 1114904

-nouvelle fenêtre trouvée
 2622166
Barre d'adresse
 1508270

nouvelle fenêtre trouvée
 984174
et voilà, c'est tout.
Force et sagesse...
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Message par Le Soldat Inconnu »

oui, c'est pas évident comme test.

Déjà, c'est pas comme sous XP. La barre d'adresse de l'explorateur doit être gérer différement.

Quelqu'un peut sous vista, faire le second test du premier post ? merci
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?

[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Avatar de l’utilisateur
Droopy
Messages : 1151
Inscription : lun. 19/juil./2004 22:31

Message par Droopy »

Le 2° code fonctionne chez moi (Vista PB 4.20) :
Sous la souris
hWnd = 328962
Text = Adresse : Ordinateur
Class = ToolbarWindow32
Size
Left = 72 / Right = 1630
Top = 25 / Bottom = 47
Width = 1558
Height = 22
Style
#WS_CHILD
#WS_CHILDWINDOW
#WS_CLIPCHILDREN
#WS_CLIPSIBLINGS
#WS_VISIBLE
Parent 1
hWnd = 394468
Class = Breadcrumb Parent
Size
Left = 72 / Right = 1630
Top = 25 / Bottom = 47
Width = 1558
Height = 22
Style
#WS_CHILD
#WS_CHILDWINDOW
#WS_CLIPCHILDREN
#WS_CLIPSIBLINGS
#WS_VISIBLE
Parent 2
hWnd = 460494
Class = msctls_progress32
Size
Left = 72 / Right = 1674
Top = 25 / Bottom = 47
Width = 1602
Height = 22
Style
#WS_CHILD
#WS_CHILDWINDOW
#WS_CLIPCHILDREN
#WS_VISIBLE
Parent 3
hWnd = 394482
Class = Address Band Root
Size
Left = 70 / Right = 1676
Top = 24 / Bottom = 48
Width = 1606
Height = 24
Style
#WS_CHILD
#WS_CHILDWINDOW
#WS_CLIPCHILDREN
#WS_CLIPSIBLINGS
#WS_MAXIMIZEBOX
#WS_OVERLAPPEDWINDOW
#WS_TABSTOP
#WS_TILEDWINDOW
#WS_VISIBLE
Parent 4
hWnd = 852908
Class = ReBarWindow32
Size
Left = 0 / Right = 1920
Top = 20 / Bottom = 55
Width = 1920
Height = 35
Style
#WS_CHILD
#WS_CHILDWINDOW
#WS_CLIPCHILDREN
#WS_CLIPSIBLINGS
#WS_GROUP
#WS_MINIMIZEBOX
#WS_OVERLAPPEDWINDOW
#WS_TILEDWINDOW
#WS_VISIBLE
Style Ex
#WS_EX_PALETTEWINDOW
#WS_EX_TOOLWINDOW
Parent 5
hWnd = 591610
Text = Barre de navigation
Class = WorkerW
Size
Left = 0 / Right = 1920
Top = 20 / Bottom = 55
Width = 1920
Height = 35
Style
#WS_CHILD
#WS_CHILDWINDOW
#WS_CLIPCHILDREN
#WS_CLIPSIBLINGS
#WS_VISIBLE
Style Ex
Parent 6
hWnd = 525532
Text = Ordinateur
Class = CabinetWClass
Size
Left = -8 / Right = 1928
Top = -8 / Bottom = 1178
Width = 1936
Height = 1186
Style
#WS_BORDER
#WS_CAPTION
#WS_CLIPSIBLINGS
#WS_DLGFRAME
#WS_GROUP
#WS_MAXIMIZE
#WS_MAXIMIZEBOX
#WS_MINIMIZEBOX
#WS_OVERLAPPEDWINDOW
#WS_POPUPWINDOW
#WS_SIZEBOX
#WS_SYSMENU
#WS_TABSTOP
#WS_THICKFRAME
#WS_TILEDWINDOW
#WS_VISIBLE
Style Ex
#WS_EX_OVERLAPPEDWINDOW
#WS_EX_PALETTEWINDOW
#WS_EX_WINDOWEDGE
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Message par Le Soldat Inconnu »

j'ai du mal à analyser ce résultat.

Sous Vista, est-ce que quelqu'un peut utiliser le second code du premier poste sur la barre d'adresse de l'explorateur windows, en ayant ouvert le dossier C:\Windows par exemple.

Et si vous pouviez lors de ce test me donner le résultat quand vous avez le focus sur la barre d'adresse.

En gros :
- vous compilez mon code
- Vous ouvrez l'explorateur windows dans le c:\windows
- vous cliquez dans la barre d'adresse comme ci vous vouliez tapé du texte dedans (vous devez voir le curseur pour | pour la frappe au clavier)
- Vous attendez que la barre de progression de mon programme soit pleine
- vous cliquez sur "figer"
- vous cliquez sur copier
- et vous coller le résultat ici

Merci :)
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?

[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Avatar de l’utilisateur
Jacobus
Messages : 1559
Inscription : mar. 06/avr./2004 10:35
Contact :

Message par Jacobus »

Voilà, 2ème code, Windows Vista home premium, barre de l'explorateur.

Code : Tout sélectionner

Sous la souris
	hWnd = 329248
	Class = Edit
	Size
		Left = 96 / Right = 1149
		Top = 29 / Bottom = 44
		Width = 1053
		Height = 15
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPSIBLINGS
		#WS_VISIBLE
Parent 1
	hWnd = 329244
	Class = ComboBox
	Size
		Left = 72 / Right = 1169
		Top = 25 / Bottom = 47
		Width = 1097
		Height = 22
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_VISIBLE
Parent 2
	hWnd = 329246
	Class = ComboBoxEx32
	Size
		Left = 72 / Right = 1169
		Top = 25 / Bottom = 47
		Width = 1097
		Height = 22
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_MAXIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_TABSTOP
		#WS_TILEDWINDOW
		#WS_VISIBLE
	Style Ex
		#WS_EX_PALETTEWINDOW
		#WS_EX_TOOLWINDOW
Parent 3
	hWnd = 329242
	Class = msctls_progress32
	Size
		Left = 72 / Right = 1194
		Top = 25 / Bottom = 47
		Width = 1122
		Height = 22
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_VISIBLE
Parent 4
	hWnd = 329240
	Class = Address Band Root
	Size
		Left = 70 / Right = 1196
		Top = 24 / Bottom = 48
		Width = 1126
		Height = 24
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_MAXIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_TABSTOP
		#WS_TILEDWINDOW
		#WS_VISIBLE
Parent 5
	hWnd = 329234
	Class = ReBarWindow32
	Size
		Left = 0 / Right = 1440
		Top = 20 / Bottom = 55
		Width = 1440
		Height = 35
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_GROUP
		#WS_MINIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_TILEDWINDOW
		#WS_VISIBLE
	Style Ex
		#WS_EX_PALETTEWINDOW
		#WS_EX_TOOLWINDOW
Parent 6
	hWnd = 394768
	Text = Barre de navigation
	Class = WorkerW
	Size
		Left = 0 / Right = 1440
		Top = 20 / Bottom = 55
		Width = 1440
		Height = 35
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_VISIBLE
	Style Ex
Parent 7
	hWnd = 329220
	Text = Windows
	Class = CabinetWClass
	Size
		Left = -8 / Right = 1448
		Top = -8 / Bottom = 878
		Width = 1456
		Height = 886
	Style
		#WS_BORDER
		#WS_CAPTION
		#WS_CLIPSIBLINGS
		#WS_DLGFRAME
		#WS_GROUP
		#WS_MAXIMIZE
		#WS_MAXIMIZEBOX
		#WS_MINIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_POPUPWINDOW
		#WS_SIZEBOX
		#WS_SYSMENU
		#WS_TABSTOP
		#WS_THICKFRAME
		#WS_TILEDWINDOW
		#WS_VISIBLE
	Style Ex
		#WS_EX_OVERLAPPEDWINDOW
		#WS_EX_PALETTEWINDOW
		#WS_EX_WINDOWEDGE
Quand tous les glands seront tombés, les feuilles dispersées, la vigueur retombée... Dans la morne solitude, ancré au coeur de ses racines, c'est de sa force maturité qu'il renaîtra en pleine magnificence...Jacobus.
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Message par Le Soldat Inconnu »

Bon, il y a un soucis, je n'arrive pas a choper le texte de la barre d'adresse.

GetWindowText_( ne retourne rien

Va falloir trouvé autre chose, rha, sont pénibles chez crosoft ....
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?

[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Avatar de l’utilisateur
Jacobus
Messages : 1559
Inscription : mar. 06/avr./2004 10:35
Contact :

Message par Jacobus »

J'avais ouvert C:\Windows\ comme demandé...
Quand tous les glands seront tombés, les feuilles dispersées, la vigueur retombée... Dans la morne solitude, ancré au coeur de ses racines, c'est de sa force maturité qu'il renaîtra en pleine magnificence...Jacobus.
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Message par Le Soldat Inconnu »

Bon, alors nouveau code.

Et on recommence le test :
- vous compilez mon code
- Vous ouvrez l'explorateur windows dans le c:\windows
- vous cliquez dans la barre d'adresse comme ci vous vouliez tapé du texte dedans (vous devez voir le curseur pour | pour la frappe au clavier)
- Vous attendez que la barre de progression de mon programme soit pleine
- vous cliquez sur "figer"
- vous cliquez sur copier
- et vous coller le résultat ici

Merci :D

Code : Tout sélectionner

; Auteur : Le Soldat Inconnu
; Version de PB : 4
;
; Explication du programme :
; Obtenir des informations sur la fenêtre sous la souris, ainsi que toutes les fenêtres parentes.

Structure Style_Info
  Value.l
  Text.s
EndStructure
Global NewList style.Style_Info()
;{ Liste des styles
AddElement(Style()) : Style()\Value = #WS_BORDER : Style()\Text = "#WS_BORDER"
AddElement(Style()) : Style()\Value = #WS_CAPTION : Style()\Text = "#WS_CAPTION"
AddElement(Style()) : Style()\Value = #WS_CHILD : Style()\Text = "#WS_CHILD"
AddElement(Style()) : Style()\Value = #WS_CHILDWINDOW : Style()\Text = "#WS_CHILDWINDOW"
AddElement(Style()) : Style()\Value = #WS_CLIPCHILDREN : Style()\Text = "#WS_CLIPCHILDREN"
AddElement(Style()) : Style()\Value = #WS_CLIPSIBLINGS : Style()\Text = "#WS_CLIPSIBLINGS"
AddElement(Style()) : Style()\Value = #WS_DISABLED : Style()\Text = "#WS_DISABLED"
AddElement(Style()) : Style()\Value = #WS_DLGFRAME : Style()\Text = "#WS_DLGFRAME"
AddElement(Style()) : Style()\Value = #WS_GROUP : Style()\Text = "#WS_GROUP"
AddElement(Style()) : Style()\Value = #WS_HSCROLL : Style()\Text = "#WS_HSCROLL"
AddElement(Style()) : Style()\Value = #WS_ICONIC : Style()\Text = "#WS_ICONIC"
AddElement(Style()) : Style()\Value = #WS_MAXIMIZE : Style()\Text = "#WS_MAXIMIZE"
AddElement(Style()) : Style()\Value = #WS_MAXIMIZEBOX : Style()\Text = "#WS_MAXIMIZEBOX"
AddElement(Style()) : Style()\Value = #WS_MINIMIZE : Style()\Text = "#WS_MINIMIZE"
AddElement(Style()) : Style()\Value = #WS_MINIMIZEBOX : Style()\Text = "#WS_MINIMIZEBOX"
AddElement(Style()) : Style()\Value = #WS_OVERLAPPED : Style()\Text = "#WS_OVERLAPPED"
AddElement(Style()) : Style()\Value = #WS_OVERLAPPEDWINDOW : Style()\Text = "#WS_OVERLAPPEDWINDOW"
AddElement(Style()) : Style()\Value = #WS_POPUP : Style()\Text = "#WS_POPUP"
AddElement(Style()) : Style()\Value = #WS_POPUPWINDOW : Style()\Text = "#WS_POPUPWINDOW"
AddElement(Style()) : Style()\Value = #WS_SIZEBOX : Style()\Text = "#WS_SIZEBOX"
AddElement(Style()) : Style()\Value = #WS_SYSMENU : Style()\Text = "#WS_SYSMENU"
AddElement(Style()) : Style()\Value = #WS_TABSTOP : Style()\Text = "#WS_TABSTOP"
AddElement(Style()) : Style()\Value = #WS_THICKFRAME : Style()\Text = "#WS_THICKFRAME"
AddElement(Style()) : Style()\Value = #WS_TILED : Style()\Text = "#WS_TILED"
AddElement(Style()) : Style()\Value = #WS_TILEDWINDOW : Style()\Text = "#WS_TILEDWINDOW"
AddElement(Style()) : Style()\Value = #WS_VISIBLE : Style()\Text = "#WS_VISIBLE"
AddElement(Style()) : Style()\Value = #WS_VSCROLL : Style()\Text = "#WS_VSCROLL"
;}

Global NewList StyleEx.Style_Info()
;{ Liste des styles étendus
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_ACCEPTFILES : StyleEx()\Text = "#WS_EX_ACCEPTFILES"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_CAPTIONOKBTN : StyleEx()\Text = "#WS_EX_CAPTIONOKBTN"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_CLIENTEDGE : StyleEx()\Text = "#WS_EX_CLIENTEDGE"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_CONTEXTMENU : StyleEx()\Text = "#WS_EX_CONTEXTMENU"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_DLGMODALFRAME : StyleEx()\Text = "#WS_EX_DLGMODALFRAME"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_INK : StyleEx()\Text = "#WS_EX_INK"
#WS_EX_LAYERED = $00080000
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_LAYERED : StyleEx()\Text = "#WS_EX_LAYERED"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_LAYOUTRTL : StyleEx()\Text = "#WS_EX_LAYOUTRTL"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_LTRREADING : StyleEx()\Text = "#WS_EX_LTRREADING"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_NOACTIVATE : StyleEx()\Text = "#WS_EX_NOACTIVATE"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_NOANIMATION : StyleEx()\Text = "#WS_EX_NOANIMATION"
; AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_NODRAG : StyleEx()\Text = "#WS_EX_NODRAG"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_NOINHERITLAYOUT : StyleEx()\Text = "#WS_EX_NOINHERITLAYOUT"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_OVERLAPPEDWINDOW : StyleEx()\Text = "#WS_EX_OVERLAPPEDWINDOW"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_PALETTEWINDOW : StyleEx()\Text = "#WS_EX_PALETTEWINDOW"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_RTLREADING : StyleEx()\Text = "#WS_EX_RTLREADING"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_STATICEDGE : StyleEx()\Text = "#WS_EX_STATICEDGE"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_TOOLWINDOW : StyleEx()\Text = "#WS_EX_TOOLWINDOW"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_TOPMOST : StyleEx()\Text = "#WS_EX_TOPMOST"
AddElement(StyleEx()) : StyleEx()\Value = #WS_EX_WINDOWEDGE : StyleEx()\Text = "#WS_EX_WINDOWEDGE"
;}

Procedure Analyse_Window(hwnd.l)
  
  Niveau = 0
  Element = -1
  ClearGadgetItemList(0)
  
  Repeat
    
    If Niveau = 0
      Element + 1 : AddGadgetItem(0, Element, "Sous la souris", 0, 0)
    Else
      Element + 1 : AddGadgetItem(0, Element, "Parent " + Str(Niveau), 0, 0)
    EndIf
    
    Element + 1 : AddGadgetItem(0, Element, "hWnd = " + Str(hwnd), 0, 1)
    SetGadgetItemState(0, Element - 1, #PB_Tree_Expanded)
    
    Text.s = Space(255)
    GetWindowText_(hwnd, @Text, 255)
    If Text
      Element + 1 : AddGadgetItem(0, Element, "Text (GetWindowText) = " + Text, 0, 1)
    EndIf
    Text2.s = Space(255)
    SendMessage_(hwnd, #WM_GETTEXT, 255, @Text2)
    If Text2 And Text2 <> Text
      Element + 1 : AddGadgetItem(0, Element, "Text (SendMessage) = " + Text2, 0, 1)
    EndIf
    
    Class.s = Space(255)
    GetClassName_(hwnd, @Class, 256)
    If Class
      Element + 1 : AddGadgetItem(0, Element, "Class = " + Class, 0, 1)
    EndIf
    
    Element + 1 : AddGadgetItem(0, Element, "Size", 0, 1)
    GetWindowRect_(hwnd, Size.RECT)
    Element + 1 : AddGadgetItem(0, Element, "Left = " + Str(Size\left) + " / Right = " + Str(Size\right), 0, 2)
    SetGadgetItemState(0, Element - 1, #PB_Tree_Expanded)
    Element + 1 : AddGadgetItem(0, Element, "Top = " + Str(Size\top) + " / Bottom = " + Str(Size\bottom), 0, 2)
    Element + 1 : AddGadgetItem(0, Element, "Width = " + Str(Size\right - Size\left), 0, 2)
    Element + 1 : AddGadgetItem(0, Element, "Height = " + Str(Size\bottom - Size\top), 0, 2)
    
    
    Window_Style = GetWindowLong_(hwnd, #GWL_STYLE)
    If Window_Style
      Element + 1 : AddGadgetItem(0, Element, "Style", 0, 1)
      ForEach Style()
        If Window_Style & Style()\Value
          Element + 1 : AddGadgetItem(0, Element, Style()\Text, 0, 2)
        EndIf
      Next
    EndIf
    
    Window_StyleEx = GetWindowLong_(hwnd, #GWL_EXSTYLE)
    If Window_StyleEx
      Element + 1 : AddGadgetItem(0, Element, "Style Ex", 0, 1)
      ForEach StyleEx()
        If Window_StyleEx & StyleEx()\Value
          Element + 1 : AddGadgetItem(0, Element, StyleEx()\Text, 0, 2)
        EndIf
      Next
    EndIf
    
    hwnd = GetParent_(hwnd)
    Niveau + 1
  Until hwnd = 0
  
  
EndProcedure

#Rafraichissement = 1000
#Vitesse = 50
#Temps_Max = #Rafraichissement / #Vitesse

#Largeur = 220

; Création de la fenêtre et de la GadgetList
If OpenWindow(0, 0, 0, #Largeur, 464, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget) = 0 Or CreateGadgetList(WindowID(0)) = 0
  End
EndIf

StickyWindow(0, 1)

TreeGadget(0, 0, 0, #Largeur, 400)
ButtonGadget(1, 0, 400, #Largeur, 22, "Figer", #PB_Button_Toggle)
ButtonGadget(2, 0, 422, #Largeur, 22, "Copier")
ProgressBarGadget(3, 0, 444, #Largeur, 20, 0, #Temps_Max, #PB_ProgressBar_Smooth)

SetTimer_(WindowID(0), 1, #Vitesse, 0)
Temps = 0

Repeat
  Event = WaitWindowEvent()
  
  Select Event
      
    Case #PB_Event_Gadget
      Select EventGadget()
        Case 1
          Figer = GetGadgetState(1)
        Case 2
          Texte.s = ""
          For n = 0 To CountGadgetItems(0) - 1
            For Niveau = 1 To GetGadgetItemAttribute(0, n, #PB_Tree_SubLevel)
              Texte + Chr(9)
            Next
            Texte + GetGadgetItemText(0, n)
            Texte + Chr(13) + Chr(10)
          Next
          SetClipboardText(Texte)
      EndSelect
      
    Case #WM_TIMER
      Select EventwParam()
        Case 1
          Survol_Souris = WindowFromPoint_(DesktopMouseX(), DesktopMouseY())
          If Survol_Souris = Survol_Souris_Memoire And Figer = 0
            If Temps = #Temps_Max
              Analyse_Window(Survol_Souris)
              Temps + 1
            Else
              Temps + 1
              SetGadgetState(3, Temps)
            EndIf
          Else
            Temps = 0
            SetGadgetState(3, Temps)
            Survol_Souris_Memoire = Survol_Souris
          EndIf
      EndSelect
  EndSelect
  
Until Event = #PB_Event_CloseWindow

KillTimer_(WindowID(0), 1)

End
Pour les curieux, tous ces tests, c'est pour ce logiciel :
ImageImage
Il s'agit de mon Bi-Exploreur dernière génération ... un petit truc quoi, le code ne fait que 292ko ... Non, en fait, c'est mon plus gros logiciel.
Et j'aimerais le rendre compatible Vista
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?

[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Avatar de l’utilisateur
Jacobus
Messages : 1559
Inscription : mar. 06/avr./2004 10:35
Contact :

Message par Jacobus »

Là on dirait que tu l'as...

Code : Tout sélectionner

Sous la souris
	hWnd = 1770618
	Text (SendMessage) = C:\Windows
	Class = Edit
	Size
		Left = 96 / Right = 1149
		Top = 29 / Bottom = 44
		Width = 1053
		Height = 15
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPSIBLINGS
		#WS_VISIBLE
Parent 1
	hWnd = 2491106
	Class = ComboBox
	Size
		Left = 72 / Right = 1169
		Top = 25 / Bottom = 47
		Width = 1097
		Height = 22
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_VISIBLE
Parent 2
	hWnd = 4588570
	Text (SendMessage) = C:\Windows
	Class = ComboBoxEx32
	Size
		Left = 72 / Right = 1169
		Top = 25 / Bottom = 47
		Width = 1097
		Height = 22
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_MAXIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_TABSTOP
		#WS_TILEDWINDOW
		#WS_VISIBLE
	Style Ex
		#WS_EX_PALETTEWINDOW
		#WS_EX_TOOLWINDOW
Parent 3
	hWnd = 1770760
	Class = msctls_progress32
	Size
		Left = 72 / Right = 1194
		Top = 25 / Bottom = 47
		Width = 1122
		Height = 22
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_VISIBLE
Parent 4
	hWnd = 1966710
	Class = Address Band Root
	Size
		Left = 70 / Right = 1196
		Top = 24 / Bottom = 48
		Width = 1126
		Height = 24
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_MAXIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_TABSTOP
		#WS_TILEDWINDOW
		#WS_VISIBLE
Parent 5
	hWnd = 1966816
	Class = ReBarWindow32
	Size
		Left = 0 / Right = 1440
		Top = 20 / Bottom = 55
		Width = 1440
		Height = 35
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_GROUP
		#WS_MINIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_TILEDWINDOW
		#WS_VISIBLE
	Style Ex
		#WS_EX_PALETTEWINDOW
		#WS_EX_TOOLWINDOW
Parent 6
	hWnd = 2491582
	Text (GetWindowText) = Barre de navigation
	Class = WorkerW
	Size
		Left = 0 / Right = 1440
		Top = 20 / Bottom = 55
		Width = 1440
		Height = 35
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_VISIBLE
	Style Ex
Parent 7
	hWnd = 2032866
	Text (GetWindowText) = Windows
	Class = CabinetWClass
	Size
		Left = -8 / Right = 1448
		Top = -8 / Bottom = 878
		Width = 1456
		Height = 886
	Style
		#WS_BORDER
		#WS_CAPTION
		#WS_CLIPSIBLINGS
		#WS_DLGFRAME
		#WS_GROUP
		#WS_MAXIMIZE
		#WS_MAXIMIZEBOX
		#WS_MINIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_POPUPWINDOW
		#WS_SIZEBOX
		#WS_SYSMENU
		#WS_TABSTOP
		#WS_THICKFRAME
		#WS_TILEDWINDOW
		#WS_VISIBLE
	Style Ex
		#WS_EX_OVERLAPPEDWINDOW
		#WS_EX_PALETTEWINDOW
		#WS_EX_WINDOWEDGE
Quand tous les glands seront tombés, les feuilles dispersées, la vigueur retombée... Dans la morne solitude, ancré au coeur de ses racines, c'est de sa force maturité qu'il renaîtra en pleine magnificence...Jacobus.
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Message par Le Soldat Inconnu »

Super :) merci
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?

[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Ollivier
Messages : 4197
Inscription : ven. 29/juin/2007 17:50
Localisation : Encore ?
Contact :

Message par Ollivier »

J'ai vu ton Screenshoot. C'est propre. Si je puis me permettre une boutade, rajoute-y la 4D : en gros tu compare un lecteur ou une ramification d'aujourd'hui avec ce même lecteur il y a une semaine, par exemple.

Woilà! Bon courage!
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Message par Le Soldat Inconnu »

Quelqu'un peut lancer ce code sous Vista

J'ai besoin du contenu de la fenêtre de debug en résultat

et dite moi si vous avez l'explorateur d'ouvert sous "c:\windows"
et il n'y a plus de bordure et de barre de titre sur la fenêtre de l'explorateur, merci.

Code : Tout sélectionner

Global Recherche_BarreAdresse, ExploreurID, Exploreur_Adresse_ID 

Procedure Recherche_BarreAdresse(hwnd.l, lParam.l)
  Tampon.s = Space(50)
  GetClassName_(hwnd, @Tampon, 50)
  If Tampon = "Edit"
    hwnd_parent = GetParent_(hwnd)
    Tampon.s = Space(50)
    GetClassName_(hwnd_parent, @Tampon, 50)
    If Tampon = "ComboBox"
      Recherche_BarreAdresse = hwnd
    EndIf
  EndIf
  ProcedureReturn #True
EndProcedure

Procedure Ouvre_Exploreurs() 
  Protected NewList Liste_Fenetres() 
  
  ; On liste les fenêtres visibles 
  hwnd.l = FindWindow_(0, 0) 
  While hwnd <> 0 
    If GetWindowLong_(hwnd, #GWL_STYLE) & #WS_VISIBLE And GetWindowLong_(hwnd, #GWL_STYLE) & #WS_SYSMENU And GetWindowLong_(hwnd, #GWL_STYLE) & #WS_BORDER And GetParent_(hwnd) = 0 
      AddElement(Liste_Fenetres()) 
      Liste_Fenetres() = hwnd 
    EndIf 
    hwnd = GetWindow_(hwnd, #GW_HWNDNEXT) 
  Wend 
  
  ; Exploreur 
  RunProgram("explorer.exe", "/e,/n,c:\", "") 
  
  ; Recherche des Exploreurs 
  Temps = ElapsedMilliseconds() 
  Repeat 
    Delay(100) ; On attend un peu 
    hwnd.l = FindWindow_(0, 0) 
    While hwnd And ExploreurID = 0 
      If GetWindowLong_(hwnd, #GWL_STYLE) & #WS_VISIBLE And GetWindowLong_(hwnd, #GWL_STYLE) & #WS_SYSMENU And GetWindowLong_(hwnd, #GWL_STYLE) & #WS_BORDER And GetParent_(hwnd) = 0 
        LastWindowID = hwnd 
        ; On recherche si la fenêtre existait déjà 
        ForEach Liste_Fenetres() 
          If LastWindowID = Liste_Fenetres() 
            LastWindowID = 0 
            Break 
          EndIf 
        Next 
      EndIf 
      If LastWindowID ; on a trouvé une nouvelle fenêtre 
        Debug "nouvelle fenêtre trouvée" 
        Debug LastWindowID 
        Recherche_BarreAdresse = 0 
        EnumChildWindows_(LastWindowID, @Recherche_BarreAdresse(), 0) 
        If Recherche_BarreAdresse 
          Debug "Barre d'aresse" 
          Debug Recherche_BarreAdresse 
          Adresse.s = Space(#MAX_PATH) 
          SendMessage_(Recherche_BarreAdresse, #WM_GETTEXT, #MAX_PATH, @Adresse) 
          Debug "'" + Adresse  + "'"
          If LCase(Adresse) = "c:\"
            Debug ">> Exploreur" 
            ExploreurID = LastWindowID 
            Exploreur_Adresse_ID = Recherche_BarreAdresse 
          EndIf 
        EndIf 
        AddElement(Liste_Fenetres()) 
        Liste_Fenetres() = hwnd 
      Else 
        hwnd = GetWindow_(hwnd, #GW_HWNDNEXT) 
      EndIf 
    Wend 
    
    If ElapsedMilliseconds() - Temps > 10000 
      MessageRequester("Erreur", "Pas d'explorateur trouvé") 
      End 
    EndIf 
    
  Until ExploreurID <> 0 
  
  
  ; Intégration des 2 Exploreurs dans le programme 
  SetWindowLong_(ExploreurID, #GWL_HWNDPARENT, WindowID(0)) 
  SetWindowLong_(ExploreurID, #GWL_STYLE, GetWindowLong_(ExploreurID, #GWL_STYLE) & ~#WS_TILEDWINDOW) 
  
  MoveWindow_(ExploreurID, 100, 100, 500, 300, 1) 
  
  ; Chargement de dossier 
  SendMessage_(Exploreur_Adresse_ID, #WM_SETTEXT, 0, "c:\windows\") 
  SendMessage_(Exploreur_Adresse_ID, #WM_KEYDOWN, #VK_RETURN, 0) 
  SendMessage_(Exploreur_Adresse_ID, #WM_KEYUP, #VK_RETURN, 0) 
  
  
  
EndProcedure 



; Création de la fenêtre et de la GadgetList 
If OpenWindow(0, 0, 0, 800, 600, "Test", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget) = 0 Or CreateGadgetList(WindowID(0)) = 0 
  End 
EndIf 

Ouvre_Exploreurs() 

Repeat 
  Event = WaitWindowEvent() 
  
  Select Event 
    Case #PB_Event_Menu 
      Select EventMenu() ; Menus 
          
      EndSelect 
      
    Case #PB_Event_Gadget 
      Select EventGadget() ; Gadgets 
          
      EndSelect 
  EndSelect 
  
Until Event = #PB_Event_CloseWindow 

PostMessage_(ExploreurID, #WM_CLOSE, 0, 0) 

End
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?

[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Avatar de l’utilisateur
Jacobus
Messages : 1559
Inscription : mar. 06/avr./2004 10:35
Contact :

Message par Jacobus »

Résultat : Explorateur ouvert dans c:\
Debug:
nouvelle fenêtre trouvée
12715298
Barre d'aresse
9307204
''
nouvelle fenêtre trouvée
5702780
Barre d'aresse
1770494
''
nouvelle fenêtre trouvée
6030154

Image du résultat affiché : http://www.wolforan.fr/DivImg/Capture_test_lsi.JPG

@+
Quand tous les glands seront tombés, les feuilles dispersées, la vigueur retombée... Dans la morne solitude, ancré au coeur de ses racines, c'est de sa force maturité qu'il renaîtra en pleine magnificence...Jacobus.
Répondre