Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/02/2020 in all areas

  1. Hello Community, today I want to publish my very first AutoIt project... yup, in fact the reason I started AU for , I present to you the AMT - Auto-Movie-Thumbnailer Current Version: v15 (2024-Oct-13) AMT - Auto-Movie-Thumbnailer enables you to create ScreenCaps of any number of movies, located anywhere on your computer, manually or with a time-scheduler, with a free to choose number of caps, the ability to ignore already processed files, a customizable design and most important, it allows you to do it in Batch Mode! The Auto Movie-Thumbnailer is an automation GUI to batch create Screencaps, Thumbnail Index Pictures, Preview Pictures or Contact Sheets for any given number of movies. It supports many different input (AVI, MPG, Quicktime, Real-Media, Windows-Media,.) formats, in fact every input format that is supported by MPlayer. AMT works by remotely controlling the MPlayer, some applications of the ImageMagick Suite and a MediaInfo plugin to perform the screenshoting and Picture creation. Known Problems Short movies might not have enough key-frames (depending on format) for multiple screenshots. E.g. if you want to have 20 screenshots per movie, but the movie only has 10 Key-frames, will get duplicate screenshots. That's because the seek function of MPlayer is controlled by simple math. 20 screenshots means start at 2.5%, next shot 7.5%, 12.5% if now too few key-frames are defined in the movie (during creation process), 7.5% and 12.5% might point to the same key-frame, if for example the movie has a key-frame at 5% and the next at 15%. MPlayer is only capable of seeking key-frames for certain formats. License This program is freeware under Creative Commons License "by-nc-nd 3.0″, and this means, you are free to share, to copy, distribute and transmit the work under the following conditions: Attribution - You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Noncommercial - You may not use this work for commercial purposes. No Derivative Works - You may not alter, transform, or build upon this work. See also http://creativecommons.org/licenses/by-nc-nd/3.0 for details. For any form of distribution of this software a link back to the authors website at http://www.amt.cc is required. It works fine at least on the XP-Pro 32-bit SP3 / Win7 / Win8.1 machines I tested it on. If you find bugs please let me know. Kudos to AdmiralAlkex, Richard Robertson, Draygoes, BrettF & Achilles for Beta-Testing! And to all other regular posters on this forum for sharing their knowledge and helping out! The AMT-Installer can be found under it's own domain at: http://www.amt.cc or at https://funk.eu/amt Enjoy AMT, and let me know what you think of it... Best Regards
    1 point
  2. to deselect you select the original object back in then you clean up that object ^^note here the static objects do not need to be deselected Func GUICtrlGetBkColor_WinAPI_2($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $hDC = _WinAPI_GetDC($hWnd) ; <== Get the DC before you send the message! Local $hBrushOLD = _SendMessage(_WinAPI_GetParent($hWnd), $WM_CTLCOLORSTATIC, $hDC, $hWnd) ; <= Select background hBrush Local $iColor = _WinAPI_GetBkColor($hDC) $hBrushOLD = _WinAPI_SelectObject($hDC, $hBrushOLD) ;put the original object back ;hBrushOLD now contains the brush selected in with _sendMessage above^^ _WinAPI_DeleteObject($hBrushOLD) ;^ Not needed with the static brushes*** _WinAPI_ReleaseDC($hWnd, $hDC) Return $iColor EndFunc ; ==> GUICtrlGetBkColor (WinAPI 2) now as far as the function you referenced here: ElseIf DllStructGetData($tLogBrush, "lbStyle") <> $BS_SOLID Then this only handles the case of a solid brush you would need to expand it to handle other brush types (listed here) https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-logbrush you can choose as many or as few as you care to implement
    1 point
  3. Guess not thanks for helping looking forward to work on this template
    1 point
  4. Melba23

    Adjust scrollbar range

    Andreik, Try this; #include <GuiScrollBars.au3> #include <ScrollBarConstants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <WinAPI.au3> $iRandom = Random(8, 20, 1) $iScrollTo = Random(1, $iRandom, 1) $hMain = GUICreate("Main", 1000, 700) $cScroll = GUICtrlCreateLabel($iScrollTo, 10, 10, 200, 30, BitOR($SS_SUNKEN, $SS_CENTERIMAGE, $SS_CENTER)) $cNumOfLabels = GUICtrlCreateLabel($iRandom, 10, 50, 200, 30, BitOR($SS_SUNKEN, $SS_CENTERIMAGE, $SS_CENTER)) $hChild = GUICreate("", 500, 700, 250, 0, $WS_POPUP, $WS_EX_MDICHILD, $hMain) For $Index = 1 To $iRandom GUICtrlCreateLabel($Index, 10, ($Index - 1) * 480, 480, 480, BitOR($SS_SUNKEN, $SS_CENTERIMAGE, $SS_CENTER)) Next GUISetState(@SW_SHOW, $hMain) GUISetState(@SW_SHOW, $hChild) GUIRegisterMsg($WM_VSCROLL, 'WM_VSCROLL') ; Get the scrollbar max position $iMax = SetWindowScrollbar($hChild, $iRandom * 480) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Calculate the required position ScrollTo(($iScrollTo - 1)/ $iRandom * $iMax) Do Sleep(10) Until GUIGetMsg() = -3 Func WM_VSCROLL($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Local $iIndex = -1, $yChar = 16, $yPos Local $Min, $Max, $Page, $Pos, $TrackPos Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) $Min = DllStructGetData($tSCROLLINFO, "nMin") $Max = DllStructGetData($tSCROLLINFO, "nMax") $Page = DllStructGetData($tSCROLLINFO, "nPage") $yPos = DllStructGetData($tSCROLLINFO, "nPos") $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") $Pos = $yPos Switch $nScrollCode Case $SB_TOP DllStructSetData($tSCROLLINFO, "nPos", $Min) Case $SB_BOTTOM DllStructSetData($tSCROLLINFO, "nPos", $Max) Case $SB_LINEUP DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) Case $SB_LINEDOWN DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) Case $SB_PAGEUP DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) Case $SB_PAGEDOWN DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) Case $SB_THUMBTRACK DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) EndSwitch DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) $Pos = DllStructGetData($tSCROLLINFO, "nPos") If ($Pos <> $yPos) Then _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos)) $yPos = $Pos EndIf Return 0 EndFunc Func SetWindowScrollbar($hWnd, $iHeight) Local $iCharHeight = 16 Local $aClient = WinGetClientSize($hWnd) If $iHeight <= $aClient[1] Then Return 0 ; You need to activate the scrollbar!!!!!!! _GUIScrollBars_Init($hWnd) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, False) _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, True) Local $iPage = Floor($aClient[1] / $iCharHeight) Local $iMaxSize = Floor($iHeight / $iCharHeight) _GUIScrollBars_SetScrollInfoMax($hWnd, $SB_VERT, $iMaxSize) _GUIScrollBars_SetScrollInfoPage($hWnd, $SB_VERT, $iPage) ; Return the max size Return $iMaxSize ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EndFunc Func ScrollTo($iVal) ; And move the scrollbar _GUIScrollBars_SetScrollInfoPos($hChild, $SB_VERT, $iVal) ; <<<<<<<<<<<<<<<<<<<< EndFunc M23
    1 point
  5. @Professor_Bernd _SendMessage($hParent, $WM_CTLCOLORSTATIC, $hDC, $hWnd) This actually selects the background brush into the hdc It starts getting deep quick but its basically this: Windows works on the mantra of 'don't store anything that you can recalculate later' So windows doesn't know what background the hdc has until it is time to redraw the hdc you request that it does that calculation and hold on to the brush Warning: Non system brushes need to be deselected from the DC * save the hbrush returned by sendmessage() and reselect it in to the DC (IIRC its NULL_BRUSH) <in the case of a system brush (the SOLID ones) you don't need to deselect the brush when you are done but you still can.. >
    1 point
  6. Yeah, just that. This advice not only applies to AutoIt, even if this platform is especially sensitive to this form of attack over inner data or code.
    1 point
  7. The winmove function has a resize option. Try this change in the _WM_SIZE function: WinMove($hGUI_Child_Webapp, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110, $aGUI_Main_Pos[2]-50, $aGUI_Main_Pos[3]-120) It resizes the one window when the main window is resized.
    1 point
  8. Thanks for sharing the Extension function and methods
    1 point
  9. Friends hi, how do I work with two regex? My example code $aWebAdress = "https://autoitscripttr.blogspot.com/atom.xml" $aGetNewConnect = Connections($aWebAdress) $aUrlregex1 = StringRegExp($aGetNewConnect, "(?i)href='([^']+)",3) $aUrlregex2 = StringRegExp($aGetNewConnect, "(?i)href=&quot;([^&]+)",3) $UBoun = UBound($aUrlregex1) Or UBound($aUrlregex2) If isArray($aUrlregex1) Or isArray($aUrlregex1) then For $c in $UBoun ConsoleWrite($UBoun[$c] & @CRLF) ConsoleWrite("Count Url : " & $c & @CRLF) Next EndIf Func Connections($address) Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", $address, False) $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0") $oHTTP.SetRequestHeader("Accept-Language", "tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3") $oHTTP.Send() If @error Then ConsoleWrite("Line : " & @ScriptLineNumber & " Connect Error " & @CRLF) $oHTTP = 0 Return SetError(1) EndIf If $oHTTP.Status = 200 Then Local $sReceived = $oHTTP.ResponseText $oHTTP = Null Return $sReceived EndIf $oHTTP = Null Return -1 EndFunc
    1 point
  10. Skorm92, Look in my Toast UDF - the _Toast_Locate function shows how I determine the taskbar position and location by getting the available workarea size via a SystemParametersInfoW call. M23
    1 point
×
×
  • Create New...