README.md

December 5, 2022 ยท View on GitHub

Easy SendKeys

Description

How to use ALT & Function Keys with the sendkey command

More Info

1 Command Button

Copy the code into the Command1_Click Event.

Calculator is installed on the PC

Submitted On
ByDavid
LevelBeginner
User Rating3.2 (16 globes from 5 users)
CompatibilityVB 4.0 (32-bit), VB 5.0, VB 6.0
CategoryDDE
WorldVisual Basic
Archive File

Source Code

Dim ReturnValue, I
ReturnValue = Shell("CALC.EXE", 1)	' Run Calculator.
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.