Jump to content

TinyPicSharer v 1.0.3.4 New Version 08 June 2013


wakillon
 Share

Recommended Posts

TinyPicSharer :

20130608142234.png

A simple and handy tool for capture window or picture by mouse grab and an uploader for 10 Pic Hosters !

You can also Resize, Convert, Optimize, add WaterMark to your images easily.

(optimization with jpegtran.exeoptipng.exegifsicle.exe command line tools)

In plus it can extract images from Docs (pdf, doc, docx, odt, odp, ppt, pptx, pps, ppsx)

(Doc extraction with b2xtranslator and pdfextract.exe command line tools)

Just Drag'n drop a picture/doc on the Host Logo for load it.

I have replaced Curl by WinHttp functions and TrIDLib.DLL by my own FileGetType function.

 

20130608145543.jpg

 

Previous downloads : 1343

Update of 8 June 2013

source and executable are available in the Download Section

See Tray menu for options.

Double click on his tray icon for restore the gui.

 

>zlib.au3, WinHttp.au3>WinAPIEx UDF are needed. ( Thanks to Ward, trancexx, Yashield )

Hope you 'll find it usefull ! :king:

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

  • 2 months later...

Very good program, easy to use. Thanks Wakillon :)

edited : ok, drag and drop option, very cool, but maybe you could add possibility to choose file with mini hard drive explorer ? and eventually add more websites as imageshack ?

Edited by Ju2fruits
Link to comment
Share on other sites

Very good program, easy to use. Thanks Wakillon :)

edited : ok, drag and drop option, very cool, but maybe you could add possibility to choose file with mini hard drive explorer ? and eventually add more websites as imageshack ?

Thanks Ju2fruits ! Posted Image

Choosing file with explorer is less easy that a quick drag and drop !

I wanted an image uploader based on simplicity for quickly get the uploaded file url,

so add more websites is not in my intentions and Imageshack is also very reliable !

Search on the forum, you'll find others image uploaders with more websites...Posted Image

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Very good program, easy to use. Thanks Wakillon :)

edited : ok, drag and drop option, very cool, but maybe you could add possibility to choose file with mini hard drive explorer ? and eventually add more websites as imageshack ?

with this tool, you can choose between 6 different hosters:

#RequireAdmin
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <ComboConstants.au3>
#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>
#Include <Misc.au3>
#include <Constants.au3>
#Include <ScreenCapture.au3>
#include <GDIPlus.au3>
#include <file.au3>
#include <IE.au3>
Break(0)
Opt("TrayAutoPause",0)
Opt("WinTitleMatchMode", 2)
FileInstall("dvbs-de.lng", @TempDir & "\dvbs-de.lng", 1)
FileInstall("dvbs-en.lng", @TempDir & "\dvbs-en.lng", 1)
$language = "deutsch"
if StringInStr("0409 0809 0c09 1009 1409 1809 1c09 2009 2409 2809 2c09 3009 3409", @OSLang) then
    $language = "english"
