Jump to content

ClipBoard


Recommended Posts

This script only works the first time... got any ideas?

#include <GUIConstants.au3>
#Include <GuiList.au3>
$Clip2 = 0
$Form1 = GUICreate("ClipBoard", 242, 338, 193, 115)
$List1 = GUICtrlCreateList("", 8, 8, 217, 318)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    $Clip = ClipGet()
    If $Clip = $Clip2 Then
    Sleep(500)
    Else
        $Clip2 = $Clip
        _GUICtrlListAddItem($List1,$Clip2)
    EndIf
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

what do you mean by- works for first run only !?

- do you exit the script and then on second run it fails or do you mean like in 2nd catch ?!

#include <GUIConstants.au3>
#Include <GuiList.au3>
$Clip2 = ""
$Form1 = GUICreate("ClipBoard", 242, 338, 193, 115)
$List1 = GUICtrlCreateList("", 8, 8, 217, 318)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    $Clip = ClipGet()
    If $Clip <> $Clip2 Then
        $Clip2 = $Clip
        _GUICtrlListAddItem($List1,$Clip2)
    EndIf
   
   Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

the above works...

Edited by Armand

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

#include <GUIConstants.au3>
#Include <GuiList.au3>
$Form1 = GUICreate("ClipBoard", 242, 338, 193, 115)
$List1 = GUICtrlCreateList("", 8, 8, 217, 318)
GUISetState(@SW_SHOW)
$Clip2 = ""
$Clip = ClipGet()
While 1
    $nMsg = GUIGetMsg()
    $Clip = ClipGet()
    If $Clip == $Clip2 Then
        Sleep(10)
    Else
        $Clip2 = $Clip
        _GUICtrlListAddItem($List1,$Clip2)
    EndIf
If $nMsg = $GUI_EVENT_CLOSE Then Exit
Wend

Link to comment
Share on other sites

thanks, works nicely...

and one more thing, how do you select something on the list? I saw someting about using $GUI_CHECKED but im not sure thats the one I need...

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

_GUICtrlListSetSel($listbox, 1, $value). If $value = 0 then first item in listbox will be selected, if 1 then second item. $GUI_CHECKED is used only to check or see if radio or checkbox is checked.

Edited by poisonkiller
Link to comment
Share on other sites

thanks much!

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...