does anyone know how I would go about creating a program that would type a message into a text box??(Note: this text box would be in another app. and I would like it to type like someone was really doing it) Thanks for your help!
Last edited by poopyman67; Aug 30th, 2003 at 11:46 PM.
Sendkeys is not too reliable. If you have the time and patience try
using APIs which is a more reliable way. Sendkeys depends upon
the application being the active window and if it changes during
execution, only part of the data will be entered.
Some APIs to use...
FindWindow - Finds the handle to the main programs window.
FindWindowEx - Finds the child window ex. textbox control.
SendMessage - Read/Write data to the textbox.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Lightning, with the sleep command, would i be able to pause for .5sec between each keystroke, so that it looks like im typing??? If so, could u show me what it would look like??
RobDog, i would use apis if i could, but i dont know how to do those... sorry!
Last edited by poopyman67; Aug 26th, 2003 at 04:40 PM.
if u don't know what an alphasmart does, it emulates a keyboard, and types in the words when you hook it up to a computer(through the keyboard connector). Does anyone know how to do this??
knowledge, thx alot! However, when i put the code into my form, it says compile error and says constants, fixed length strings, user defined types, and declare statements are not allowed as public members of object modules.
now, i may be doing something wrong. all i did was copy the code directly into my form under general. Am I supposed to put it somewhere else?? Thx!
Hmm.. okay, looks like somebody missed an important part of your education in VB. Modules are a place to put code that is accessible by all of the project. Goto the project menu, the third from 'file', and select 'add module'. In there, put the code commented as module, the rest of the code (commented form), goes into the form. Modules are used to organize code, and allow you to do *some* things to make it easier to call functions.
Now returning to the world of VB. Please make sure your seatbelts are securely fastened and all trays are in their upright and locked position.
hmm, i tryed that, and it seems that the sendkeys command is unable to do such a command.... do I have to manipulate the code another way, or is there another command??
here the code i have.... I don't know how I would add ur code to it though.... how would i do it.. as you can see, i tried to do it, though unsuccessfully....
Hello,
Bad. News. You need to work on your functions, subs, oraganization, placings, and other stuff before you continue to do difficult, or rather simple functions. You don't put a function in a sub... I'll help you this one more post...I don't really have time. And I'm very sorry if I'm mean, but someone told me the same thing. But basically, I can't even read your code...
I'll post the code, correctly... if you change it and mess up...