Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Tout est dans l'aide Autoit -- Encore faut-il l'ouvrir", 491, 156, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 16, 16, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL,$CBS_SORT))
$LstNotePad = LstBlocNote()
If $LstNotePad="" Then
MsgBox(0,"","Merci d'ouvrir au moins un bloc note....")
Exit
Else
GUICtrlSetData($Combo1, $LstNotePad, "")
EndIf
$Input1 = GUICtrlCreateInput("", 16, 72, 241, 21)
$Btn1 = GUICtrlCreateButton("Écrit", 184, 112, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Btn1
ControlSend(GUICtrlRead($Combo1), "", "Edit1", GUICtrlRead($Input1) & @CR)
EndSwitch
WEnd
Func LstBlocNote()
$var = WinList()
$BlocNote=""
For $i = 1 to $var[0][0]
If StringInStr($var[$i][0],"Bloc-notes") <> 0 Then
If $BlocNote <> "" Then
$BlocNote &= "|" & $var[$i][0]
Else
$BlocNote &= $var[$i][0]
EndIf
EndIf
Next
Return $BlocNote
EndFunc