Re: Accessing the Windows message pump from LW/CAPI
Raymond, did you mean to register-module the Win32 library, or were
you talking about other, third-party C libs?
Thanks,
Edi.
On Wed, Aug 11, 2010 at 4:12 PM, Raymond C Laning <rclaning@raytheon.com> wrote:
> One note -
>
> I found that, for processes with their own non-CAPI window, their own
> message pump and a foreign library, I had to call register-module in that
> process to avoid problems w/CAPI's windows library.
>
> Raymond Laning
> Principal Systems Engr
> Missile Systems
> Raytheon Company
>
>
>
>
> 520.794.7924
> rclaning@raytheon.com
>
>
>
> 1151 E Hermans Rd
> Tucson, AZ 85756 www.raytheon.com
>
>
> (Embedded image moved to file: pic03474.gif)Raytheon Sustainability
>
> This message contains information that may be confidential and privileged.
> Unless you are the addressee (or authorized to receive mail for the
> addressee), you should not use, copy or disclose to anyone this message or
> any information contained in this message. If you have received this message
> in error, please so advise the sender by reply e-mail and delete this
> message. Thank you for your cooperation.
>
>
>
>
>
>
>
>
> From: Martin Simmons <martin@lispworks.com>
>
> To: lisp-hug@lispworks.com
>
> Date: 08/11/2010 05:19 AM
>
> Subject: Re: Accessing the Windows message pump from LW/CAPI
>
> Sent by: owner-lisp-hug@lispworks.com
>
>
>
>
>
>
>
>>>>>> On Wed, 11 Aug 2010 13:16:07 +0200, Edi Weitz said:
>>
>> And here's a second question, not directly related to my previous one:
>>
>> The C library I'm interfacing to is meant to be used in such a way
>> that a Windows programming talking with it has to modify the Windows
>> message pump. It has to call GetMessage, inspect the message to see
>> if it's for the library and hand it over, and only send all other
>> (i.e. normal) messages to the usual TranslateMessage, DispatchMessage
>> mechanism.
>>
>> This is, I think, something than can't be done in CAPI. What I came
>> up with is the following: I start a new ("worker") thread which
>> creates (using Win32 functions directly) a new hidden window and then
>> establishes its own message pump which it also uses to communicate
>> with the rest of the program.
>>
>> Does this sound feasible or does anybody expect a problem there? Am I
>> right to assume that if a new thread creates its own window that it
>> gets its own message queue from Windows which CAPI won't interfer with
>> because I'm not using CAPI in this thread? Or is this approach
>> doomed?
>>
>> Or is there a much better and elegant way to hook into the message
>> pump in CAPI?
>
> Your approach will work fine. Window handles are owned by the thread that
> creates them and by default will use a per-thread message queue.
>
> --
> Martin Simmons
> LispWorks Ltd
> http://www.lispworks.com/
>
>