erifash Posted December 22, 2004 Share Posted December 22, 2004 (edited) Here is a cool script I just threw together. It copies the clipboard to a GUI combobox and you select what you want to re-copy. Useful if you're copying multiple functions between programs or from the help file. It's like a shopping cart!Here's the code:(Thanks to Valik for the Semaphore function!)(Thanks to gosu for the idea here!)expandcollapse popupSingleton("GUI Clipboard Library") #include <GUIConstants.au3> HotkeySet("{ESC}", "myexit") HotkeySet("{F1}", "move") $last = -1 GUICreate("GUI Clipboard Library", 400, 21, 25, 1, $WS_EX_TOPMOST + $WS_BORDER + $WS_POPUP, $WS_EX_TOOLWINDOW) $combo = GUICtrlCreateCombo("GUI Clipboard Library", 0, 0, 400, 50) GUISetState() WinSetOnTop("GUI Clipboard Library", "GUI Clipboard Library", 1) While 1 $clip = ClipGet() If $last <> $clip Then GUICtrlSetData($combo, $clip) $msg = GUIGetMsg() Select Case $msg = $combo ClipPut(GUIRead($combo)) $last = ClipGet() $clip = ClipGet() EndSelect Sleep(10) $last = $clip Wend Func Singleton($semaphore) Local $ERROR_ALREADY_EXISTS = 183 DllCall("kernel32.dll", "int", "CreateSemaphore", "int", 0, "long", 1, "long", 1, "str", $semaphore) Local $lastError = DllCall("kernel32.dll", "int", "GetLastError") If $lastError[0] = $ERROR_ALREADY_EXISTS Then Exit -1 EndFunc;==>Semaphore Func move() $pos = MouseGetPos() WinMove("GUI Clipboard Library", "", $pos[0], $pos[1]) EndFunc Func myexit() Exit EndFuncOh, yeah! I forgot: the hotkeys are:{ESC} to exithold down {F1} to move the window to where the mouse is plus you can move the mouse at the same time!^^^(or you can just press it, I like the effect it makes when you hold it )Any questions/comments would be greatly appreciated! Edit: Code updated, put it as "always on top" because it would get lost behind the windows. Edited December 22, 2004 by erifash My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
gosu Posted December 22, 2004 Share Posted December 22, 2004 Here is a cool script I just threw together. It copies the clipboard to a GUI combobox and you select what you want to re-copy. Useful if you're copying multiple functions between programs or from the help file. It's like a shopping cart!Here's the code:(Thanks to Valik for the Semaphore function!)(Thanks to gosu for the idea here!)expandcollapse popupSingleton("GUI Clipboard Library") #include <GUIConstants.au3> HotkeySet("{ESC}", "myexit") HotkeySet("{F1}", "move") $last = -1 GUICreate("GUI Clipboard Library", 400, 21, 25, 1, $WS_EX_TOPMOST + $WS_POPUP, $WS_EX_TOOLWINDOW) $combo = GUICtrlCreateCombo("GUI Clipboard Library", 0, 0, 400, 50) GUISetState() While 1 $clip = ClipGet() If $last <> $clip Then GUICtrlSetData($combo, $clip) $msg = GUIGetMsg() Select Case $msg = $combo ClipPut(GUIRead($combo)) $last = ClipGet() $clip = ClipGet() EndSelect Sleep(10) $last = $clip Wend Func Singleton($semaphore) Local $ERROR_ALREADY_EXISTS = 183 DllCall("kernel32.dll", "int", "CreateSemaphore", "int", 0, "long", 1, "long", 1, "str", $semaphore) Local $lastError = DllCall("kernel32.dll", "int", "GetLastError") If $lastError[0] = $ERROR_ALREADY_EXISTS Then Exit -1 EndFunc;==>Semaphore Func move() $pos = MouseGetPos() WinMove("GUI Clipboard Library", "", $pos[0], $pos[1]) EndFunc Func myexit() Exit EndFuncOh, yeah! I forgot: the hotkeys are:{ESC} to exithold down {F1} to move the window to where the mouse is plus you can move the mouse at the same time!^^^(or you can just press it, I like the effect it makes when you hold it )Any questions/comments would be greatly appreciated! <{POST_SNAPBACK}>Cool Script!And np, this is what open source is about: everyone can modify/"steal" everything (man, I like open source. Because of open source, there are so many programs, because everyone can edit what he needs and make the program better!) [quote name='d2hacker88' date='Jan 6 2005, 05:10 PM']Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.[right][snapback]52215[/snapback][/right][/quote] Link to comment Share on other sites More sharing options...
erifash Posted December 22, 2004 Author Share Posted December 22, 2004 Cool Script!And np, this is what open source is about: everyone can modify/"steal" everything (man, I like open source. Because of open source, there are so many programs, because everyone can edit what he needs and make the program better!)<{POST_SNAPBACK}>Yes, exactly. You can modify anything you need to make it better or more suit your OS. My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
roboz Posted January 3, 2005 Share Posted January 3, 2005 That's a great little script. It will be very useful in my everyday work. Since I'm still a newbie when it comes to programming and AuoIT I have a question about the two marked lines below. Do I really need them? It seems to work correctly without. Sorry if this is a very basic question or the wrong forum for that. I'm just trying to understand the script. Maybe I should look at it tomorrow again - it's too late anyway Thanks for any reply and for sharing this script with us While 1 $clip = ClipGet() If $last <> $clip Then GUICtrlSetData($combo, $clip) $msg = GUIGetMsg() Select Case $msg = $combo ClipPut(GUIRead($combo)) $last = ClipGet() <=== $clip = ClipGet() <=== EndSelect Sleep(10) $last = $clip Wend Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now