endif
Dim $interface
_FileReadToArray(@TempDir & "\dvbs-"&StringLeft($language, 2)&".lng",$interface)
SplashTextOn("LiveSnap", @CRLF & $interface[1], 250, 80)
FileInstall("curl.exe", @TempDir & "\curl.exe", 1)
$datei2 = @TempDir & "\09876.jpg"
Opt ("TrayIconHide", 1)
Opt("GuiOnEventMode", 1)
Global $s_right, $s_down, $newcurl, $waiting, $chars, $show, $ip, $i, $opt4, $Height2, $GUI_2, $s_left, $s_top, $s_width, $s_height, $Width2, $opt3, $fill
$maingui = GuiCreate("LiveSnap compact", 305, 135)
GUISetbkColor(0xe0e0e0)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")
$snip = GuiCtrlCreateButton("", 38, 4, 80, 20)
GUICtrlSetData($snip, "Desktop")
GUICtrlSetOnEvent($snip, "_snip")
$shack = GuiCtrlCreateButton("", 38, 30, 80, 20)
GUICtrlSetData($shack, $interface[9])
GUICtrlSetOnEvent($shack, "_shack")
$c09 = GuiCtrlCreateLabel($interface[29], 217, 116, 90, 14, $SS_CENTER);bereit anzeige
GUICtrlSetColor(-1, 0x008000)
$c08 = GUICtrlCreatelabel ("", 3, 115, 213, 17, $SS_CENTER);url anzeige
GUICtrlSetOnEvent(-1, "_directurl")
$c210 = GUICtrlCreatelabel ("", 154, 2, 149, 3)
GUICtrlSetBkColor(-1, 0x34a2ef)
$c211 = GUICtrlCreatelabel ("", 154, 85, 149, 3)
GUICtrlSetBkColor(-1, 0x34a2ef)
$c212 = GUICtrlCreatelabel ("", 154, 5, 3, 81)
GUICtrlSetBkColor(-1, 0x34a2ef)
$c213 = GUICtrlCreatelabel ("", 300, 5, 3, 81)
GUICtrlSetBkColor(-1, 0x34a2ef)
$oIEp = _IECreateEmbedded ()
$c21 = GUICtrlCreateObj($oIEp, 157, 5, 143, 80)
$oIEp.navigate("about:blank")
repic("empty", 144, 81, 1)
$c23 = GuiCtrlCreateinput("", 55, 60, 30, 17, $ES_NUMBER)
GUICtrlSetLimit (-1, 4)
GUICtrlSetTip ( $c23, $interface[192])
$c24 = GUICtrlCreateCombo ($interface[34], 125, 90, 176, 17, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"[img]URL[/img]|HTML")
$cl2 = GUICtrlCreateCombo ("abload.de", 2, 90, 120, 10, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"imagebanana.com|imageshack.us|img-teufel.de|directupload.net|pic-upload.de")
$dialog = @WindowsDir & "\"
SplashOff()
GuiSetState(@sw_show, $maingui)
$hi = WinGetHandle ("[ACTIVE]")
func repic($rp, $rp1, $rp2, $rp3)
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile($rp)
    $Width = _GDIPlus_ImageGetWidth($hImage)
    $Height = _GDIPlus_ImageGetHeight($hImage)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    $i = $rp1
    $xa = $Width / $rp1
    $tip = ""
    if $Width <> $rp1 and $Height <> $rp2 then $tip = $Width&" * "&$Height&" Pixel"
    while $Height / $xa > $rp2
        $i -= 1
        $xa = $Width / $i
    wend
    $Width2 = $Width
    $Height2 = $Height
    if $Width > $rp1 or $Height > $rp2 then
        $Width2 = int($Width / $xa)
        $Height2 = int($Height / $xa)
    endif
    if $rp2 = 99999 Then
        $width2 = $rp1
        $height2 = int(($rp1/$width)*$height)
    Else
        $Width3 = 0
        $Height3 = 0
        if int(($rp1 - $Width2) / 2) > 1 then $Width3 = int(($rp1 - $Width2) / 2)
        if int(($rp2 - $Height2) / 2) > 1 then $Height3 = int(($rp2 - $Height2) / 2)
        if $rp = "empty" then
            $fill = ""
        Else
            $fill = "<img src =" & $rp & " width="&$Width2&" height="&$Height2&" alt='"&$tip&"'>"
        endif
        if $rp3 = 1 then $oIEp.document.write("<body oncontextmenu='return false' scroll='no' style='border:0;margin-top:"&$Height3&"px; margin-left:"&$Width3&"px;background-color:6479b0'>"&$fill&"</body>")
        $oIEp.refresh
    endif
endfunc
While 1
sleep(20)

