Page 1 sur 1
[R] Enfoncement touche
Posté : ven. 14 mai 2010 09:57
par Karachi
Bonjour à tous ! J'ai besoin d'aide pour un futur programme qui afficherait tous les symboles spéciaux de Windows (☺,☻,♥ etc...) et leurs correspondances dans un fichier texte, sous mes yeux ébahis. En théorie, ce code devrait marcher, mais il ne marche pas !
► Afficher le texte
Code : Tout sélectionner
Global $i
WinWaitActive("Sans titre - Bloc-notes")
While $i < 100
Send( "Alt +" & $i & ":",1)
Send("!" & $i & "")
$i += 1
WEnd
Il ne fait ici que les 100 premiers pour tester.
J'avais une idée pour le faire fonctionner, c'était qu'il appuie sur Alt, en restant enfoncé, et qu'il appuie sur le chiffre ($i) et qu'il relâche Alt. Malheureusement, malgré plusieurs farfouillages dans la doc française et anglaise, je n'ai rien trouvé ! Je compte sur vous pour m'éclairer. Merci beaucoup !
Re: [..] Enfoncement touche
Posté : ven. 14 mai 2010 10:34
par pop45
Code : Tout sélectionner
for$i = 1 to 100
send ( "{ALT DOWN}")
send ($i)
send ("{ALT UP}")
next
chez pas si sa marche mais logiquement sa doit ressembler a un truck comme sa
Re: [..] Enfoncement touche
Posté : ven. 14 mai 2010 12:11
par Karachi
Tout d'abord, merci pour ta réponse, c'est ce que je recherchais, ensuite, en théorie, ça devrait parfaitement marcher,mais y'a un truc qui va pas, pour ce code :
► Afficher le texte
Code : Tout sélectionner
Global $i
WinWaitActive("Sans titre - Bloc-notes")
While $i < 100
Send(" Alt + " & $i & ": ", 1)
Send("{ALT DOWN}")
Send($i)
Send("{ALT UP}")
$i += 1
WEnd
ça affiche que
► Afficher le texte
Alt + : t + 1: Alt + 2: Alt + 3: Alt + 4: Alt + 5: Alt + 6: Alt + 7: Alt + 8: Alt + 9: Alt + 10: Alt + 11: Alt + 12: Alt + 13: Alt + 14: Alt + 15: Alt + 16: Alt + 17: Alt + 18: Alt + 19: Alt + 20: Alt + 21: Alt + 22: Alt + 23: Alt + 24: Alt + 25: Alt + 26: Alt + 27: Alt + 28: Alt + 29: Alt + 30: Alt + 31: Alt + 32: Alt + 33: Alt + 34: Alt + 35: Alt + 36: Alt + 37: Alt + 38: Alt + 39: Alt + 40: Alt + 41: Alt + 42: Alt + 43: Alt + 44: Alt + 45: Alt + 46: Alt + 47: Alt + 48: Alt + 49: Alt + 50: Alt + 51: Alt + 52: Alt + 53: Alt + 54: Alt + 55: Alt + 56: Alt + 57: Alt + 58: Alt + 59: Alt + 60: Alt + 61: Alt + 62: Alt + 63: Alt + 64: Alt + 65: Alt + 66: Alt + 67: Alt + 68: Alt + 69: Alt + 70: Alt + 71: Alt + 72: Alt + 73: Alt + 74: Alt + 75: Alt + 76: Alt + 77: Alt + 78: Alt + 79: Alt + 80: Alt + 81: Alt + 82: Alt + 83: Alt + 84: Alt + 85: Alt + 86: Alt + 87: Alt + 88: Alt + 89: Alt + 90: Alt + 91: Alt + 92: Alt + 93: Alt + 94: Alt + 95: Alt + 96: Alt + 97: Alt + 98: Alt + 99:
EDIT : Je crois que j'ai trouvé la fonction qu'il fallait :
Le problème c'est que X ne peut pas être une variable...
EDIT 2 : J'ai donc fait un programme qui écrit un programme ^^' :
► Afficher le texte
Code : Tout sélectionner
Global $i
Sleep(4000)
For $i = 1 To 100
Send('Send(" Alt + " & $i & " : ", 1)' & @CRLF & 'Send({ASC '& $i & '})' & @CRLF & '$i += 1' & @CRLF & "",1)
Next
Je crois que c'est donc résolu...
Re: [R] Enfoncement touche
Posté : ven. 14 mai 2010 13:53
par pop45
Code : Tout sélectionner
For $X = 1 to 100
[color=#0000FF]Send[/color][color=#FF0000]([/color][color=#BFBFFF]"{ASC "[/color] [color=#FF0000]&[/color] [color=#BF0040]$X[/color] [color=#FF0000]&[/color] [color=#BFBFFF]"}"[/color][color=#FF0000])[/color]
next
le pire c'est que tu t'est donner la reponse tout seul
Re: [R] Enfoncement touche
Posté : ven. 14 mai 2010 13:54
par Karachi
Tu veux dire que j'ai passé environ 15 minutes devant mon script en train de s'écrire grâce à mon autre script pour rien ? O_O
Re: [R] Enfoncement touche
Posté : ven. 14 mai 2010 14:05
par pop45
En gros, oui.