Aide:ControlCommand.txt

De Wiki AutoIt Français
Aller à : navigation, rechercher

Document original V3.3.6.1 :

###Function###
ControlCommand

###Description###
Sends a command to a control.

###Syntax###
ControlCommand ( "title", "text", controlID, "command" [, "option"] )


###Parameters###
@@ParamTable@@
title
	The title of the window to access.
text
	The text of the window to access.
controlID
	The control to interact with.  See <a href="../intro/controls.htm">Controls</a>.
command
	The command to send to the control.
option
	[optional] Additional parameter required by some commands.
@@End@@

###ReturnValue###
Depends on command as table below shows.  In case of an error (such as an invalid command or window/control), @error=1.

@@ControlCommandTable@@
<b>Command, Option</b>
	<b>Return Value</b>
"IsVisible", ""
	Returns 1 if Control is visible, 0 otherwise
"IsEnabled", ""
	Returns 1 if Control is enabled, 0 otherwise
"ShowDropDown", ""
	Drops a ComboBox
"HideDropDown", ""
	Undrops a ComboBox
"AddString", 'string'
	Adds a string to the end in a ListBox or ComboBox
"DelString", occurrence
	Deletes a string according to occurrence in a ListBox or ComboBox
"FindString", 'string'
	Returns occurrence ref of the exact string in a ListBox or ComboBox
"SetCurrentSelection", <i>occurrence</i>
	Sets selection to occurrence ref in a ListBox or ComboBox
"SelectString", 'string'
	Sets selection according to string in a ListBox or ComboBox
"IsChecked", ""
	Returns 1 if Button is checked, 0 otherwise
"Check", ""
	Checks radio or check Button
"UnCheck", ""
	Unchecks radio or check Button
"GetCurrentLine", ""
	Returns the line # where the caret is in an Edit
"GetCurrentCol", ""
	Returns the column # where the caret is in an Edit
"GetCurrentSelection", ""
	Returns name of the currently selected item in a ListBox or ComboBox
"GetLineCount", ""
	Returns # of lines in an Edit
"GetLine", <i>line</i>#
	Returns text at line # passed of an Edit
"GetSelected", ""
	Returns selected text of an Edit
"EditPaste", 'string'
	Pastes the 'string' at the Edit's caret position
"CurrentTab", ""
	Returns the current Tab shown of a SysTabControl32
"TabRight", ""
	Moves to the next tab to the right of a SysTabControl32
"TabLeft", ""
	Moves to the next tab to the left of a SysTabControl32
"SendCommandID", <i>Command ID</i>
	Simulates the WM_COMMAND message. Usually used for ToolbarWindow32 controls - use the ToolBar tab of Au3Info to get the Command ID.
@@End@@

###Remarks###
Some controls will resist automation unless they are the active window. Use the WinActive() function to force the control's window to the top before using ControlCommand() on these controls.

Certain commands that work on normal Combo and ListBoxes do not work on "ComboLBox" controls.


###Related###
ControlClick, ControlDisable, ControlEnable, ControlFocus, ControlGetPos, ControlGetText, ControlHide, ControlMove, ControlSetText, ControlShow, StatusbarGetText, WinActivate, WinMenuSelectItem, WinGetClassList, ControlGetFocus, ControlListView, ControlSend, ControlTreeView


###Example###
@@IncludeExample@@


Document traduit V3.3.6.1 :

###Function###
ControlCommand

###Description###
Envoi une commande à un contrôle.


###Syntax###
ControlCommand ( "title", "text", controlID, "command" [, "option"] )


###Parameters###
@@ParamTable@@
title
	Le titre de la fenêtre à atteindre.
text
	Le texte de la fenêtre à atteindre.
controlID
	Le contrôle avec lequel interagir. Voir <a href="../intro/controls.htm">Controls</a>.
command
	La commande à envoyer au contrôle.
option
	[optionnel] Paramètres additionnels pouvant être requis par certaines commandes.
@@End@@


###ReturnValue###
Dépend de la commande tel que montré dans le tableau ci-dessous. En cas d'erreur (telle qu'une commande ou fenêtre/contrôle invalide) @error est mis à 1.

@@ControlCommandTable@@
<b>Commande, Option</b>
	<b>Valeur de retour</b>
