🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1856

Re: Duplicating keyboard messages...?

#1856
From: Risto Lankinen
Date: Mon, 25 Mar 1991 08:50
24 lines
1447 bytes
lwallace@javelin.es.com (Raptor) writes:

>Hi all, I'm trying to write sort of a macro recorder.  It'll send imaginary
>keystrokes to other applications in an effort to invoke some of their menu
>accelerator functions.

>I've sent WM_KEYUPs and WM_KEYDOWNs to other applications, and used Spy to
>examine them.

Hi!

Since you cannot be sure whether the target reacts upon WM_KEYUP/DOWN or
the resulting WM_CHAR/SYSCHAR/MENUCHAR message, you should not send these
messages with SendMessage(), because they bypass the target application's
TranslateMessage() call in its message loop.  You should use PostMessage()
instead, which allows the target app. to translate the WM_KEYUP/DOWN's as
appropriate.

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              2   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME!  Now working on 2 +1 *
replies: risto@yj.data.nokia.fi     ***************************************
Technical Details
Message-ID: <1108@tuura.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!news.funet.fi!fuug!tuura!risto
References: <1991Mar19.164227.19245@javelin.es.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!news.funet.fi!fuug!tuura!risto
From: risto@tuura.UUCP (Risto Lankinen)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Duplicating keyboard messages...?
Message-ID: <1108@tuura.UUCP>
Date: 25 Mar 91 08:50:40 GMT
References: <1991Mar19.164227.19245@javelin.es.com>
Organization: Nokia Data Systems Oy
Lines: 24