[Resolu] Compatibilité XP / Vista [Test 1]

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

[Resolu] Compatibilité XP / Vista [Test 1]

Message par Le Soldat Inconnu »

Coucou, j'ai besoin de testeur avec Vista :) parce que moi, j'ai pas installer cette ... hum ... chose

Voici le premier test dont j'ai besoin, il s'agit de lier une fenêtre au bureau.

En gros la fenêtre doit toujours resté derrière toutes les autres, et quand vous revenez au bureau, elle doit être visible.
Et bien sur, on ne doit pas voir le programme dans la barre des taches.

Code : Tout sélectionner

#Largeur = 100
#Hauteur = 100

OpenWindow(0, 0, 0, #Largeur, #Hauteur, "Lier au bureau", #PB_Window_BorderLess | #PB_Window_ScreenCentered) 

SetParent_(WindowID(0), FindWindow_(0, "Program Manager"))

CreateGadgetList(WindowID(0)) 

CreateImage(0, #Largeur, #Hauteur)
StartDrawing(ImageOutput(0))
  Box(0, 0, #Largeur, #Hauteur, $FF0000)
  Circle(#Largeur / 2, #Hauteur / 2, #Largeur / 3, $FF00FF)
StopDrawing()
ImageGadget(0, 0, 0, #Largeur, #Hauteur, ImageID(0))

; SkinWindow(WindowID(0), ImageID(0))

Repeat 
  Event = WaitWindowEvent() 
  
  If Event = #PB_Event_Gadget 
    Select EventGadget() 
      Case 0 
        Event = #PB_Event_CloseWindow 
    EndSelect 
  EndIf 
  
Until Event = #PB_Event_CloseWindow
Dite moi si vous avez bien un joli dessin sur votre bureau ou si ce ne marche pas. Merci

Si cela ne marche, pouvez vous lancer ce logiciel
Ensuite, mettre la souris au dessus du bureau, attendre que la barre soit remplit (en bas) et faire "Figer" puis "Copier"
Et copier le texte obtenu ici.
Merci

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
Dernière modification par Le Soldat Inconnu le dim. 19/oct./2008 9:34, modifié 3 fois.
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 »

Je viens de tester sur un de mes Vista Prenium, à priori si j'ai bien compris ton descriptif, j'ai bien le comportement attendu
(jolie ton carré bleu et le rond rouge).

Voilà. ;)
Force et sagesse...
Anonyme2
Messages : 3518
Inscription : jeu. 22/janv./2004 14:31
Localisation : Sourans

Message par Anonyme2 »

Vista premium, PB 4.30 beta 3

Le premier code fonctionne, Rectangle bleu avec un cercle incrit rose ou proche


Deuxième :

Sous la souris
hWnd = 0
Class =
Size
Left = 0 / Right = 0
Top = 0 / Bottom = 0
Width = 0
Height = 0
Le Soldat Inconnu
Messages : 4312
Inscription : mer. 28/janv./2004 20:58
Localisation : Clermont ferrand OU Olsztyn
Contact :

Message par Le Soldat Inconnu »

Le second code n'est pas compatible avec la beta PB4.3
Quelqu'un peut lancer le second code avec PB4.2 sous vista, 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)]
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 »

voilà ce que cela donne chez moi:

Code : Tout sélectionner

Sous la souris
	hWnd = 65752
	Text = FolderView
	Class = SysListView32
	Size
		Left = 0 / Right = 3360
		Top = 0 / Bottom = 1050
		Width = 3360
		Height = 1050
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_VISIBLE
Parent 1
	hWnd = 65750
	Class = SHELLDLL_DefView
	Size
		Left = 0 / Right = 3360
		Top = 0 / Bottom = 1050
		Width = 3360
		Height = 1050
	Style
		#WS_CHILD
		#WS_CHILDWINDOW
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_MAXIMIZEBOX
		#WS_OVERLAPPEDWINDOW
		#WS_TABSTOP
		#WS_TILEDWINDOW
		#WS_VISIBLE
Parent 2
	hWnd = 65748
	Text = Program Manager
	Class = Progman
	Size
		Left = 0 / Right = 3360
		Top = 0 / Bottom = 1050
		Width = 3360
		Height = 1050
	Style
		#WS_CLIPCHILDREN
		#WS_CLIPSIBLINGS
		#WS_POPUP
		#WS_POPUPWINDOW
		#WS_VISIBLE
	Style Ex
		#WS_EX_PALETTEWINDOW
		#WS_EX_TOOLWINDOW
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 »

Merci :) exactement comme sous XP, tant mieux
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)]
Répondre