If stringinstr (GUICtrlRead($snip), "Cancel") > 0 Then
    GUICtrlSetData($snip, "Desktop")
    if $waiting = 0 Then
        _dis()
        WinSetState ($hi, "", @SW_ENABLE  )
        _area($snip, "Cancel")
        GUIDelete($GUI_2)
        $timestamp = @MDAY & "." & @MON & "." & @YEAR & "--" & @HOUR & "-" & @MIN & "-" & @SEC
        $time2 = StringReplace (StringReplace ($timestamp, "--", "  "), "-", ":")
        if $s_width > 5 and $s_height > 5 then
            $hBitmap = _ScreenCapture_Capture($datei2, $s_left, $s_top, $s_right, $s_down, false)
            repic($datei2, 144, 81, 1)
        endif
        GUICtrlSetState ($snip, $GUI_ENABLE)
        If FileExists($datei2) Then
            _wmark()
            _d2()
            If FileExists (@TempDir & "\curl.txt") Then
                _load()
            else
                _lableer()
            endif
        Else
            _lableer()
        EndIf
        GUICtrlSetColor($c09, 0x008000)
        GUICtrlSetData ($c09, $interface[29])
        _en()
        $waiting = 0
        WinActivate ($hi, $interface[29])
    EndIf
    GUICtrlSetData($snip, "Desktop")
endif

