Jump to content
Sign in to follow this  
Vindicator209

ClipBoard

Recommended Posts

Vindicator209

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]

Share this post


Link to post
Share on other sites
Armand

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 ?!

Share this post


Link to post
Share on other sites
poisonkiller

#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

Share this post


Link to post
Share on other sites
Vindicator209

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]

Share this post


Link to post
Share on other sites
poisonkiller

_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

Share this post


Link to post
Share on other sites
Vindicator209

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]

Share this post


Link to post
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
Sign in to follow this  

×