Jump to content
Sign in to follow this  
Paulie

Mouse tails

Recommended Posts

Wow thanks mandar, that TOTALLY pwns mine

I'm just gonna do the invisible region things, and then its all good

Share this post


Link to post
Share on other sites

I'd like to see that. :)

I'll check back here tomorrow. Goodnight.

Finished with GUI and regions

Heres code:

#include <GuiConstants.au3>
#include <Misc.au3>
Dim $window[100], $letter[100], $label[100],$loc, $loc1, $locA, $locB, $Count, $TBS_FIXEDLENGTH,$apos[30][2], $color=""

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Mousetail Properties", 450, 250, -1, -1, -1, BitOR($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
GUISetBkColor(0x716F64)
$wordInput = GUICtrlCreateInput("Mousetails", 30, 16, 200, 25)
GUICtrlSetFont(-1, 8, 800, 0, "Lucida Console")
GUICtrlSetColor(-1, 0x303030)
$Label1 = GUICtrlCreateLabel("Text to display", 240, 16, 140, 25)
GUICtrlSetFont(-1, 10, 800, 4, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
GUICtrlSetFont(-1, 10, 800, 4, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
GUICtrlSetFont(-1, 10, 800, 0, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
$Go = GUICtrlCreateButton("Create Mousetail", 100, 135, 250, 30, BitOR($BS_DEFPUSHBUTTON,$BS_CENTER), $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
$scroller = GUICtrlCreateLabel("MouseTails by Paulie and Mandar", 0, 184, 450, 31)
GUICtrlSetFont(-1, 18, 400, 0, "Banner")
GUICtrlSetColor(-1, 0xC0C0C0)
GUICtrlSetBkColor(-1, 0x716F64)
$ColorButton = GUICtrlCreateButton("Color", 175, 64, 100, 30, $BS_CENTER, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $Scollpos = ControlGetPos("Mousetail Properties", "", $scroller)
    Global $word = GUICtrlRead($wordInput)
    If $Scollpos[0] < 450 Then 
        ControlMove("Mousetail Properties", "", $scroller, $Scollpos[0]+1, $Scollpos[1])
    Else
        ControlMove("Mousetail Properties", "", $scroller, -450, $Scollpos[1])
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Go
            Starter()
        Case $ColorButton
            Global $color = _ChooseColor(2, 0xFF000, 2)
    EndSwitch
WEnd

Func Starter()
Global $Count = StringLen($word)
$Letter = StringSplit($word, "")
For $integer1 = 1 to $count
    $pos = MouseGetPos()
    $window[$integer1] = GUICreate($Integer1, 20, 20, $pos[0]+(20*$integer1), $pos[1]+(20*$integer1),$Ws_POPUP,Bitor($WS_EX_TOOLWINDOW,$WS_EX_Topmost))
    If not $color = "" then
    GUISetBkColor($color)
    Else
    GUISetBkColor(0x00000)
    Endif
    $Label[$Integer1] = CreateTextRgn($window[$integer1],$letter[$integer1],20,"Lucida Console",500)
    GuiSetState(@SW_SHOW)
SetWindowRgn($Window[$integer1],$Label[$Integer1])
Next

    
While 1
    $Scollpos = ControlGetPos("Mousetail Properties", "", $scroller)
    If $Scollpos[0] < 450 Then 
        ControlMove("Mousetail Properties", "", $scroller, $Scollpos[0]+1, $Scollpos[1])
    Else
        ControlMove("Mousetail Properties", "", $scroller, -450, $Scollpos[1])
    EndIf
    For $x = $letter[0] to 1 Step -1
       $apos[$x][0] = $apos[$x-1][0]
       $apos[$x][1] = $apos[$x-1][1]
    Next
    $apos[0][0] = MouseGetPos(0)+2
    $apos[0][1] = MouseGetPos(1)+2
    For $x = 1 to $letter[0]
        WinMove($window[$x],"", $apos[$x][0],$apos[$x][1])
    Next
    Sleep(50)
WEnd
EndFunc

Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc

Func CreateTextRgn(ByRef $CTR_hwnd,$CTR_Text,$CTR_height,$CTR_font="Microsoft Sans Serif",$CTR_weight=1000)
    Local Const $ANSI_CHARSET = 0
    Local Const $OUT_CHARACTER_PRECIS = 2
    Local Const $CLIP_DEFAULT_PRECIS = 0
    Local Const $PROOF_QUALITY = 2
    Local Const $FIXED_PITCH = 1
    Local Const $RGN_XOR = 3
    
    If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif"
    If $CTR_weight = -1 Then $CTR_weight = 50
    Local $gdi_dll = DLLOpen("gdi32.dll")
    Local $CTR_hDC= DLLCall("user32.dll","int","GetDC","hwnd",$CTR_hwnd)
    Local $CTR_hMyFont = DLLCall($gdi_dll,"hwnd","CreateFont","int",$CTR_height,"int",0,"int",0,"int",0, _
                "int",$CTR_weight,"int",0,"int",0,"int",0,"int",$ANSI_CHARSET,"int",$OUT_CHARACTER_PRECIS, _
                "int",$CLIP_DEFAULT_PRECIS,"int",$PROOF_QUALITY,"int",$FIXED_PITCH,"str",$CTR_font )
    Local $CTR_hOldFont = DLLCall($gdi_dll,"hwnd","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hMyFont[0])
    DLLCall($gdi_dll,"int","BeginPath","int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","TextOut","int",$CTR_hDC[0],"int",0,"int",0,"str",$CTR_Text,"int",StringLen($CTR_Text))
    DLLCall($gdi_dll,"int","EndPath","int",$CTR_hDC[0])
    Local $CTR_hRgn1 = DLLCall($gdi_dll,"hwnd","PathToRegion","int",$CTR_hDC[0])
    Local $CTR_rc = DLLStructCreate("int;int;int;int")
    DLLCall($gdi_dll,"int","GetRgnBox","hwnd",$CTR_hRgn1[0],"ptr",DllStructGetPtr($CTR_rc))
    Local $CTR_hRgn2 = DLLCall($gdi_dll,"hwnd","CreateRectRgnIndirect","ptr",DllStructGetPtr($CTR_rc))
    DLLCall($gdi_dll,"int","CombineRgn","hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn1[0],"int",$RGN_XOR)
    DLLCall($gdi_dll,"int","DeleteObject","hwnd",$CTR_hRgn1[0])
    DLLCall("user32.dll","int","ReleaseDC","hwnd",$CTR_hwnd,"int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hOldFont[0])
    DLLClose($gdi_dll)
    Return $CTR_hRgn2[0]
EndFunc

Share this post


Link to post
Share on other sites

You misspelled my name; Die! :)

Nice GUI!

Update:

Faster response time.

GUI disappears when trail is created.

Rewrote my name.

#include <GuiConstants.au3>
#include <Misc.au3>
Dim $window[100], $letter[30], $label[100],$loc, $loc1, $locA, $locB, $Count, $TBS_FIXEDLENGTH,$apos[30][2], $color=""

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Mousetail Properties", 450, 250, -1, -1, -1, BitOR($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
GUISetBkColor(0x716F64)
$wordInput = GUICtrlCreateInput("Mousetails", 30, 16, 200, 25)
GUICtrlSetFont(-1, 8, 800, 0, "Lucida Console")
GUICtrlSetColor(-1, 0x303030)
$Label1 = GUICtrlCreateLabel("Text to display", 240, 16, 140, 25)
GUICtrlSetFont(-1, 10, 800, 4, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
GUICtrlSetFont(-1, 10, 800, 4, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
GUICtrlSetFont(-1, 10, 800, 0, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
$Go = GUICtrlCreateButton("Create Mousetail", 100, 135, 250, 30, BitOR($BS_DEFPUSHBUTTON,$BS_CENTER), $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
$scroller = GUICtrlCreateLabel("MouseTails by Paulie and Manadar", 0, 184, 450, 31)
GUICtrlSetFont(-1, 18, 400, 0, "Banner")
GUICtrlSetColor(-1, 0xC0C0C0)
GUICtrlSetBkColor(-1, 0x716F64)
$ColorButton = GUICtrlCreateButton("Color", 175, 64, 100, 30, $BS_CENTER, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $Scollpos = ControlGetPos("Mousetail Properties", "", $scroller)
    Global $word = GUICtrlRead($wordInput)
    If $Scollpos[0] < 450 Then 
        ControlMove("Mousetail Properties", "", $scroller, $Scollpos[0]+1, $Scollpos[1])
    Else
        ControlMove("Mousetail Properties", "", $scroller, -450, $Scollpos[1])
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Go
            GUISetState(@SW_HIDE)
            Starter()
        Case $ColorButton
            Global $color = _ChooseColor(2, 0xFF000, 2)
    EndSwitch
WEnd

Func Starter()
    Global $Count = StringLen($word)
    $Letter = StringSplit($word, "")
    For $integer1 = 1 to $count
        $pos = MouseGetPos()
        $window[$integer1] = GUICreate($Integer1, 20, 20, $pos[0]+(20*$integer1), $pos[1]+(20*$integer1),$Ws_POPUP,Bitor($WS_EX_TOOLWINDOW,$WS_EX_Topmost))
        If not $color = "" then
        GUISetBkColor($color)
        Else
        GUISetBkColor(0x00000)
        Endif
        $Label[$Integer1] = CreateTextRgn($window[$integer1],$letter[$integer1],20,"Lucida Console",500)
        GuiSetState(@SW_SHOW)
    SetWindowRgn($Window[$integer1],$Label[$Integer1])
    Next

    Dim $SleepTime = 250/$count
        
    While 1
        $Scollpos = ControlGetPos("Mousetail Properties", "", $scroller)
        If $Scollpos[0] < 450 Then 
            ControlMove("Mousetail Properties", "", $scroller, $Scollpos[0]+1, $Scollpos[1])
        Else
            ControlMove("Mousetail Properties", "", $scroller, -450, $Scollpos[1])
        EndIf
        For $x = $letter[0] to 1 Step -1
           $apos[$x][0] = $apos[$x-1][0]
           $apos[$x][1] = $apos[$x-1][1]
        Next
        $apos[0][0] = MouseGetPos(0)+2
        $apos[0][1] = MouseGetPos(1)+2
        For $x = 1 to $letter[0]
            WinMove($window[$x],"", $apos[$x][0],$apos[$x][1])
        Next
        Sleep($SleepTime)
    WEnd
EndFunc

Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc

Func CreateTextRgn(ByRef $CTR_hwnd,$CTR_Text,$CTR_height,$CTR_font="Microsoft Sans Serif",$CTR_weight=1000)
    Local Const $ANSI_CHARSET = 0
    Local Const $OUT_CHARACTER_PRECIS = 2
    Local Const $CLIP_DEFAULT_PRECIS = 0
    Local Const $PROOF_QUALITY = 2
    Local Const $FIXED_PITCH = 1
    Local Const $RGN_XOR = 3
    
    If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif"
    If $CTR_weight = -1 Then $CTR_weight = 50
    Local $gdi_dll = DLLOpen("gdi32.dll")
    Local $CTR_hDC= DLLCall("user32.dll","int","GetDC","hwnd",$CTR_hwnd)
    Local $CTR_hMyFont = DLLCall($gdi_dll,"hwnd","CreateFont","int",$CTR_height,"int",0,"int",0,"int",0, _
                "int",$CTR_weight,"int",0,"int",0,"int",0,"int",$ANSI_CHARSET,"int",$OUT_CHARACTER_PRECIS, _
                "int",$CLIP_DEFAULT_PRECIS,"int",$PROOF_QUALITY,"int",$FIXED_PITCH,"str",$CTR_font )
    Local $CTR_hOldFont = DLLCall($gdi_dll,"hwnd","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hMyFont[0])
    DLLCall($gdi_dll,"int","BeginPath","int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","TextOut","int",$CTR_hDC[0],"int",0,"int",0,"str",$CTR_Text,"int",StringLen($CTR_Text))
    DLLCall($gdi_dll,"int","EndPath","int",$CTR_hDC[0])
    Local $CTR_hRgn1 = DLLCall($gdi_dll,"hwnd","PathToRegion","int",$CTR_hDC[0])
    Local $CTR_rc = DLLStructCreate("int;int;int;int")
    DLLCall($gdi_dll,"int","GetRgnBox","hwnd",$CTR_hRgn1[0],"ptr",DllStructGetPtr($CTR_rc))
    Local $CTR_hRgn2 = DLLCall($gdi_dll,"hwnd","CreateRectRgnIndirect","ptr",DllStructGetPtr($CTR_rc))
    DLLCall($gdi_dll,"int","CombineRgn","hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn1[0],"int",$RGN_XOR)
    DLLCall($gdi_dll,"int","DeleteObject","hwnd",$CTR_hRgn1[0])
    DLLCall("user32.dll","int","ReleaseDC","hwnd",$CTR_hwnd,"int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hOldFont[0])
    DLLClose($gdi_dll)
    Return $CTR_hRgn2[0]
EndFunc
Edited by Manadar

Share this post


Link to post
Share on other sites

You misspelled my name; Die! :)

Nice GUI!

Update:

Faster response time.

GUI disappears when trail is created.

Rewrote my name.

Sorry, lol typo

thanks for the update, I'm now trying to make it so you can change your mouse tail w/o closing the program but for some reason, GUIDelete doesn't seem to work on the windows, I dunno why.

Share this post


Link to post
Share on other sites

LOL, I seen this and started working on it, here's all the further I got.

#include <GUIConstants.au3>

HotKeySet('{esc}','_Terminate')

$Tail = _MouseTailCreate('Test')


While 1
    Sleep(10)
    _MouseTailMove($Tail)
WEnd
Func _Terminate()
    Exit
EndFunc

Func _MouseTailCreate($s_TailText)
    $i_NumberOfGUIs = StringLen($s_TailText)
    $a_MousePos = MouseGetPos()
    Dim $a_GUI[1]
    For $i = 1 To $i_NumberOfGUIs
        ReDim $a_GUI[UBound($a_GUI) + 1]
        $a_GUI[UBound($a_GUI) - 1] = GUICreate('MouseTail.au3',10,15,$a_MousePos[0],$a_MousePos[1],$WS_POPUP)
        GUICtrlCreateLabel(StringMid($s_TailText,$i,1),1,1)
        GUISetState()
    Next
    Return $a_GUI
EndFunc

Func _MouseTailMove($a_Tail)
    Sleep(10)
    $a_MousePos = MouseGetPos()
    $a_OldPosition = $a_MousePos
    If $a_MousePos <> $a_OldPosition Then
        ToolTip($a_MousePos[0])
        If $a_MousePos[0] < $a_OldPosition[0] Then
            For $i = 1 To UBound($a_Tail) - 1 
                WinMove($a_Tail[$i],'',$a_MousePos[0] - ($i * 10),$a_MousePos[1])
            Next
        EndIf
        If $a_MousePos[0] > $a_OldPosition[0] Then
            For $i = 1 To UBound($a_Tail) - 1 
                WinMove($a_Tail[$i],'',$a_MousePos[0] + ($i * 10),$a_MousePos[1])
            Next
        EndIf
    EndIf
EndFunc


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

LOL, I seen this and started working on it, here's all the further I got.

CODE

#include <GUIConstants.au3>

HotKeySet('{esc}','_Terminate')

$Tail = _MouseTailCreate('Test')

While 1

Sleep(10)

_MouseTailMove($Tail)

WEnd

Func _Terminate()

Exit

EndFunc

Func _MouseTailCreate($s_TailText)

$i_NumberOfGUIs = StringLen($s_TailText)

$a_MousePos = MouseGetPos()

Dim $a_GUI[1]For $i = 1 To $i_NumberOfGUIs

ReDim $a_GUI[uBound($a_GUI) + 1]

$a_GUI[uBound($a_GUI) - 1] = GUICreate('MouseTail.au3',10,15,$a_MousePos[0],$a_MousePos[1],$WS_POPUP)

GUICtrlCreateLabel(StringMid($s_TailText,$i,1),1,1)

GUISetState()

Next

Return $a_GUI

EndFunc

Func _MouseTailMove($a_Tail)

Sleep(10)

$a_MousePos = MouseGetPos()

$a_OldPosition = $a_MousePos

If $a_MousePos <> $a_OldPosition Then

ToolTip($a_MousePos[0])

If $a_MousePos[0] < $a_OldPosition[0] Then

For $i = 1 To UBound($a_Tail) - 1

WinMove($a_Tail[$i],'',$a_MousePos[0] - ($i * 10),$a_MousePos[1])

Next

EndIf

If $a_MousePos[0] > $a_OldPosition[0] Then

For $i = 1 To UBound($a_Tail) - 1

WinMove($a_Tail[$i],'',$a_MousePos[0] + ($i * 10),$a_MousePos[1])

Next

EndIf

EndIf

@strate - WHAT THE HECK IS THIS??? When I ran it, it opened up four windows, lol. This is a really wierd script. Works good though...

@Manadar & Paulie - Just one more suggestion. Maybe you could make the label move from right to left versus left to right, that way you can read it normally, like a banner. The way you have it now, you kinda have to read it backwards in a sense the way it comes from the left. Not a huge issue, but just though I'd point it out. Nice Script!

Edited by dandymcgee

Share this post


Link to post
Share on other sites

@strate - WHAT THE HECK IS THIS??? When I ran it, it opened up four windows, lol. This is a really wierd script. Works good though...

@Manadar & Paulie - Just one more suggestion. Maybe you could make the label move from right to left versus left to right, that way you can read it normally, like a banner. The way you have it now, you kinda have to read it backwards in a sense the way it comes from the left. Not a huge issue, but just though I'd point it out. Nice Script!

Good point

#include <GuiConstants.au3>
#include <Misc.au3>
Dim $window[100], $letter[30], $label[100],$loc, $loc1, $locA, $locB, $Count, $TBS_FIXEDLENGTH,$apos[30][2]
Global $color=""

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Mousetail Properties", 450, 250, -1, -1, -1, BitOR($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
GUISetBkColor(0x716F64)
$wordInput = GUICtrlCreateInput("Mousetails", 30, 16, 200, 25)
GUICtrlSetFont(-1, 8, 800, 0, "Lucida Console")
GUICtrlSetColor(-1, 0x303030)
$Label1 = GUICtrlCreateLabel("Text to display", 240, 16, 140, 25)
GUICtrlSetFont(-1, 10, 800, 4, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
GUICtrlSetFont(-1, 10, 800, 4, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
GUICtrlSetFont(-1, 10, 800, 0, "Lucida Console")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x716F64)
$Go = GUICtrlCreateButton("Create Mousetail", 100, 135, 250, 30, BitOR($BS_DEFPUSHBUTTON,$BS_CENTER), $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
$scroller = GUICtrlCreateLabel("MouseTails by Paulie and Manadar", 430, 184, 450, 31)
GUICtrlSetFont(-1, 18, 400, 0, "Banner")
GUICtrlSetColor(-1, 0xC0C0C0)
GUICtrlSetBkColor(-1, 0x716F64)
$CurrentColor = GUICtrlCreateLabel(" ", 300, 65, 50, 30)
GUICtrlSetBkColor(-1,0x000000)
$ColorButton = GUICtrlCreateButton("Color", 175, 64, 100, 30, $BS_CENTER, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Global $word = GUICtrlRead($wordInput)
    $Scollpos = ControlGetPos("Mousetail Properties", "", $scroller)
    If $Scollpos[0] > -450 Then
        ControlMove("Mousetail Properties", "", $scroller, $Scollpos[0]-1, $Scollpos[1])
    Else
        ControlMove("Mousetail Properties", "", $scroller, 445, $Scollpos[1])
    EndIf
    If $color="" Then
        GUICtrlSetBkColor($CurrentColor, 0x00000)
    Else
        GUICtrlSetBkColor($CurrentColor, $color)
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Go
            GUISetState(@SW_HIDE)
            Starter()
        Case $ColorButton
            $color = _ChooseColor(2, 0xFF000)
    EndSwitch
WEnd

Func Starter()
    Global $Count = StringLen($word)
    $Letter = StringSplit($word, "")
    For $integer1 = 1 to $count
        $pos = MouseGetPos()
        $window[$integer1] = GUICreate($Integer1, 20, 20, $pos[0]+(20*$integer1), $pos[1]+(20*$integer1),$Ws_POPUP,Bitor($WS_EX_TOOLWINDOW,$WS_EX_Topmost))
        If not $color = "" then
        GUISetBkColor($color)
        Else
        GUISetBkColor(0x00000)
        Endif
        $Label[$Integer1] = CreateTextRgn($window[$integer1],$letter[$integer1],20,"Lucida Console",500)
        GuiSetState(@SW_SHOW)
    SetWindowRgn($Window[$integer1],$Label[$Integer1])
    Next

    Dim $SleepTime = 250/$count
       
    While 1
            $Scollpos = ControlGetPos("Mousetail Properties", "", $scroller)
    If $Scollpos[0] > -450 Then
        ControlMove("Mousetail Properties", "", $scroller, $Scollpos[0]-1, $Scollpos[1])
    Else
        ControlMove("Mousetail Properties", "", $scroller, 445, $Scollpos[1])
    EndIf
        For $x = $letter[0] to 1 Step -1
           $apos[$x][0] = $apos[$x-1][0]
           $apos[$x][1] = $apos[$x-1][1]
        Next
        $apos[0][0] = MouseGetPos(0)+2
        $apos[0][1] = MouseGetPos(1)+2
        For $x = 1 to $letter[0]
            WinMove($window[$x],"", $apos[$x][0],$apos[$x][1])
        Next
        Sleep($SleepTime)
    WEnd
EndFunc

Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc

Func CreateTextRgn(ByRef $CTR_hwnd,$CTR_Text,$CTR_height,$CTR_font="Microsoft Sans Serif",$CTR_weight=1000)
    Local Const $ANSI_CHARSET = 0
    Local Const $OUT_CHARACTER_PRECIS = 2
    Local Const $CLIP_DEFAULT_PRECIS = 0
    Local Const $PROOF_QUALITY = 2
    Local Const $FIXED_PITCH = 1
    Local Const $RGN_XOR = 3
   
    If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif"
    If $CTR_weight = -1 Then $CTR_weight = 50
    Local $gdi_dll = DLLOpen("gdi32.dll")
    Local $CTR_hDC= DLLCall("user32.dll","int","GetDC","hwnd",$CTR_hwnd)
    Local $CTR_hMyFont = DLLCall($gdi_dll,"hwnd","CreateFont","int",$CTR_height,"int",0,"int",0,"int",0, _
                "int",$CTR_weight,"int",0,"int",0,"int",0,"int",$ANSI_CHARSET,"int",$OUT_CHARACTER_PRECIS, _
                "int",$CLIP_DEFAULT_PRECIS,"int",$PROOF_QUALITY,"int",$FIXED_PITCH,"str",$CTR_font )
    Local $CTR_hOldFont = DLLCall($gdi_dll,"hwnd","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hMyFont[0])
    DLLCall($gdi_dll,"int","BeginPath","int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","TextOut","int",$CTR_hDC[0],"int",0,"int",0,"str",$CTR_Text,"int",StringLen($CTR_Text))
    DLLCall($gdi_dll,"int","EndPath","int",$CTR_hDC[0])
    Local $CTR_hRgn1 = DLLCall($gdi_dll,"hwnd","PathToRegion","int",$CTR_hDC[0])
    Local $CTR_rc = DLLStructCreate("int;int;int;int")
    DLLCall($gdi_dll,"int","GetRgnBox","hwnd",$CTR_hRgn1[0],"ptr",DllStructGetPtr($CTR_rc))
    Local $CTR_hRgn2 = DLLCall($gdi_dll,"hwnd","CreateRectRgnIndirect","ptr",DllStructGetPtr($CTR_rc))
    DLLCall($gdi_dll,"int","CombineRgn","hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn1[0],"int",$RGN_XOR)
    DLLCall($gdi_dll,"int","DeleteObject","hwnd",$CTR_hRgn1[0])
    DLLCall("user32.dll","int","ReleaseDC","hwnd",$CTR_hwnd,"int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hOldFont[0])
    DLLClose($gdi_dll)
    Return $CTR_hRgn2[0]
EndFunc
Edited by Paulie

Share this post


Link to post
Share on other sites

It wasn't different when I checked, maybe I still had the old script in clipboard lol... Lemme check.

EDIT: Yay it works! The world is complete!

Update: added color preview

(See last post)

Share this post


Link to post
Share on other sites

Hmmmm... What's up with the little gray dots? Pic:

EDIT: Just wanted to see if I could confuse you, but it didn't work :). I help down the left button that makes the dotted rectangle, and some of the dots stayed there. I know it's nor your bug, I was just messin with ya. Once again, nice work :P.

Edited by dandymcgee

Share this post


Link to post
Share on other sites

How'd that happen? Did you select things?

Edit: When I select things this happens. This is a bug in windows. Not our script.

To delete the dots, just move your mouse tail over it

Share this post


Link to post
Share on other sites

In your latest (quite fine, I might add) iteration of code, I made a minor tweak. I like the effect better, and at least one other person asked for it above, as well :P

For $x = 1 to $letter[0]
            WinMove($window[$x],"", $apos[$x][0]+(15*($x-1)),$apos[$x][1])
        Next
You can see, it's pretty much still all your code, I just made a few changes I preferred, and since another person had expressed interest in a similar function, I thought I'd post it. Thanks again for making such a nice script! :) Edited by james3mg

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

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  

×
×
  • Create New...