Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VB6 - SendKeys che non funziona

13 views
Skip to first unread message

Il collezionista

unread,
Dec 12, 2009, 7:38:51 AM12/12/09
to
Ho trovato su MSDN questo pezzo di codice che che ho messo in un command di
unn form. Il codice dovrebbe aprire la calcolatrice, passargli il focus ed
effettuare delle somme simulando tramite sendKeys la pressione di alcuni
tasti della tastiera.
Ma sendkeys non funziona o meglio non viene pigiato nessun tasto.
La calcolatrice viene aperta e il focus passato ma sendkeys non simula
nessuna operazione.
Non riesco a capirne il motivo.
Mi sapete aiutare?
Grazie


Dim ReturnValue, I
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
Sleep 10000
AppActivate ReturnValue ' Activate the Calculator.

For I = 1 To 100 ' Set up counting loop.
SendKeys I & "{+}", True ' Send keystrokes to Calculator
Next I ' to add each value of I.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator.


Geppo

unread,
Dec 12, 2009, 4:21:08 PM12/12/09
to
Ciao "Il collezionista" <nos...@grazie.it> ha scritto nel messaggio
news:4b238f1f$0$8854$4faf...@reader5.news.tin.it...

testato su WinXp e tutto funziona regolarmente.

tu che S.O. hai? tieni presente che SendKeys non va su Vista se � attivo
l'UAC.
--
Ciao
Geppo


0 new messages