Pourtant cette fonction devrait fonctionner avec ce type de controle:
$srti = GUICtrlRead($num_srti)
Merci
Code : Tout sélectionner
#include <GuiConstants.au3>
;#NoTrayIcon
HotKeySet("{ESC}", "exity")
Dim $windows1, $num_srti, $compname, $bt_ok, $srti
;------------- Fenêtre principale --------------------;
$windows1 = GUICreate ( "" , 405, 130 , ( @DesktopWidth-405 ) / 2 , ( @DesktopHeight-130 ) / 2, $WS_VISIBLE + $WS_CAPTION) ;, $LVS_EX_GRIDLINES and $LVS_EX_GRIDLINES
$num_srti = GUICtrlCreateInput("", 235, 38, 70, 28)
GUICtrlSetLimit(-1,5) ; limite l'entrée à 5 caractères
$font="Comic Sans MS"
GUICtrlSetFont (-1,12, 400, 4, $font)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group
; BOUTON VALIDER
$bt_ok = GUICtrlCreateButton("bt_ok", 325, 14, 68, 68, $BS_BITMAP,$BS_DEFPUSHBUTTON)
GUICtrlSetImage ($bt_ok, "remote.bmp")
ControlFocus("Contrôle Distant S.R.I.T.T.", "", $num_srti); focus sur ce controle.
$srti = GUICtrlRead($num_srti)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
exity()
Case $msg = $bt_ok
ping_ordi()
EndSelect
Wend
Exit
Func exity()
FileDelete(@TempDir & "\" & $name)
exit
EndFunc
;------------Fonction Ping ordinateur --------;
Func ping_ordi()
MsgBox(64,"", $srti)
$Ping_ordi = Ping($compname,200)
If $Ping_ordi Then
; Ping Ok
GuiCtrlCreateLabel("Veuillez patienter, communication établie ..." , 100, 100, 100, 18)
GuiCtrlSetBkColor(-1, 0x00FF00)
sleep(2000)
Else
; Ping Non Ok
GuiCtrlCreateLabel("L'ordinateur "& $compname & " ne répond pas !" , 80, 100, 220, 20)
GuiCtrlSetBkColor(-1, 0xFF0000)
$font2="Courier New Bold"
GUICtrlSetFont (-1,10, 400, $font2)
sleep(2000)
Exit
EndIf
EndFunc