From: Jovdbroe
Subject: Windows, handles and ACL
Date: 
Message-ID: <YdqdnYKOwKf8tRjeRVnyrw@scarlet.biz>
Hi all,

I'm looking for some documentation, information anything about using 
Windows' handles and Allegro Common Lisp.
What I'm trying to is use ACL to get a handle on an external window on a 
Windows system. (I have done stuff like this with unworthy languages 
like VB)
I've googled around and all I've found was this;
> Q) How can I send messages to the windows of other applications?
> 
> A) For toplevel windows, you can get the handle easily from the title
> of the window (or just the first part of the title, I think) using the
> Windows API function win:FindWindow.  Then you can use other Windows
> API functions (including SendMessage) to send messages to that handle.
> This simple example will expose the program manager:
> 
> (win:SetActiveWindow (win:FindWindow ct:null "Program Manager" :static)
> 
> Ask about [pcspr258] for ideas on finding launched applications
> without using window titles, and on finding non-toplevel windows of
> other applications.
from
http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/impl/allegro/faq/acl4w.faq
And some non-ACL code on Japanese pages.
(The ACL "help on symbol" documentation points to a 404 btw)
I've found findWindow still present, although I'm most likely passing it 
the wrong arguments (ct:null no longer exists)
I'm hoping someone can help me out with this,

Thanks,
Johan
From: Jovdbroe
Subject: Re: Windows, handles and ACL
Date: 
Message-ID: <U6-dndudLKAj6BveRVnyvQ@scarlet.biz>
Hi,

Turn out all I needed was "string-to-native";
(win:FindWindow 0 (string-to-native "Program Manager"))
All it took was 2 days and a round-trip through foreign functions :-)

Cheers,
Johan

Jovdbroe wrote:
> Hi all,
> 
> I'm looking for some documentation, information anything about using 
> Windows' handles and Allegro Common Lisp.
> What I'm trying to is use ACL to get a handle on an external window on a 
> Windows system. (I have done stuff like this with unworthy languages 
> like VB)
> I've googled around and all I've found was this;
> 
>> Q) How can I send messages to the windows of other applications?
>>
>> A) For toplevel windows, you can get the handle easily from the title
>> of the window (or just the first part of the title, I think) using the
>> Windows API function win:FindWindow.  Then you can use other Windows
>> API functions (including SendMessage) to send messages to that handle.
>> This simple example will expose the program manager:
>>
>> (win:SetActiveWindow (win:FindWindow ct:null "Program Manager" :static)
>>
>> Ask about [pcspr258] for ideas on finding launched applications
>> without using window titles, and on finding non-toplevel windows of
>> other applications.
> 
> from
> http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/impl/allegro/faq/acl4w.faq 
> 
> And some non-ACL code on Japanese pages.
> (The ACL "help on symbol" documentation points to a 404 btw)
> I've found findWindow still present, although I'm most likely passing it 
> the wrong arguments (ct:null no longer exists)
> I'm hoping someone can help me out with this,
> 
> Thanks,
> Johan