Recent

Author Topic: Delve into Vb6 Time - Sendkeys for Windows  (Read 874 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1118
    • Pixelink Media
Re: Delve into Vb6 Time - Sendkeys for Windows
« Reply #15 on: May 23, 2019, 03:42:43 pm »
It looks good. It must be your Quick Scripts software.

After you finish it, you should proudly add a link and write some info on Lazarus Appication Gallery:
http://wiki.freepascal.org/Lazarus_Application_Gallery

No, Quick Script is an app I made so employees can read a pre-dfined text (aka a "Script") while on the phone.

This is more of an automation - mouse, keys launching programs type of scripting app.
It sends mouse, keystrokes to other programs that are running.
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.02 • Win10 • 16G RAM • Nivida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1118
    • Pixelink Media
Re: Delve into Vb6 Time - Sendkeys for Windows
« Reply #16 on: May 23, 2019, 03:52:47 pm »
From various sources, it seems that most suggest using win API SendMessgae.

I am familiar with that, so I will see how to implement this in my code and test
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.02 • Win10 • 16G RAM • Nivida GForce RTX 2060

Thaddy

  • Hero Member
  • *****
  • Posts: 8681
Re: Delve into Vb6 Time - Sendkeys for Windows
« Reply #17 on: May 23, 2019, 03:54:00 pm »
Did you try this one (or the classic sendkeys unit from delphi):
http://www.delphidabbler.com/tips/181
Most people that want to use threading should learn to patch their jeans first: use a needle.

pixelink

  • Hero Member
  • *****
  • Posts: 1118
    • Pixelink Media
Re: Delve into Vb6 Time - Sendkeys for Windows
« Reply #18 on: May 23, 2019, 04:01:51 pm »
Did you try this one (or the classic sendkeys unit from delphi):
http://www.delphidabbler.com/tips/181

Looks interesting... i will give it a look, THANKS!
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.02 • Win10 • 16G RAM • Nivida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1118
    • Pixelink Media
Re: Delve into Vb6 Time - Sendkeys for Windows
« Reply #19 on: May 23, 2019, 04:22:25 pm »
Okay... used delphi code from link above.

Put it into a test project... works perfectly.

Thanks Thaddy... that is one piece, now I got two more pieces to put in place.

Here is a demo of that code (WINDOWS ONLY!!!)

Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.02 • Win10 • 16G RAM • Nivida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1118
    • Pixelink Media
Re: Delve into Vb6 Time - Sendkeys for Windows
« Reply #20 on: May 23, 2019, 07:03:43 pm »
Okay, got two more pieces working...
All I have left is the Mouse X-Y functions to put in place

This will open notepad automatically, then wait, then activate the opened window (using find window), then wait, then uses sendkeys to send some text to active notepad window

Code: Pascal  [Select]
  1.  
  2. Delay(2000);
  3. AppActivate('Untitled - Notepad');
  4. Delay(2000);
  5. SendKeys('abc123{left}{left}{left}def{end}456{left 6}ghi{end}789', True);  
  6.  
  7.  
« Last Edit: May 23, 2019, 08:39:18 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.02 • Win10 • 16G RAM • Nivida GForce RTX 2060