Est-ce quelqu'un peut me dire pourquoi ça marche pas pour les dimentions, en plus le nom du fichier ne s'affiche pas correctement dans le StringGadget.
Code : Tout sélectionner
If OpenWindow(0, 0, 0, 300, 200, #pb_window_systemmenu | #pb_window_ScreenCentered | #pb_window_minimizegadget | #pb_window_maximizegadget | #pb_window_sizegadget, "Afficheur de fonctions d'une DLL", 0) And CreateGadgetList(WindowID(0))
TextGadget(0, 0, 0, 50, 20, "Librairie :")
StringGadget(1, 50, 0, 230, 20, "", #pb_string_readonly)
ButtonGadget(2, 280, 0, 20, 20, "...", #pb_button_default)
ListIconGadget(3, 0, 20, 300, 180, "Fonction", 150, #PB_ListIcon_MultiSelect | #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(3, 1, "Adresse de la fonction", 150)
Repeat
Select WaitWindowEvent()
Case #PB_EventGadget
Select EventGadgetID()
Case 2
; Petit changement, on prand le dossier %windir\System par l'API
initialpath$ = Space(#Max_Path)
GetSystemDirectory_(@initialpath$,#Max_Path)
If Right(initialpath$,1)<>"\"
initialpath$=initialpath$+"\"
EndIf
librairie$ = OpenFileRequester("Choisissez une librairie de Windows", "" + initialpath$, "Fichiers DLL|*.DLL", 0)
If librairie$
SetGadgetText(1, librairie$)
If OpenLibrary(0, librairie$)
ExamineLibraryFunctions(0)
resulta = NextLibraryFunction()
; début de la boucle jusqu'à ce que le résultat devienne faux
i = 0
While resulta
AddGadgetItem(3, I, LibraryFunctionName())
SetGadgetItemText(3, I, Str(LibraryFunctionAddress()), 1)
resulta = NextLibraryFunction()
Wend
; fin de la boucle
CloseLibrary(0)
Else
MessageRequester("Erreur", "Impossible d'ouvrire la librairie '" + librairie$ + "'.", #mb_ok | #mb_iconstop)
EndIf
EndIf
EndSelect
Case #PB_Event_CloseWindow
End
Case #WM_Size
ResizeGadget(2, WindowHeight() - 20, 0, 20, 20)
ResizeGadget(1, 50, 0, WindowHeight() - 50 - 20, 20)
ResizeGadget(3, 0, 20, WindowWidth(), WindowHeight() - 20)
EndSelect
Delay(20)
ForEver
Else
MessageRequester("Erreur", "Erreur initialisation.", #mb_ok | #mb_iconstop)
EndIf
End