Aide:MsgBox.txt

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

Document original V3.3.6.1 :

###Function###
MsgBox

###Description###
Displays a simple message box with optional timeout.

###Syntax###
MsgBox ( flag, "title", "text" [, timeout [, hwnd]] )


###Parameters###
@@ParamTable@@
flag
	The flag indicates the type of message box and the possible button combinations.  See remarks.
title
	The title of the message box.
text
	The text of the message box.
timeout
	[optional] Timeout in seconds.  After the timeout has elapsed the message box will be automatically closed.  The default is 0, which is no timeout.
hwnd
	[optional] The window handle to use as the parent for this dialog.
@@End@@


###ReturnValue###
@@ReturnTable@@
Success:	Returns the ID of the button pressed.
Failure:	Returns -1 if the message box timed out.<br>
@@End@@

<br>
@@ParamTable@@
<b>Button Pressed</b>
	<b>Return Value </b>
OK
	 1
CANCEL
	 2
ABORT
	 3
RETRY
	 4
IGNORE
	 5
YES
	 6
NO
	 7
TRY AGAIN **
	10
CONTINUE **
	11
@@End@@


###Remarks###
The flag parameter can be a combination of the following values:

@@StandardTable1@@
<b>decimal flag</b>	<b>Button-related Result</b>	<b>hexadecimal flag</a>
0	OK button	0x0
1	OK and Cancel	0x1
2	Abort, Retry, and Ignore	0x2
3	Yes, No, and Cancel	0x3
4	Yes and No	0x4
5	Retry and Cancel	0x5
6 **	Cancel, Try Again, Continue	0x6
<b>decimal flag</b>	<b>Icon-related Result</b>	<b>hexadecimal flag</a>
0	(No icon)	0x0
16	Stop-sign icon	0x10
32	Question-mark icon	0x20
48	Exclamation-point icon	0x30
64	Information-sign icon consisting of an 'i' in a circle	0x40
<b>decimal flag</b>	<b>Default-related Result</b>	<b>hexadecimal flag</a>
0	First button is default button	0x0
256	Second button is default button	0x100
512	Third button is default button	0x200
<b>decimal flag</b>	<b>Modality-related Result</b>	<b>hexadecimal flag</a>
0	Application 	0x0
4096	System modal (dialog has an icon)	0x1000
8192	Task modal	0x2000
<b>decimal flag</b>	<b>Miscellaneous-related Result</b>	<b>hexadecimal flag</a>
0	(nothing else special)	0x0
262144	MsgBox has top-most attribute set	0x40000
524288	title and text are right-justified	0x80000
@@End@@

** Only valid on Windows 2000/XP and above.

For example, to specify a SYSTEMMODAL box with the YES/NO buttons the flag value would be 4096+4 (or 4100)  If using hexadecimal flags, that would be 0x1000+0x4 (or 0x1004).

A message box appears centered on screen and resizes according to the text it contains.  However, the title could get truncated if the SYSTEMMODAL flag (4096) is used..

If "title" is equal to <a href="..\keywords\Default.htm">Default keyword</a> @Scriptname is used


###Related###
InputBox, ToolTip, TrayTip, SplashTextOn


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


Document traduit V3.3.6.1 :

###Function###
MsgBox

###Description###
Affiche une simple boîte de dialogue, avec une temporisation optionnelle.

###Syntax###
MsgBox ( flag, "title", "text" [, timeout [, hwnd]] )


###Parameters###
@@ParamTable@@
flag
	Ce paramètre indique le type de boîte de dialogue et les combinaisons de boutons possibles. Voir les remarques.
title
	Le titre de la boîte de dialogue.
text
	Le texte de la boîte de dialogue.
timeout
	[optionnel] Temporisation en secondes. Après la temporisation, la boite de dialogue sera automatiquement fermée. La valeur par défaut est 0, ce qui équivaut à aucune temporisation.
hwnd
	[optionnel] Le handle de la fenêtre à utiliser comme parent pour cette boîte de dialogue.
@@End@@


###ReturnValue###
@@ReturnTable@@
Succès:	Retourne l'ID du bouton pressé.
Échec:	Retourne -1 si la temporisation de la boîte de dialogue est dépassée.
@@End@@

@@ParamTable@@
<b>Bouton pressé</b>
	<b>Valeur de retour</b>
OK
	 1
Annuler
	 2
Abandonner
	 3
Recommencer
	 4
Ignorer
	 5
Oui
	 6
Non
	 7
Réessayer **
	10
Continuer **
	11
@@End@@


###Remarks###
Le paramètre de l'option peut être une combinaison des valeurs suivantes :

@@StandardTable1@@
<b>Option décimale</b>	<b>Résultat Concernant le bouton</b>	<b>Option hexadécimal</a>
0	Bouton OK	0x0
1	OK et Annuler	0x1
2	Abandonner, Recommencer, et Ignorer	0x2
3	Oui, Non, et Annuler	0x3
4	Oui et Non	0x4
5	Recommencer et Annuler	0x5
6 **	Annuler, Réessayer, Continuer	0x6
<b>Option décimale</b>	<b>Résultat lié à l'icône</b>	<b>Option hexadécimal</a>
0	(pas d'icône)	0x0
16	Icône signe-stop	0x10
32	Icône point d'interrogation	0x20
48	Icône point d'exclamation	0x30
64	Icône signe d'information qui est constitué d'un 'i' dans un cercle	0x40
<b>Option décimale</b>	<b>Résultat par défaut lié</b>	<b>Option hexadécimal</a>
0	Le premier bouton est le bouton par défaut 	0x0
256	Le deuxième bouton est le bouton par défaut	0x100
512	Le troisième bouton est le bouton par défaut	0x200
<b>Option décimale</b>	<b>Résultat Concernant la modalité</b>	<b>Option hexadécimal</a>
0	Application 	0x0
4096	Système modal (la boîte de dialogue a une icône)	0x1000
8192	Tâche modale	0x2000
<b>Option décimale</b>	<b>Divers résultats liés</b>	<b>Option hexadécimal</a>
0	(rien de spécial)	0x0
262144	MsgBox a le premier plan	0x40000
524288	Le titre et le texte sont justifiés à droite	0x80000
@@End@@

** Valide seulement sur Windows 2000/XP et plus récent.

Par exemple, pour spécifier une boîte SYSTEMMODAL avec les boutons Oui/Non, la valeur de l'option serait 4096+4 (ou 4100). En hexadécimal, ce serait 0x1000+0x4 (ou 0x1004).

Une boîte de dialogue apparaît centrée sur l'écran et est redimensionnée selon le texte qu'il contient. Cependant, le titre pourrait être tronqué si l'option SYSTEMMODAL (4096) est utilisée.

Si "title" est égal au <a href="..\keywords\Default.htm">mot-clé par défaut</a>, @Scriptname est utilisé.


###Related###
<a href="InputBox.htm">InputBox</a>, <a href="ToolTip.htm">ToolTip</a>, <a href="TrayTip.htm">TrayTip</a>, <a href="SplashTextOn.htm">SplashTextOn</a>


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


Traducteur : sablier94

Contributeurs (pour les modifications avant le Wiki) : Tlem