Ce matin, je dois pas avoir les yeux en face des trous, j'arrive pas à afficher mon @ IP dans ma fenêtre GUICreateLabel hormis dans une fenêtre de MsgBox :
Code : Tout sélectionner
#Region ### START Koda GUI section ### Form=c:\users\david\desktop\formulaire.kxf
$Form1_1 = GUICreate("MyGSD (C) Hosting Team 2020", 1381, 727, 185, 101)
$Pic1 = GUICtrlCreatePic("MyGSD.jpg", 0, 0, 1381, 727)
GUICtrlSetFont(-1, 18, 400, 0, "Arial")
$Service = GUICtrlCreateLabel(_IPDetails(), 0, 70, 107, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUISetState(@SW_SHOW)
Local $aArray = _IPDetails()
If @error = 0 Then
Local $sData = 'Votre adresse IP : ' & $aArray[1]
MsgBox($MB_SYSTEMMODAL, '', $sData)
EndIf
Func _IPDetails()
Local $oWMIService = ObjGet('winmgmts:{impersonationLevel = impersonate}!\\' & '.' & '\root\cimv2')
Local $oColItems = $oWMIService.ExecQuery('Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True', 'WQL', 0x30), $aReturn[5] = [0]
If IsObj($oColItems) Then
For $oObjectItem In $oColItems
If $oObjectItem.IPAddress(0) == @IPAddress1 Then
$aReturn[0] = 1
$aReturn[1] = $oObjectItem.IPAddress(0)
EndIf
Next
EndIf
Return SetError($aReturn[0] = 0, 0, $aReturn)
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Bonne journée.