<p>From a HTML application (<code>.hta file</code>), you can drag any image and drop it into the desktop for example.</p>

<p>Does anybody know how to disable this capability?</p>

<p>I want the <code>.hta</code> files to have the same behavior as the <code>.html</code> files.</p>

Here's a pseudocode (since you didn't mention the language you're using):
Create an array that contains the alphabet from a-z, A-Z, 0-9 (depending on what keys you wish to send)
for i = 0 to NumberOfKeyStrokes
rand() % SizeOfArray
delay for rand() milliseconds (the lower the range, the faster the key strokes are)
send via an API or as a string
For more information on sending a keystrike to an application on windows, research the API FindWindow and SendMessage