If stringinstr (GUICtrlRead($shack), "Cancel") > 0 Then
    if $waiting = 0 Then
        $typ = "..jpg"
        $fehler = 0
        _dis()
        $datei4pre = FileOpenDialog("Browse...", $dialog, "Images (*.jpg;*.png;*.gif;*.bmp;*.tif)", 1 + 2 + 4)
        $4c2 = StringLeft ($datei4pre, stringinstr ($datei4pre, "|") - 1) & "\"
        $datei4pre = StringTrimLeft ($datei4pre, stringinstr ($datei4pre, "|"))
        $datei4 = $4c2 & $datei4pre
        if stringleft ($datei4, 1) = "\" then $datei4 = stringtrimleft ($datei4, 1)
        GUICtrlSetData($shack, "Cancel")
        $dialog = StringLeft($datei4, StringInStr ($datei4, "\", 0, -1))
        $typ4 = StringRight ($datei4, 3)
        $4log = $datei4
        If @error Then
            $fehler = 0
        elseif $typ4 <> "bmp" AND $typ4 <> "tif" AND $typ4 <> "jpg" AND $typ4 <> "png" AND $typ4 <> "gif" AND $typ4 <> "" then
            MsgBox(16,$interface[18], $interface[68])
            $fehler=1
        elseif StringLen ($datei4) > 0 then
            GUICtrlSetData ($c08, $datei4)
            if (StringLen ($datei4) - StringInStr ($datei4, "\", 0, -1)) > 20 OR StringInStr ($datei4, " ") > 0 then
                FileCopy ($datei4, @TempDir & "\ptmp." & $typ4, 1)
                $datei4 = @TempDir & "\ptmp." & $typ4
            endif
            if StringLen (GUICtrlRead($c08)) = 0 then
                MsgBox(16,$interface[18], $interface[69])
                $datei4 = ""
                $fehler=1
            endif
        else
            $fehler=1
        EndIf
        if $fehler=0 then
            FileDelete (@TempDir & "\curl.txt")
            $timestamp = @MDAY & "." & @MON & "." & @YEAR & "--" & @HOUR & "-" & @MIN & "-" & @SEC
            $time2 = StringReplace (StringReplace ($timestamp, "--", "  "), "-", ":")
            if $typ4 = "gif" then
                $datei5 = $datei2
                $datei2 = $datei4
                _curl($datei2)
                repic($datei2, 144, 81, 1)
            else
                FileCopy ($datei4, $datei2, 1)
                repic($datei2, 144, 81, 1)
                $typ4 = "jpg"
                If FileExists($datei2) Then
                    _wmark()
                endif
            endif
            GUICtrlSetState ($shack, $GUI_ENABLE)
            If FileExists($datei2) Then
                GUICtrlSetState ($shack, $GUI_ENABLE)
                $typ = ".jpg"
                _d2()
                If FileExists (@TempDir & "\curl.txt") Then
                    _load()
                else
                    _lableer()
                endif
            endif
            if $typ4 = "gif" then
                $datei2 = $datei5
                _curl($datei2)
            endif
            GUICtrlSetColor($c09, 0x008000)
            GUICtrlSetData ($c09, $interface[29])
        else
            $dialog = @WindowsDir & "\"
            _lableer()
            WinActivate ($hi, $interface[29])
        EndIf
        $typ = StringRight ($datei2, 4)
        _en()
        $typ4 = ""
        $waiting = 0
        $4log = 0
        WinActivate ($hi, $interface[29])
    EndIf
    GUICtrlSetData($shack, $interface[9])
EndIf
WEnd

Func _Quit()
    if msgbox(68,"LiveSnap",$interface[22]) = 6 then Exit
EndFunc

Func _snip()
    _tv($snip, "Desktop")
EndFunc

Func _shack()
    _tv($shack, $interface[9])
EndFunc

Func _tv($tv1, $tv2)
    Switch GUICtrlRead($tv1)
        Case $tv2
            $ip = 0
            if $tv1 = $snip or $tv1 = $shack then
                if int(guictrlread($c23)) > 2500 then msgbox(16,$interface[18], $interface[79])
                if int(guictrlread($c23)) <= 2500 and $waiting = 0 Then GUICtrlSetData($tv1, "Cancel")
            Else
                if $waiting = 0 Then GUICtrlSetData($tv1, "Cancel")
            endif
        Case else
            _exx()
            GUICtrlSetData($tv1, $tv2)
    EndSwitch
EndFunc

func _exx()
    $ip = -1
    $waiting = 0
    GUICtrlSetData ($c08, "")
    repic("empty", 144, 81, 1)
    FileDelete (@TempDir & "\curl.txt")
    GUICtrlSetData ($c09, $interface[86])
    _en()
endfunc

Func _curl($curl)
    Switch $opt3
        Case "imageshack.us"
            $newcurl = '-F fileupload=@"' & $curl & '" -H Expect: -o curl.txt --location-trusted --url "http://ufo.imageshack.us/"'
        Case "abload.de"
            $newcurl = '-F img0=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.abload.de/upload.php"'
        Case "imagebanana.com"
            $newcurl = '-F upload[]=@"' & $curl & '" -F send=Hochladen! -H  Expect: -o curl.txt --location-trusted --url "http://www.imagebanana.com/"'
        Case "pic-upload.de"
            $newcurl = '-F file=@"' & $curl & '" -F Submit=" Bild Hochladen" -H Expect: -o curl.txt --url "http://www.pic-upload.de/index.php?to=upload"'
        Case "directupload.net"
            $newcurl = '-F bilddatei=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.directupload.net/index.php?mode=upload"'
        Case "img-teufel.de"
            $newcurl = '-F upload_image=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.img-teufel.de/upload.html"'
        Case Else
            Exit MsgBox(16, $interface[18], $interface[97])
    EndSwitch
EndFunc

Func _wmark()
    if int(GUICtrlRead($c23)) > 0 then
        repic($datei2, int(GUICtrlRead($c23)), 99999, 0)
        _GDIPlus_Startup()
        $hBitmap1 = _WinAPI_CreateBitmap($Width2, $Height2, 1, 32)
        $hImage = _GDIPlus_ImageLoadFromFile($datei2)
        $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
        $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1)
        _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $Width2, $Height2)
        _GDIPlus_BitmapDispose($hImage)
        _GDIPlus_ImageSaveToFile($hImage1, $datei2)
        _GDIPlus_BitmapDispose($hImage1)
        _WinAPI_DeleteObject ($hBitmap1)
        _GDIPlus_Shutdown()
    endif
    repic($datei2, 144, 81, 1)
EndFunc

Func _d2()
    $skb = round(FileGetSize ($datei2) / 1024, 2)
    local $foo = Run(FileGetShortName(@TempDir) & "\"  &  "curl.exe " & $newcurl, FileGetShortName(@TempDir) & "\" , @SW_HIDE, $STDERR_CHILD), $line
    GUICtrlSetData ($c09, "uploading...")
    While $ip = 0 and ProcessExists ( "curl.exe")
        $line = StderrRead($foo)
        $line = StringRegExp($line, '\d+', 3)
        if NOT @error then
            if $line[0] = 100 then $line[0] = 99
            GUICtrlSetData ($c09, "uploading " & $line[0] & " %")
        endif
        sleep(50)
        if $waiting = 0 then exitloop
    Wend
    Processclose ( "curl.exe")
    GUICtrlSetData ($c09, "uploading 100 %")
EndFunc

func _load()
    $file = FileOpen(@TempDir & "\" &  "\curl.txt", 0)
    $chars = FileRead($file)
    FileClose($file)
    _filter()
    if stringlen ($chars) > 100 then $chars = "Error"
    $show = $chars
    if stringinstr ($show, ".jpg") > 0 or stringinstr ($show, ".gif") > 0 then
        GUICtrlSetData($c08, $interface[195])
        if GUICtrlRead($c24) = $interface[34] then ClipPut($show & @CRLF)
        if GUICtrlRead($c24) = "HTML" then ClipPut("<img src="""&$show&""">"& @CRLF)
        if stringinstr(GUICtrlRead($c24), "[img]") > 0 then ClipPut("[img]"&$show&"[/img]"& @CRLF)
    Else
        _lableer()
    endif
EndFunc

func _dis()
    $opt3 = GUICtrlRead($cl2)
    _curl($datei2)
    FileDelete ( @TempDir & "\curl.txt" )
    FileDelete ( $datei2 )
    $waiting = 1
    For $i = $snip to $c08
        GUICtrlSetState ($i, $GUI_DISABLE)
    next
    GUICtrlSetState ($c09, $GUI_ENABLE)
    GUICtrlSetColor($c09,0xff0000)
    GUICtrlSetData ($c09, "preparing upload...")
EndFunc

func _en()
    For $i = $snip to $c08
        GUICtrlSetState ($i, $GUI_ENABLE)
    next
    GUICtrlSetData ($c09, $interface[29])
EndFunc

func _filter()
    if $opt3 = "imageshack.us" then
        $result = StringInStr($chars, "url_image_path"" value=""")
        $chars = StringTrimLeft($chars, $result + 22)
        $result = StringInStr($chars, """")
        $res2 = StringLen ($chars)
        $chars = StringTrimRight($chars, $res2 - $result + 1)
        $result = StringInStr($chars, "/")
        $res2 = StringLeft ($chars, $result -1)
        $chars = "http://" & $res2 & ".imageshack.us/" & $chars
    elseif $opt3 = "abload.de" then
        $result = StringInStr($chars, "&quot;;}}")
        $res2 = StringLen ($chars)
        $chars = StringTrimRight($chars, $res2 - $result + 1)
        while StringInStr($chars, ":&quot;") > 0
            $res2 = StringInStr($chars, ":&quot;")
            $chars = StringTrimLeft($chars, $res2 + 6)
        wend
        $chars = "http://www.abload.de/img/" & $chars
    elseif $opt3 = "imagebanana.com" then
        $result = StringInStr($chars, "][IMG]")
        $chars = StringTrimLeft($chars, $result + 5)
        $result = StringInStr($chars, "[")
        $res2 = StringLen ($chars)
        $chars = StringReplace(StringTrimRight($chars, $res2 - $result + 1), "/thumb", "")
    elseif $opt3 = "pic-upload.de" then
        $result = StringInStr($chars, "[IMG]")
        $chars = StringTrimLeft($chars, $result + 4)
        $result = StringInStr($chars, "[/IMG]")
        $res2 = StringLen ($chars)
        $chars = StringTrimRight($chars, $res2 - $result + 1)
        $chars = StringReplace ($chars, "/thumb", "")
    elseif $opt3 = "directupload.net" then
        $result = StringInStr($chars, "[URL=http://www.directupload.net][IMG]")
        $chars = StringTrimLeft($chars, $result + 37)
        $result = StringInStr($chars, "[/IMG]")
        $res2 = StringLen ($chars)
        $chars = StringTrimRight($chars, $res2 - $result + 1)
    elseif $opt3 = "img-teufel.de" then
        $result = StringInStr($chars, "[IMG]http://www.img-teufel.de/uploads/")
        $chars = StringTrimLeft($chars, $result + 4)
        $result = StringInStr($chars, "[/IMG]")
        $res2 = StringLen ($chars)
        $chars = StringTrimRight($chars, $res2 - $result + 1)
    Else
        MsgBox(16, $interface[18], $interface[113])
        Exit
    EndIf
endfunc

Func _lableer()
    GUICtrlSetColor($c09, 0x008000)
    GUICtrlSetData ($c09, $interface[29])
    ClipPut ("")
    repic("empty", 144, 81, 1)
    GUICtrlSetData($c08, "")
    $show = ""
EndFunc

Func IsVisible($handle)
    If BitAnd(WinGetState($handle), 2) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc

Func _directurl()
    if StringInStr ($show, "http://") > 0 Then
        if GUICtrlRead($c24) = $interface[34] then ClipPut($show & @CRLF)
        if GUICtrlRead($c24) = "HTML" then ClipPut("<img src="""&$show&""">"& @CRLF)
        if stringinstr(GUICtrlRead($c24), "[img]") > 0 then ClipPut("[img]"&$show&"[/img]"& @CRLF)
        GUICtrlSetData($c08, $interface[137])
        sleep(400)
        GUICtrlSetData($c08, $interface[195])
    endif
EndFunc

func _area($a1, $a2)
    $var = WinList()
    For $i = 1 to $var[0][0]
        If $var[$i][0] <> "" AND $var[$i][0] <> "start" AND IsVisible($var[$i][1]) Then WinSetState ($var[$i][0], "", @SW_DISABLE  )
    Next
    $GUI_2 = GUICreate("", 1, 1, -1, -1, 0x80000000 + 0x00800000, 0x00000008)
    GUISetBkColor(0x0c6eec)
    WinSetTrans($GUI_2, "", 130)
    local $s_left = "", $s_top = "", $s_width = "", $s_height = "", $mgp[2]
    $mpos = MouseGetPos()
    Local $hGUI_Cross = GUICreate("", 30, 30,  $mpos[0], $mpos[1], $WS_POPUP, $WS_DISABLED + $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
    GUISetState(@SW_SHOW, $hGUI_Cross)
    WinSetTrans($hGUI_Cross, "", 1)
    GUISetCursor(3)
    $x = WinGetPos($hi)
    $y = 0
    ToolTip($interface[199] & @CRLF & $interface[200] & @CRLF & @CRLF & $interface[201], $x[0]+160, $x[1]+35)
    $ii = GUICtrlRead($a1)
    $i = _Timer_Init()
    While Not _IsPressed(01)
        if _Timer_Diff($i) > 400 then
            GUICtrlSetData($a1, "")
        endif
        if _Timer_Diff($i) > 800 then
            $i = _Timer_Init()
            GUICtrlSetData($a1, $ii)
        endif
        $mgp = MouseGetPos()
        WinMove($hGUI_Cross, "", $mgp[0] - 15, $mgp[1] - 15)
        Sleep(20)
        if $y < 61 then $y += 1
        if $y = 15 or $y = 45 then ToolTip("")
        if $y = 30 or $y = 60 then ToolTip($interface[199] & @CRLF & $interface[200] & @CRLF & @CRLF & $interface[201], $x[0]+160, $x[1]+35)
        if _IsPressed("1B") then exitloop
    WEnd
    GUICtrlSetData($a1, $a2)
    WinMove($GUI_2, "", $mgp[0], $mgp[1], 1, 1)
    GUISetState(@SW_SHOW, $GUI_2)
    if _IsPressed(01) then
        While _IsPressed(01)
            $mgp_2 = MouseGetPos()
            If $mgp_2[0] > $mgp[0] And $mgp_2[1] > $mgp[1] Then
                local $s_left = $mgp[0], $s_top = $mgp[1], $s_width = $mgp_2[0] - $mgp[0], $s_height = $mgp_2[1] - $mgp[1], $s_right = $mgp_2[0], $s_down = $mgp_2[1]
            ElseIf $mgp_2[0] > $mgp[0] And $mgp_2[1] < $mgp[1] Then
                Local $s_left = $mgp[0], $s_top = $mgp_2[1], $s_width = $mgp_2[0] - $mgp[0], $s_height = $mgp[1] - $mgp_2[1], $s_right = $mgp_2[0], $s_down = $mgp[1]
            ElseIf $mgp_2[0] < $mgp[0] And $mgp_2[1] > $mgp[1] Then
                Local $s_left = $mgp_2[0], $s_top = $mgp[1], $s_width = $mgp[0] - $mgp_2[0], $s_height = $mgp_2[1] - $mgp[1], $s_right = $mgp[0], $s_down = $mgp_2[1]
            ElseIf $mgp_2[0] < $mgp[0] And $mgp_2[1] < $mgp[1] Then
                Local $s_left = $mgp_2[0], $s_top = $mgp_2[1], $s_width = $mgp[0] - $mgp_2[0], $s_height = $mgp[1] - $mgp_2[1], $s_right = $mgp[0], $s_down = $mgp[1]
            EndIf
            WinMove($GUI_2, "", $s_left, $s_top, $s_width, $s_height)
            ToolTip($s_width & "x" & $s_height)
            sleep(5)
        WEnd
    endif
    ToolTip("")
    GUIDelete($hGUI_Cross)
    GLOBAL $s_left = $s_left, $s_top = $s_top, $s_width = $s_width, $s_height = $s_height, $s_right = $s_right, $s_down = $s_down
    $var = WinList()
    For $i = 1 to $var[0][0]
        If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then WinSetState ($var[$i][0], "", @SW_ENABLE  )
    Next
endfunc

Posted Image

langfiles.rar

Link to comment
Share on other sites

  • 5 months later...

Any Idea why this would not work on win7 32?

well it worked the first attempt but failed on all next attempts with "An error occurred" Msgbox, indicating a link to uploaded image not present in the _PicUpload() function.

Both drag and drop and mouse capture fail. Then it worked again, then it did not :)

Is there a time limit between uploading at that website? I didnt see anything in the TOS

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 3 months later...
  • 4 months later...

won't start:

C:UsersUserDesktoprereerwewd.au3(24,10) : ERROR: can't open include file <APIConstants.au3>

#Include <APIConstants.au3>

~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(25,10) : ERROR: can't open include file <WinAPIEx.au3>

#Include <WinAPIEx.au3>

~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(67,103) : WARNING: $WS_EX_ACCEPTFILES: possibly used before declaration.

@DesktopHeight - $_GuiHeight - _GetTaskbarHeight ( )- $_StatusBarHeight - 20, -1, $WS_EX_ACCEPTFILES )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(185,70) : WARNING: $OCR_NORMAL: possibly used before declaration.

_SetCursor ( @WindowsDir & 'cursorsviseur_16885.cur', $OCR_NORMAL )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(186,72) : WARNING: $OCR_IBEAM: possibly used before declaration.

_SetCursor ( @WindowsDir & 'cursorsviseur_16885.cur', $OCR_IBEAM )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(190,63) : WARNING: $WS_POPUP: possibly used before declaration.

$_MouseGui = GUICreate ( '', 1, 1, 1, 1, BitOR ( $WS_POPUP,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(190,75) : WARNING: $WS_BORDER: possibly used before declaration.

$_MouseGui = GUICreate ( '', 1, 1, 1, 1, BitOR ( $WS_POPUP, $WS_BORDER,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(190,94) : WARNING: $WS_CLIPSIBLINGS: possibly used before declaration.

$_MouseGui = GUICreate ( '', 1, 1, 1, 1, BitOR ( $WS_POPUP, $WS_BORDER, $WS_CLIPSIBLINGS )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(190,119) : WARNING: $WS_EX_TOPMOST: possibly used before declaration.

$_MouseGui = GUICreate ( '', 1, 1, 1, 1, BitOR ( $WS_POPUP, $WS_BORDER, $WS_CLIPSIBLINGS ), BitOR ( $WS_EX_TOPMOST,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(190,139) : WARNING: $WS_EX_WINDOWEDGE: possibly used before declaration.

$_MouseGui = GUICreate ( '', 1, 1, 1, 1, BitOR ( $WS_POPUP, $WS_BORDER, $WS_CLIPSIBLINGS ), BitOR ( $WS_EX_TOPMOST, $WS_EX_WINDOWEDGE )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(205,79) : WARNING: $SPI_SETCURSORS: possibly used before declaration.

DllCall ( 'user32.dll', 'int', 'SystemParametersInfo', 'int', $SPI_SETCURSORS,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(212,41) : WARNING: $WM_LBUTTONDOWN: possibly used before declaration.

Case $wParam == $WM_LBUTTONDOWN And

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(218,33) : WARNING: $WM_MOUSEMOVE: possibly used before declaration.

Case $wParam == $WM_MOUSEMOVE And

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(240,33) : WARNING: $WM_LBUTTONUP: possibly used before declaration.

Case $wParam == $WM_LBUTTONUP And

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(283,51) : WARNING: $STDERR_CHILD: possibly used before declaration.

$_Pid = Run ( $_Run, '', @SW_HIDE, $STDERR_CHILD +

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(283,67) : WARNING: $STDOUT_CHILD: possibly used before declaration.

$_Pid = Run ( $_Run, '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(384,81) : WARNING: $ASSOCSTR_EXECUTABLE: possibly used before declaration.

$_DefaultBrowser = _WinAPI_AssocQueryString ( '.html', $ASSOCSTR_EXECUTABLE )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(440,57) : WARNING: $RGN_DIFF: possibly used before declaration.

_WinAPI_CombineRgn ( $hREG3, $hREG1, $hREG2, $RGN_DIFF )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(453,93) : WARNING: $SRCCOPY: possibly used before declaration.

_WinAPI_BitBlt ( $CompatibleDC, 0, 0, $IMGE_W, $IMGE_H, $DC, $IMGE_L, $IMGE_T, $SRCCOPY )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(491,24) : WARNING: $TRAY_UNCHECKED: possibly used before declaration.

Case $TRAY_UNCHECKED +

~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(491,38) : WARNING: $TRAY_ENABLE: possibly used before declaration.

Case $TRAY_UNCHECKED + $TRAY_ENABLE

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(494,22) : WARNING: $TRAY_CHECKED: possibly used before declaration.

Case $TRAY_CHECKED +

~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(630,44) : WARNING: $TRAY_EVENT_PRIMARYDOUBLE: possibly used before declaration.

TraySetOnEvent ( $TRAY_EVENT_PRIMARYDOUBLE,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(67,103) : ERROR: $WS_EX_ACCEPTFILES: undeclared global variable.

@DesktopHeight - $_GuiHeight - _GetTaskbarHeight ( )- $_StatusBarHeight - 20, -1, $WS_EX_ACCEPTFILES )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3(384,81) : ERROR: _WinAPI_AssocQueryString(): undefined function.

$_DefaultBrowser = _WinAPI_AssocQueryString ( '.html', $ASSOCSTR_EXECUTABLE )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:UsersUserDesktoprereerwewd.au3 - 4 error(s), 21 warning(s)

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

Very nice, haha just made a smiliar one myself, but working with my FTP and my webserver,

Drag 'n Drop box, grab screen and printscreen,

Then it resizes the image, shows it in a gui and asks if you want it uploaded.

And after upload it gives you the link using clipput()

Link to comment
Share on other sites

Very nice, haha just made a smiliar one myself, but working with my FTP and my webserver,

Drag 'n Drop box, grab screen and printscreen,

Then it resizes the image, shows it in a gui and asks if you want it uploaded.

And after upload it gives you the link using clipput()

Thanks ! :)

Yes something similar...

Skinsharp Skins give it a good look, but I 'm annoyed for animated gifs that ImageShack transforms to statics gifs.

May be Imgur will be added.

@Newb

WinAPIEx UDF Topic link added to the first post. ;)

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Thanks ! ;)

Yes something similar...

Skinsharp Skins give it a good look, but I 'm annoyed for animated gifs that ImageShack transforms to statics gifs.

May be Imgur will be added.

Hmm, ImageShack does resize pictures right? if so it could possibly be that reason.

So find a site that does not resize the picture, tho im guessing most sites probably do it.

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

×
×
  • Create New...