|
|||
|
A part of this question is about Lisp/Lisp tools, but other parts of it
are not. This is a project that has been brewing for some time, and I would love to hack it in Lisp, but want to see the lay of the land before I pick my tools. I want to build an application that continuously record information about everything that is sent to the clipboard. For the sake of concreteness, imagine a Windows PC, and imagine that I run applications like Firefox, Word, Outlook/Thunderbird, Notepad, Allegro CL IDE. Also imagine that whenever I select some text/images/etc in any of the apps and issue a double-right-click, I want my application to grab 1) the text/image/etc, 2) the datetime, and 3) a reference to the document (URL for a website, path for a local file, sender/date/subject for email, etc). The goal is to make my personal assistant that remembers things that I care about. Are there parts of this application that will be very hard or impossible to do in Lisp? The other choice will be to build application-specific tools like a Firefox extension, or use .NET. I would rather use Lisp, but recommendations about stuff that I could reuse and things to know before I get started on this will be great. Thank you. |
|
|
||||
|
||||
|
|
|
|||
|
remixer wrote:
> Are there parts of this application that will be very hard or > impossible to do in Lisp? The other choice will be to build > application-specific tools like a Firefox extension, or use .NET. I > would rather use Lisp, but recommendations about stuff that I could > reuse and things to know before I get started on this will be great. Maybe RDNZL is what you need? It's a ibrary for common lisp interaction with .NET http://weitz.de/rdnzl/ -- -asbjxrn |
|
|||
|
Asbjørn Bjørnstad wrote: > remixer wrote: > > > Are there parts of this application that will be very hard or > > impossible to do in Lisp? The other choice will be to build > > application-specific tools like a Firefox extension, or use .NET. I > > would rather use Lisp, but recommendations about stuff that I could > > reuse and things to know before I get started on this will be great. > > Maybe RDNZL is what you need? It's a ibrary for common lisp > interaction with .NET > > http://weitz.de/rdnzl/ Thanks. I looked at RDNZL and was also thinking about using Corman Lisp for its Windows support. I was wondering if anyone had more experience building anything like this which possibly interacts with different applications like Word, Email client, etc. Or if there are any examples along those lines. > -- > -asbjxrn |
|
|||
|
remixer wrote: > Asbjørn Bjørnstad wrote: > > remixer wrote: > > > > > Are there parts of this application that will be very hard or > > > impossible to do in Lisp? The other choice will be to build > > > application-specific tools like a Firefox extension, or use .NET. I > > > would rather use Lisp, but recommendations about stuff that I could > > > reuse and things to know before I get started on this will be great. > > > > Maybe RDNZL is what you need? It's a ibrary for common lisp > > interaction with .NET > > > > http://weitz.de/rdnzl/ > > Thanks. I looked at RDNZL and was also thinking about using Corman Lisp > for its Windows support. I was wondering if anyone had more experience > building anything like this which possibly interacts with different > applications like Word, Email client, etc. Or if there are any examples > along those lines. > > > -- > > -asbjxrn If your Lisp has a good FFI, you can just load the user32.dll et al and call the Windows API directly. I've done this before with ECL and it wasn't too bad (using macros to cover over the rough edges helped a lot). Here's a reference to getting start with the clipboard functions. http://msdn.microsoft.com/library/de...nclipboard.asp As for interacting with Word or Email, you'll probably have to stick to COM, which is much harder to do without C++ due to the requirement of precise binary contracts. In general, if you don't have much experience working with Win32 I'd recommend trying it in C++ before Lisp. Not that Lisp is lacking here, but trying to learn FFI and Win32 at the same time would probably make any mortal want to tear their own face off. Asking a Microsoft specific group for help might also help when the going gets tough. Here's a good one, for example: http://groups.google.com/group/comp....ogrammer.win32 |
|
|||
|
dustmop@gmail.com wrote: > remixer wrote: > > Asbjørn Bjørnstad wrote: > > > remixer wrote: > > > > > > > Are there parts of this application that will be very hard or > > > > impossible to do in Lisp? The other choice will be to build > > > > application-specific tools like a Firefox extension, or use .NET. I > > > > would rather use Lisp, but recommendations about stuff that I could > > > > reuse and things to know before I get started on this will be great. > > > > > > Maybe RDNZL is what you need? It's a ibrary for common lisp > > > interaction with .NET > > > > > > http://weitz.de/rdnzl/ > > > > Thanks. I looked at RDNZL and was also thinking about using Corman Lisp > > for its Windows support. I was wondering if anyone had more experience > > building anything like this which possibly interacts with different > > applications like Word, Email client, etc. Or if there are any examples > > along those lines. > > > > > -- > > > -asbjxrn > > If your Lisp has a good FFI, you can just load the user32.dll et al and > call the Windows API directly. I've done this before with ECL and it > wasn't too bad (using macros to cover over the rough edges helped a > lot). Here's a reference to getting start with the clipboard functions. > http://msdn.microsoft.com/library/de...nclipboard.asp Thanks a lot. This is exactly what I want in the first version -- just grab all clipboards. Can you elaborate on "load the user32.dll et al and call the Windows API directly"? Are there any example code fragments for doing this available? Also, which Lisps beside ECL can do this? > As for interacting with Word or Email, you'll probably have to stick to > COM, which is much harder to do without C++ due to the requirement of > precise binary contracts. In general, if you don't have much experience > working with Win32 I'd recommend trying it in C++ before Lisp. Not that > Lisp is lacking here, but trying to learn FFI and Win32 at the same > time would probably make any mortal want to tear their own face off. Yeah maybe I will steer clear of this until I get the basic infrastructure in place. > Asking a Microsoft specific group for help might also help when the > going gets tough. Here's a good one, for example: > http://groups.google.com/group/comp....ogrammer.win32 |
|
|||
|
On 21 Sep 2006 10:35:55 -0700, "remixer" <remixer1@gmail.com> wrote:
> > dustmop@gmail.com wrote: > > > > If your Lisp has a good FFI, you can just load the user32.dll et al and > > call the Windows API directly. I've done this before with ECL and it > > wasn't too bad (using macros to cover over the rough edges helped a > > lot). Here's a reference to getting start with the clipboard functions. > > http://msdn.microsoft.com/library/de...nclipboard.asp > > Thanks a lot. This is exactly what I want in the first version -- just > grab all clipboards. Can you elaborate on "load the user32.dll et al > and call the Windows API directly"? Are there any example code > fragments for doing this available? Also, which Lisps beside ECL can do > this? Each FFI has its own specific details, but all the Lisps you will care about have a mechanism that associates a foreign function (which is the term for a Lisp FFI binding to an external non-Lisp function; you may also see the term 'alien function') with the library providing that function; hence the library will be loaded. If you're not already tied to ECL, you might consider experimenting with CLISP, since it has a win32 bindings module that happens to include the clipboard functions. If you're not interested in CLISP, I suggest that you at least consider writing your FFI code using CFFI (http://common-lisp.net/project/cffi). Also, a terminology note: from your point of view, there is only one clipboard. Clipboard access is restricted to one window at a time, hence the HWND argument to OpenClipboard. It may have data in zero or more formats. > > As for interacting with Word or Email, you'll probably have to stick to > > COM, which is much harder to do without C++ due to the requirement of > > precise binary contracts. In general, if you don't have much experience > > working with Win32 I'd recommend trying it in C++ before Lisp. Not that > > Lisp is lacking here, but trying to learn FFI and Win32 at the same > > time would probably make any mortal want to tear their own face off. > > Yeah maybe I will steer clear of this until I get the basic > infrastructure in place. I have some reservations about the scope of what you are trying to do (consider, for instance, that you will need to register hook functions in order to process mouse clicks within other application windows), but I think it's always good to experiment with ideas :-) > > Asking a Microsoft specific group for help might also help when the > > going gets tough. Here's a good one, for example: > > http://groups.google.com/group/comp....ogrammer.win32 Seconded. -- Jack Unrue |
|
|||
|
remixer wrote: > dustmop@gmail.com wrote: > >>remixer wrote: >> >>>Asbjørn Bjørnstad wrote: >>> >>>>remixer wrote: >>>> >>>> >>>>>Are there parts of this application that will be very hard or >>>>>impossible to do in Lisp? The other choice will be to build >>>>>application-specific tools like a Firefox extension, or use .NET. I >>>>>would rather use Lisp, but recommendations about stuff that I could >>>>>reuse and things to know before I get started on this will be great. >>>> >>>>Maybe RDNZL is what you need? It's a ibrary for common lisp >>>>interaction with .NET >>>> >>>>http://weitz.de/rdnzl/ >>> >>>Thanks. I looked at RDNZL and was also thinking about using Corman Lisp >>>for its Windows support. I was wondering if anyone had more experience >>>building anything like this which possibly interacts with different >>>applications like Word, Email client, etc. Or if there are any examples >>>along those lines. >>> >>> >>>>-- >>>> -asbjxrn >> >>If your Lisp has a good FFI, you can just load the user32.dll et al and >>call the Windows API directly. I've done this before with ECL and it >>wasn't too bad (using macros to cover over the rough edges helped a >>lot). Here's a reference to getting start with the clipboard functions. >>http://msdn.microsoft.com/library/de...nclipboard.asp > > > > Thanks a lot. This is exactly what I want in the first version -- just > grab all clipboards. Can you elaborate on "load the user32.dll et al > and call the Windows API directly"? Are there any example code > fragments for doing this available? Since you are considering Corman CL, the good news is that it has a crapload of examples and predefined bindings to the win32 API. > Also, which Lisps beside ECL can do > this? Check it out: http://common-lisp.net/project/cffi/ But CormanCL has loads of stuff built-in, and one of its users has a web page leading to loads more. kt -- Cells: http://common-lisp.net/project/cells/ "I'll say I'm losing my grip, and it feels terrific." -- Smiling husband to scowling wife, New Yorker cartoon |
|
|||
|
I wrote:
> > Also, a terminology note: from your point of view, there is only one > clipboard. Clipboard access is restricted to one window at a time, > hence the HWND argument to OpenClipboard. It may have data in zero > or more formats. You might also try implementing a clipboard viewer: http://msdn.microsoft.com/library/de...eclipboard.asp and see how that fits into your plans. -- Jack Unrue |
|
|||
|
Ken Tilton wrote: > remixer wrote: > > dustmop@gmail.com wrote: > > > >>remixer wrote: > >> > >>>Asbjørn Bjørnstad wrote: > >>> > >>>>remixer wrote: > >>>> > >>>> > >>>>>Are there parts of this application that will be very hard or > >>>>>impossible to do in Lisp? The other choice will be to build > >>>>>application-specific tools like a Firefox extension, or use .NET. I > >>>>>would rather use Lisp, but recommendations about stuff that I could > >>>>>reuse and things to know before I get started on this will be great. > >>>> > >>>>Maybe RDNZL is what you need? It's a ibrary for common lisp > >>>>interaction with .NET > >>>> > >>>>http://weitz.de/rdnzl/ > >>> > >>>Thanks. I looked at RDNZL and was also thinking about using Corman Lisp > >>>for its Windows support. I was wondering if anyone had more experience > >>>building anything like this which possibly interacts with different > >>>applications like Word, Email client, etc. Or if there are any examples > >>>along those lines. > >>> > >>> > >>>>-- > >>>> -asbjxrn > >> > >>If your Lisp has a good FFI, you can just load the user32.dll et al and > >>call the Windows API directly. I've done this before with ECL and it > >>wasn't too bad (using macros to cover over the rough edges helped a > >>lot). Here's a reference to getting start with the clipboard functions. > >>http://msdn.microsoft.com/library/de...nclipboard.asp > > > > > > > > Thanks a lot. This is exactly what I want in the first version -- just > > grab all clipboards. Can you elaborate on "load the user32.dll et al > > and call the Windows API directly"? Are there any example code > > fragments for doing this available? > > Since you are considering Corman CL, the good news is that it has a > crapload of examples and predefined bindings to the win32 API. > > > Also, which Lisps beside ECL can do > > this? > > Check it out: http://common-lisp.net/project/cffi/ > > But CormanCL has loads of stuff built-in, and one of its users has a web > page leading to loads more. Thanks. I think I will go with Corman -- can you provide me the link to this website you mentioned here? > kt > > -- > Cells: http://common-lisp.net/project/cells/ > > "I'll say I'm losing my grip, and it feels terrific." > -- Smiling husband to scowling wife, New Yorker cartoon |
|
|||
|
remixer wrote: > Ken Tilton wrote: > >>remixer wrote: >> >>>dustmop@gmail.com wrote: >>> >>> >>>>remixer wrote: >>>> >>>> >>>>>Asbjørn Bjørnstad wrote: >>>>> >>>>> >>>>>>remixer wrote: >>>>>> >>>>>> >>>>>> >>>>>>>Are there parts of this application that will be very hard or >>>>>>>impossible to do in Lisp? The other choice will be to build >>>>>>>application-specific tools like a Firefox extension, or use .NET. I >>>>>>>would rather use Lisp, but recommendations about stuff that I could >>>>>>>reuse and things to know before I get started on this will be great. >>>>>> >>>>>>Maybe RDNZL is what you need? It's a ibrary for common lisp >>>>>>interaction with .NET >>>>>> >>>>>>http://weitz.de/rdnzl/ >>>>> >>>>>Thanks. I looked at RDNZL and was also thinking about using Corman Lisp >>>>>for its Windows support. I was wondering if anyone had more experience >>>>>building anything like this which possibly interacts with different >>>>>applications like Word, Email client, etc. Or if there are any examples >>>>>along those lines. >>>>> >>>>> >>>>> >>>>>>-- >>>>>>-asbjxrn >>>> >>>>If your Lisp has a good FFI, you can just load the user32.dll et al and >>>>call the Windows API directly. I've done this before with ECL and it >>>>wasn't too bad (using macros to cover over the rough edges helped a >>>>lot). Here's a reference to getting start with the clipboard functions. >>>>http://msdn.microsoft.com/library/de...nclipboard.asp >>> >>> >>> >>>Thanks a lot. This is exactly what I want in the first version -- just >>>grab all clipboards. Can you elaborate on "load the user32.dll et al >>>and call the Windows API directly"? Are there any example code >>>fragments for doing this available? >> >>Since you are considering Corman CL, the good news is that it has a >>crapload of examples and predefined bindings to the win32 API. >> >> >>>Also, which Lisps beside ECL can do >>>this? >> >>Check it out: http://common-lisp.net/project/cffi/ >> >>But CormanCL has loads of stuff built-in, and one of its users has a web >>page leading to loads more. > > > Thanks. I think I will go with Corman -- can you provide me the link to > this website you mentioned here? Sorry, I should have mentioned that is featured prominently on the Corman site: http://www.double.co.nz/cl/index.htm kt ps. the win32 trial lisps also come with win32 bindings and great FFIs, tho I would recommend CFFI for portability. Last I heard Corman had issues with CFFI. If you know C, mastering FFI should be easy. That in turn opens up scads of libraries, obviating the only rap on CL. k -- Cells: http://common-lisp.net/project/cells/ "I'll say I'm losing my grip, and it feels terrific." -- Smiling husband to scowling wife, New Yorker cartoon |
|
|||
|
Thanks everybody. I am able to read clipboard, based on Chris double's
code very easily. I also stumbled across a clisp implementation on this newsgroup, which looks even cleaner. I want to be able to grab the clipboard *when it changes* (rather than polling it all the time, which is wasteful) As I understand a WM_COPY message or WM_DRAWCLIPBOARD notification is generated when the clipboard changes. How does one make a function that does something when the clipboard change event occurs? I apologize for the naivete and would be happy if you pointed me in the direction of any example code fragment that shows how to respond to a windows event notification. I would be ecstatic if it was using CLISP. Thanks. |
|
|||
|
On 23 Sep 2006 20:08:09 -0700, "remixer" <remixer1@gmail.com> wrote:
> > As I understand a WM_COPY message or WM_DRAWCLIPBOARD notification is > generated when the clipboard changes. How does one make a function that > does something when the clipboard change event occurs? I apologize for > the naivete and would be happy if you pointed me in the direction of > any example code fragment that shows how to respond to a windows event > notification. I would be ecstatic if it was using CLISP. WM_COPY is a command message sent to a control when one wants to copy the current selection within the control to the clipboard. It's not a notification that your application processes (unless you're implementing a custom control, of course). As you mentioned, WM_DRAWCLIPBOARD is the message you need to process. Here is an introduction to Win32 programming with CL (including the processing of messages) written in terms of LispWorks: http://cl-cookbook.sourceforge.net/win32.html Here is sample code written in terms of SBCL: http://www.lisphacker.com/files/lisp-winapi.tgz http://www.lisphacker.com/files/hello-win32.tgz My library uses CFFI, and here is a pointer to the source file where I process messages (note that my code is more complicated than the previous samples as it attempts to implement somewhat greater functionality): http://common-lisp.net/websvn/filede...isp&rev=0&sc=0 Now that you have some references for general message processing code, you need to delve into the clipboard API to be able to handle WM_DRAWCLIPBOARD. The following article, although written in terms of MFC, covers lots of clipboard topics including the handling of WM_DRAWCLIPBOARD and you might find the whole thing apropos to what you are trying to do: http://www.chiramattel.com/george/De...dex=1&ptabid=5 So the challenge then is to translate that info to the equivalent Lisp code using whichever FFI you've chosen. You will need to search around in the Win32 programming newsgroups for more, as I don't have any Lisp-based sample code for this myself (yet). -- Jack Unrue http://common-lisp.net/project/graphic-forms |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Unable to use Windows shortcuts to access SAS datasets | Arthur Tabachneck | Newsgroup comp.soft-sys.sas | 0 | 01-03-2006 10:46 PM |
| Re: Unable to use Windows shortcuts to access SAS datasets | Droogendyk, Harry | Newsgroup comp.soft-sys.sas | 0 | 12-30-2005 05:46 PM |
| Re: Unable to use Windows shortcuts to access SAS datasets | Choate, Paul@DDS | Newsgroup comp.soft-sys.sas | 0 | 12-29-2005 10:50 PM |
| SAS Access to Oracle | ma015b8234 | Newsgroup comp.soft-sys.sas | 0 | 06-02-2005 06:23 PM |
| Fw: Re: UPDATE ON HELP NEEDED FOR WINDOWS 2003 SETINIT | John F. Regus | Newsgroup comp.soft-sys.sas | 0 | 01-02-2005 05:02 AM |