AutoHotkey Community

It is currently May 26th, 2012, 3:26 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: ClipWaitChange function
PostPosted: June 11th, 2005, 11:38 pm 
Offline

Joined: June 11th, 2005, 10:56 pm
Posts: 6
Hi there
I'm pretty new to AHK - seems like a cool tool, thanks guys. Here's my first idea - apologies if I'm duplicating earlier suggestions.

It would be handy to have a function to wait until the clipboard _changes_. This is different from ClipWait which waits until the clipboard contains something.

I think you could implement such a function by calling the WIN API function "SetClipboardViewer" and then catching WM_DRAWCLIPBOARD messages.

Of course I can manage without this function by using a fast loop, saving the clipboard to a variable, comparing the new clipboard with the old. But this is less neat and uses processor time.

The use I have in mind for this function is to implement a multi-level clipboard that remembers the last 50 or so clipboard contents and provides access to them through hot keys. Folk are selling clipboard tools for $20 or more, but it should only be a handful of lines in AHK!

Thanks
A


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2005, 3:22 pm 
Online

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
Check out ArsClip, does what you want, is free, and with sourcecode (Delphi)...

It might be interesting to take a look at how the clipboard is monitored in this program...

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 12th, 2005, 10:20 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
ApplePie wrote:
I think you could implement such a function by calling the WIN API function "SetClipboardViewer" and then catching WM_DRAWCLIPBOARD messages.
Your post was very persuasive. The MSDN docs are quite good in this area so this feature was easy to implement in today's update. Thanks for the suggestion.

Usage details: OnClipboardChange


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 13th, 2005, 11:23 am 
Online

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
Wow! Very cool...

8)

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 24th, 2005, 11:26 am 
Offline

Joined: June 11th, 2005, 10:56 pm
Posts: 6
Apologies for the delay in reply - I've been on holiday and so away from my Computer.

Chris: thanks for an amazingly quick and helpful response to my request. I've switched my script to use the new function, and it's great (I'll be posting the script soon if anyone is interested).

As I expect we all know, it's really important to have for any free tool to have an active maintainer, and AHK cretainly has that - I'm very impressed and I'll be using AHK more.

daonlyfreez: thanks for the reference to the clipboard tool, that looks neat, wish I'd known about that at the start. Mind you I can now do much of what ARSClip can do with my little AHK script:-)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group