"IsVisible", ""
	Retourne 1 si le contrôle est visible, sinon 0
"IsEnabled", ""
	Retourne 1 si le contrôle est actif, sinon 0
"ShowDropDown", ""
	Déplie un contrôle type ComboBox
"HideDropDown", ""
	Replie un contrôle type ComboBox
"AddString", 'string'
	Ajoute la chaîne 'string' à la fin d'un contrôle type ListBox ou ComboBox
"DelString", occurrence
	Efface une chaîne en fonction de sont occurrence dans un contrôle type ListBox ou ComboBox
"FindString", 'string'
	Retourne la position de la chaine 'string' d'un contrôle type ListBox ou ComboBox
"SetCurrentSelection", <i>occurrence</i>
	Sélectionne une chaine en fonction de sont occurrence dans un contrôle type ListBox ou ComboBox
"SelectString", 'string'
	Sélectionne la chaine 'string' dans un contrôle type ListBox ou ComboBox
"IsChecked", ""
	Retourne 1 si le contrôle est coché, sinon 0
"Check", ""
	Coche le contrôle type CheckBox ou RadioBox
"UnCheck", ""
	Décoche le contrôle type CheckBox ou RadioBox
"GetCurrentLine", ""
	Retourne le numéro de la ligne positionnée sous le curseur, dans un contrôle type Edit
"GetCurrentCol", ""
	Retourne le numéro de la colonne positionnée sous le curseur, dans un contrôle type Edit
"GetCurrentSelection", ""
	Retourne le nom de l'élément sélectionné dans un contrôle type ListBox ou ComboBox
"GetLineCount", ""
	Retourne le nombre de lignes dans un contrôle type Edit
"GetLine", <i>line</i>#
	Retourne le texte d'une ligne d'un contrôle de type Edit
"GetSelected", ""
	Retourne le texte sélectionné d'un contrôle de type Edit
"EditPaste", 'string'
	Ajoute la chaine 'string' à la position du curseur dans un contrôle de type Edit
"CurrentTab", ""
	Retourne l'onglet sélectionné dans un contrôle type SysTabControl32
"TabRight", ""
	Passe à l'onglet suivant vers la droite dans un contrôle type SysTabControl32
"TabLeft", ""
	Passe à l'onglet suivant vers la gauche dans un contrôle type SysTabControl32
"SendCommandID", <i>Command ID</i>
	Simule l'envoi du message WM_COMMAND. Habituellement utilisé pour les contrôles type ToolbarWindow32 - Utilisez l'onglet 'ToolBar' de Au3Info pour avoir l'ID d'une commande.
@@End@@


###Remarks###
Certains contrôles peuvent résister à l'automation tant qu'ils ne sont pas dans la fenêtre active. Utilisez la fonction WinActivate() pour mettre la fenêtre des contrôles au premier plan avant d'utiliser ControlCommand().

Certaines commandes fonctionnant pour un contrôle type ComboBox ou ListBox, peuvent ne pas fonctionner pour des contrôles type "ComboLBox".

###Related###
<a href="ControlClick.htm">ControlClick</a>, <a href="ControlDisable.htm">ControlDisable</a>, <a href="ControlEnable.htm">ControlEnable</a>, <a href="ControlFocus.htm">ControlFocus</a>, <a href="ControlGetPos.htm">ControlGetPos</a>, <a href="ControlGetText.htm">ControlGetText</a>, <a href="ControlHide.htm">ControlHide</a>, <a href="ControlMove.htm">ControlMove</a>, <a href="ControlSetText.htm">ControlSetText</a>, <a href="ControlShow.htm">ControlShow</a>, <a href="StatusbarGetText.htm">StatusbarGetText</a>, <a href="WinActivate.htm">WinActivate</a>, <a href="WinMenuSelectItem.htm">WinMenuSelectItem</a>, <a href="WinGetClassList.htm">WinGetClassList</a>, <a href="ControlGetFocus.htm">ControlGetFocus</a>, <a href="ControlListView.htm">ControlListView</a>, <a href="ControlSe.htm">ControlSe</a>


###Example###
@@IncludeExample@@


Traducteur : ZDS

Contributeurs (pour les modifications avant le Wiki) : Tlem