🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.programmer.misc
1 messages
1 total messages Started by Andy Kriechhammer Wed, 27 Dec 2000 19:21
Sending keystrokes to Win95 Dos-box
#2897
Author: Andy Kriechhammer
Date: Wed, 27 Dec 2000 19:21
46 lines
2763 bytes
follow up to: comp.os.ms-windows.programmer.misc

How can I send keystrokes to a Console (DOS) application under Win95?

keybd_event() doesn't work in Win 95 for Dos-Boxes, although it works under
NT4.0.

I tried the following:

  // bring console window to foreground
  SetForegroundWindow(hGblForeGroundWindow))

  // Get app process and thread id
  intMyThreadID = GetWindowThreadProcessId(Application->Handle,
&intMyProcessID) ;

  // Get console process and thread id
  intToThreadID = GetWindowThreadProcessId(hGblForeGroundWindow,
&intToProcessID) ;

  // Attach console window thread to app
  AttachThreadInput(intToThreadID, intMyThreadID, TRUE))

  SendMessage(hGblForeGroundWindow, WM_CHAR, Key, lParam)


instead of calling SendMessage() I tried it with keybd_event() called two
times, first for keydown, than for keyup.
It only worked under NT4.0, not under Win95 :-(

SendInput() may work under 98, but I need a solution for 95. The good old
recorder.exe, digged out from Win 3.11 is able to send a recorded macro
containing keystrokes to a Dos-Box, therefore I suppose, this must be able
using just the 16-Bit API.

Any suggestions will be appreciated

TIA

Andy


--
Andy Kriechhammer
http://members.aon.at/kri
OE3ARC KLE500
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads