careca Posted October 26, 2018 Posted October 26, 2018 (edited) Hi, im working on this thing that goes to a weather website and retrieves the max and min temps for today and tomorrow, i already got the images in a folder that show wether its clowdy, rainy whatever. So the issue is that now the image shows up, but what i need is that the 2 images show side-by-side, today->tomorrow but they override each other, i would use _GDIPlus_GraphicsDrawImageRect but the problem is that this is a layered and popup window, it's supposed to the a transparent window and only show the images, this function doesn't seem to work in this manner, or maybe i just dont know how to do it. Another issue is that in the function parameters for _WinAPI_UpdateLayeredWindow $tPTSrce - A $tagPOINT structure or a pointer to it that specifies the location of the layer in the device context Doesnt seem to work and as soon as i set any value other than 0 the image wont even show up. Im confused. Thanks in advance. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** ;#AutoIt3Wrapper_Icon=.ico #AutoIt3Wrapper_UseX64=n ;#AutoIt3Wrapper_Res_Comment=By: ;#AutoIt3Wrapper_Res_Description= #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_Res_SaveSource=y ;#AutoIt3Wrapper_Res_Icon_Add=.ico #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;============================================================================= #Region ;Include + Opt #include <IE.au3> #include <File.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <TrayConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("TrayMenuMode", 3) Opt("TrayIconHide", 0) Opt("GUIResizeMode", 1) Opt("TrayIconDebug", 1) Opt("TrayAutoPause", 0) Opt("MouseCoordMode", 2) Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Opt("GUIEventOptions", 1) Opt("TrayOnEventMode", 1) Opt("ExpandEnvStrings", 1) Opt("WinDetectHiddenText", 1) #EndRegion ;Include + Opt ;============================================================================= #Region ;GuiVars Global $GUI, $Button_1, $hGraphic, $sString, $hFont, $aInfo, $hFormat, $hBrush, $hImageR, $hImage, $hFamily, $tLayout, $IndexDay Global $ExitItem, $Label, $Label1, $oIE, $oDoc, $oElement1, $oElement2, $StringMid, $Split1, $Split2, $Trim, $Number, $ID Global $Visible = 0, $Day = 0 Global Const $AC_SRC_ALPHA = 1 #EndRegion ;GuiVars ;============================================================================= #Region ;GUI ;TraySetIcon(".ico") $GUI = GUICreate('IPMA', 150, 150, @DesktopWidth - 160, @DesktopHeight - 200, $WS_POPUP, $WS_EX_LAYERED) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "Restore") $ExitItem = TrayCreateItem("Close") TrayItemSetOnEvent(-1, "Quit") $Label = GUICtrlCreateLabel('', 20, 100, 70, 50) $Label1 = GUICtrlCreateLabel('', 90, 100, 70, 50) TraySetState(1) TraySetClick(8) _GDIPlus_Startup() GUISetState() #EndRegion ;GUI ;============================================================================= Start() ;============================================================================= Do ;Main Sleep(100) Until GUIGetMsg() = $GUI_EVENT_CLOSE ;============================================================================= Func Start() If WinExists("Instituto") = 0 Then $oIE = _IECreate("http://www.ipma.pt/pt/index.html", 0, $Visible, 1, 1) _IELoadWait($oIE) Else WinActivate("Instituto") $oIE = _IEAttach("Instituto", 'title', 1) EndIf If Not @error Then _Example1() _Example2() _Tomorrow() _Example1() _Example2() _Today() ;============================================================================= _IEQuit($oIE) Else MsgBox(64 + 262144, '', 'Fail') EndIf EndFunc ;==>Start ;============================================================================= Func _Image($IndexDay, $ID) If $IndexDay = 0 Then ConsoleWrite('$IndexDay - ' & $IndexDay & ' - ' & @MSEC & @CRLF) $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\SVG\w_ic_d_' & $ID & 'anim.png') $hImageR = _GDIPlus_ImageResize($hImage, 100, 100, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC) ;$hImageR = _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImageR, 0, 0, 50, 50) SetBitmap($GUI, $hImageR, 255) Else ConsoleWrite('$IndexDay - ' & $IndexDay & ' - ' & @MSEC & @CRLF) $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\SVG\w_ic_d_' & $ID & 'anim.png') $hImageR = _GDIPlus_ImageResize($hImage, 100, 100, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC) ;$hImageR = _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImageR, 0, 0, 50, 50) SetBitmap($GUI, $hImageR, 255) EndIf EndFunc ;==>_Image ;============================================================================= Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) DllStructSetData($tSource, "X", 0) ;Doesn't change image position DllStructSetData($tSource, "Y", 0) ;Doesn't change image position $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>SetBitmap ;============================================================================= Func _Today() Local $oIE_ObjectToClick1 = _IEGetObjById($oIE, 'today') _IEAction($oIE_ObjectToClick1, 'click') _IELoadWait($oIE) ConsoleWrite(@CRLF) $Day = 0 EndFunc ;==>_Today ;============================================================================= Func _Tomorrow() Local $oIE_ObjectToClick1 = _IEGetObjById($oIE, 'tomorrow') _IEAction($oIE_ObjectToClick1, 'click') _IELoadWait($oIE) ConsoleWrite(@CRLF) $Day = 1 EndFunc ;==>_Tomorrow ;============================================================================= Func _Example1() ;Temp Max/Min $oDoc = _IEDocReadHTML($oIE) $oElement1 = StringInStr($oDoc, "color: rgb(255, 255, 255); font-weight: normal; margin-top: -20px; margin-left: 14px; z-index: 312; opacity: 0.9; transform: translate(115px, 312px); background-color: transparent;") If Not @error Then $oElement2 = StringInStr($oDoc, "color: rgb(255, 255, 255); font-weight: normal; margin-top: -20px; margin-left: 14px; z-index: 41; opacity: 0.9; transform: translate(116px, 41px); background-color: transparent;") If Not @error Then $StringMid = StringMid($oDoc, $oElement1, $oElement2 - $oElement1) $Split1 = StringSplit($StringMid, "tMax", 1) $Split2 = StringSplit($StringMid, "tMin", 1) ConsoleWrite('tMax - ' & StringLeft(StringTrimLeft($Split1[2], 2), StringInStr($Split1[2], '<') - 3) & @CRLF) ConsoleWrite('tMin - ' & StringLeft(StringTrimLeft($Split2[2], 2), StringInStr($Split2[2], '<') - 3) & @CRLF) If $Day = 0 Then GUICtrlSetData($Label, 'tMax - ' & StringLeft(StringTrimLeft($Split1[2], 2), StringInStr($Split1[2], '<') - 3) & @CRLF & 'tMin - ' & StringLeft(StringTrimLeft($Split2[2], 2), StringInStr($Split2[2], '<') - 3)) Else GUICtrlSetData($Label1, 'tMax - ' & StringLeft(StringTrimLeft($Split1[2], 2), StringInStr($Split1[2], '<') - 3) & @CRLF & 'tMin - ' & StringLeft(StringTrimLeft($Split2[2], 2), StringInStr($Split2[2], '<') - 3)) EndIf EndIf EndIf EndFunc ;==>_Example1 ;============================================================================= Func _Example2() ;Icon $oDoc = _IEDocReadHTML($oIE) $oElement1 = StringInStr($oDoc, "color: transparent; font-weight: normal; margin-top: -15px; margin-left: -15px; z-index: 312; opacity: 0.9; transform: translate(115px, 312px); background-color: transparent;") If Not @error Then $oElement2 = StringInStr($oDoc, "color: transparent; font-weight: normal; margin-top: -15px; margin-left: -15px; z-index: 41; opacity: 0.9; transform: translate(116px, 41px); background-color: transparent;") If Not @error Then $StringMid = StringMid($oDoc, $oElement1, $oElement2 - $oElement1) $Split1 = StringSplit($StringMid, "src", 1) $Trim = StringLeft(StringTrimLeft($Split1[2], 3), StringInStr($Split1[2], '<') - 5) $Number = StringMid($Trim, StringInStr($Split1[2], 'w_ic_d_') + 4, 2) ConsoleWrite('Prev - ' & $Number & @CRLF) If $Day = 0 Then _Image(0, $Number) Else _Image(1, $Number) EndIf ;============================================================================= #cs $file_url = "http://www.ipma.pt" & StringLeft(StringTrimLeft($Split1[2], 2), StringInStr($Split1[2], '<') - 5) $download_result = InetGet($file_url, @ScriptDir & "\Icon.svg", 3) If $download_result <> 0 Then MsgBox(64, 'Result', 'No Errors') Else MsgBox(64, 'Result', 'Error') EndIf InetClose($download_result) #CE ;============================================================================= EndIf EndIf EndFunc ;==>_Example2 ;============================================================================= #Region ;Window Func Minimize() WinSetState('', '', @SW_MINIMIZE) EndFunc ;==>Minimize Func Restore() WinSetState('', '', @SW_RESTORE) EndFunc ;==>Restore Func Quit() _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() _IEQuit($oIE) Exit EndFunc ;==>Quit #EndRegion ;Window ;============================================================================= Â Â Â Edited October 29, 2018 by careca Oh right, the code Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
careca Posted October 26, 2018 Author Posted October 26, 2018 (edited) Ended up solving this, now it's just a matter of polishing, still would love to know if there's a way to redraw the images or the text if they are repaint by any reason. This works by hovering the mouse in the tray icon. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=ipma.ico #AutoIt3Wrapper_UseX64=n ;#AutoIt3Wrapper_Res_Comment=By: ;#AutoIt3Wrapper_Res_Description= #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Icon_Add=ipma.ico #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;============================================================================= #Region ;Include + Opt #include <IE.au3> #include <File.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <WinAPIGdi.au3> #include <GuiTreeView.au3> #include <TrayConstants.au3> #include <ScreenCapture.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <AutoItConstants.au3> #include <WindowsConstants.au3> Opt("TrayMenuMode", 3) Opt("TrayIconHide", 0) Opt("GUIResizeMode", 1) Opt("TrayIconDebug", 1) Opt("TrayAutoPause", 0) Opt("MouseCoordMode", 2) Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Opt("GUIEventOptions", 1) Opt("TrayOnEventMode", 1) Opt("ExpandEnvStrings", 1) Opt("WinDetectHiddenText", 1) #EndRegion ;Include + Opt ;============================================================================= #Region ;GuiVars Global $GUI, $Button_1, $hGraphic, $sString, $hFont, $aInfo, $hFormat, $hBrush, $hImageR, $hImage, $hFamily, $tLayout, $IndexDay, $RefreshItem, $wpos Global $ExitItem, $Label, $Label1, $oIE, $oDoc, $oElement1, $oElement2, $StringMid, $Split1, $Split2, $Trim, $Number, $ID, $Pic, $String, $SetString Global $Day = 0, $WS, $StartWinCheck Global Const $AC_SRC_ALPHA = 1 Global $i_x1 = 0, $i_y1 = 0, $i_x3 = 25, $i_y3 = 25 Global $aMousePos, $aMousePos2, $iMouseOver = 0 Global $InstallDir = @LocalAppDataDir & '\ipma' DirCreate($InstallDir) Global $cfg = $InstallDir & '\ipma.ini' Global $aProcessList = ProcessList(@AutoItExe) If $aProcessList[0][0] >= 2 Then Exit #EndRegion ;GuiVars ;============================================================================= #Region ;GUI TraySetIcon("ipma.ico") $GUI = GUICreate('IPMA', 1, 1, @DesktopWidth - 220, @DesktopHeight - 180, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOOLWINDOW) GUISetBkColor(0x444444) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "Restore") $WS = TrayCreateItem("StartWithWindows") GUICtrlSetTip(-1, 'Startup with windows', "Startup", 1) TrayItemSetOnEvent($WS, "StartWinChoose") $RefreshItem = TrayCreateItem("Refresh") TrayItemSetOnEvent(-1, "Start") $ExitItem = TrayCreateItem("Close") TrayItemSetOnEvent(-1, "Quit") TraySetState(1) TraySetClick(8) TraySetOnEvent($TRAY_EVENT_MOUSEOVER, "_overTray") _Load() _GDIPlus_Startup() GUISetState() WinSetOnTop($GUI, '', 1) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage) _WinAPI_SetLayeredWindowAttributes($GUI, 0xABCDEF, 240) ;0xABCDEF 0xFFFFFF 0x000000 Global $WX = 150, $WY = 110 ;WinMove($GUI, '', @DesktopWidth - 180, @DesktopHeight - 150, $WX, $WY, 1) WinMove($GUI, '', @DesktopWidth + 1000, @DesktopHeight + 1000, $WX, $WY, 1) _GuiRoundCorners($GUI, $i_x1, $i_y1, $i_x3, $i_y3) #EndRegion ;GUI ;============================================================================= Start() ;============================================================================= Func Start() TrayItemSetState($RefreshItem, $TRAY_UNCHECKED) If WinExists("Instituto") = 0 Then $oIE = _IECreate("http://www.ipma.pt/pt/index.html", 0, 0, 1, 1) _IELoadWait($oIE) ;Else ;WinActivate("Instituto") ;$oIE = _IEAttach("Instituto", 'title', 1) EndIf If Not @error Then _Temps() _Icon() _Tomorrow() _Temps() _Icon() _Today() _IEQuit($oIE) ;============================================================================= Else ;MsgBox(64 + 262144, '', 'Fail') EndIf EndFunc ;==>Start ;============================================================================= Func _Load() If FileExists('C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ipma.lnk') Then Local $aDetails = FileGetShortcut('C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ipma.lnk') If Not @error Then If $aDetails[0] <> @AutoItExe Then FileDelete('C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ipma.lnk') FileCreateShortcut(@AutoItExe, 'C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ipma.lnk') EndIf EndIf TrayItemSetState($WS, $GUI_CHECKED) IniWrite($cfg, 'Options', 'StartWithWin', 1) Else ;TrayItemSetState($WS, $GUI_UNCHECKED) IniWrite($cfg, 'Options', 'StartWithWin', 0) EndIf EndFunc ;==>_Load ;============================================================================= Func _overTray() $aMousePos = MouseGetPos() If Not $iMouseOver Then AdlibRegister("_checkMouseOverTrayAdlib", 100) $iMouseOver = 1 EndFunc ;==>_overTray ;============================================================================= Func _checkMouseOverTrayAdlib() $wpos = WinGetPos($GUI) ConsoleWrite('$wpos[0] - ' & $wpos[0] & ' $wpos[1] - ' & $wpos[0] & @CRLF) $aMousePos2 = MouseGetPos() If $aMousePos2[0] <> $aMousePos[0] Or $aMousePos2[1] <> $aMousePos[1] Then $iMouseOver = 0 AdlibUnRegister("_checkMouseOverTrayAdlib") If $wpos[0] <> @DesktopWidth + 1000 Or $wpos[1] <> @DesktopHeight + 1000 Then ConsoleWrite('WinMove Out of Sight' & @CRLF) WinMove($GUI, '', @DesktopWidth + 1000, @DesktopHeight + 1000, Null, Null, 1) EndIf Return EndIf ;============================================================================= $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\SVG\w_ic_d_' & IniRead($cfg, 'ImageID', 'today', '') & 'anim.png') $hImageR = _GDIPlus_ImageResize($hImage, 100, 100, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC) $hImageR = _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImageR, 0, 10, 75, 75) ;============================================================================= $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\SVG\w_ic_d_' & IniRead($cfg, 'ImageID', 'tomorrow', '') & 'anim.png') $hImageR = _GDIPlus_ImageResize($hImage, 100, 100, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC) $hImageR = _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImageR, 70, 10, 75, 75) ;============================================================================= SetLabel(IniRead($cfg, 'String', 'today', ''), 10, 80) SetLabel(IniRead($cfg, 'String', 'tomorrow', ''), 85, 80) ;============================================================================= If $wpos[0] <> @DesktopWidth - 180 Or $wpos[1] <> @DesktopHeight - 150 Then ConsoleWrite('WinMove Back in' & @CRLF) WinMove($GUI, '', @DesktopWidth - 180, @DesktopHeight - 150, $WX, $WY, 1) EndIf EndFunc ;==>_checkMouseOverTrayAdlib ;============================================================================= Func SetLabel($String, $x, $y) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($GUI) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hFont = _GDIPlus_FontCreate($hFamily, 12, 1) $tLayout = _GDIPlus_RectFCreate($x, $y, 390, 50) $hBrush = _GDIPlus_BrushCreateSolid("0xFFFFFFFF") _GDIPlus_GraphicsDrawStringEx($hGraphic, $String, $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_BrushDispose($hBrush) EndFunc ;==>SetLabel ;============================================================================= Func _Today() Local $oIE_ObjectToClick1 = _IEGetObjById($oIE, 'today') _IEAction($oIE_ObjectToClick1, 'click') _IELoadWait($oIE) ConsoleWrite(@CRLF) $Day = 0 EndFunc ;==>_Today ;============================================================================= Func _Tomorrow() Local $oIE_ObjectToClick1 = _IEGetObjById($oIE, 'tomorrow') _IEAction($oIE_ObjectToClick1, 'click') _IELoadWait($oIE) ConsoleWrite(@CRLF) $Day = 1 EndFunc ;==>_Tomorrow ;============================================================================= Func _Temps() ;Temp Max/Min $oDoc = _IEDocReadHTML($oIE) $oElement1 = StringInStr($oDoc, "color: rgb(255, 255, 255); font-weight: normal; margin-top: -20px; margin-left: 14px; z-index: 312; opacity: 0.9; transform: translate(115px, 312px); background-color: transparent;") If Not @error Then $oElement2 = StringInStr($oDoc, "color: rgb(255, 255, 255); font-weight: normal; margin-top: -20px; margin-left: 14px; z-index: 41; opacity: 0.9; transform: translate(116px, 41px); background-color: transparent;") If Not @error Then $StringMid = StringMid($oDoc, $oElement1, $oElement2 - $oElement1) $Split1 = StringSplit($StringMid, "tMax", 1) $Split2 = StringSplit($StringMid, "tMin", 1) $SetString = StringLeft(StringTrimLeft($Split1[2], 2), StringInStr($Split1[2], '<') - 3) & ' - ' & StringLeft(StringTrimLeft($Split2[2], 2), StringInStr($Split2[2], '<') - 3) If $Day = 0 Then IniWrite($cfg, 'String', 'today', $SetString) Else IniWrite($cfg, 'String', 'tomorrow', $SetString) EndIf EndIf EndIf EndFunc ;==>_Temps ;============================================================================= Func _Icon() ;Icon $oDoc = _IEDocReadHTML($oIE) $oElement1 = StringInStr($oDoc, "color: transparent; font-weight: normal; margin-top: -15px; margin-left: -15px; z-index: 312; opacity: 0.9; transform: translate(115px, 312px); background-color: transparent;") If Not @error Then $oElement2 = StringInStr($oDoc, "color: transparent; font-weight: normal; margin-top: -15px; margin-left: -15px; z-index: 41; opacity: 0.9; transform: translate(116px, 41px); background-color: transparent;") If Not @error Then $StringMid = StringMid($oDoc, $oElement1, $oElement2 - $oElement1) $Split1 = StringSplit($StringMid, "src", 1) $Trim = StringLeft(StringTrimLeft($Split1[2], 3), StringInStr($Split1[2], '<') - 5) $Number = StringMid($Trim, StringInStr($Split1[2], 'w_ic_d_') + 4, 2) If $Day = 0 Then IniWrite($cfg, 'ImageID', 'today', $Number) Else IniWrite($cfg, 'ImageID', 'tomorrow', $Number) EndIf EndIf EndIf EndFunc ;==>_Icon ;============================================================================= Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Local $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc ;==>_GuiRoundCorners ;============================================================================= #Region ;Window Func Minimize() WinSetState('', '', @SW_MINIMIZE) EndFunc ;==>Minimize ;============================================================================= Func Restore() WinSetState('', '', @SW_RESTORE) EndFunc ;==>Restore ;============================================================================= Func Quit() TrayItemSetState($ExitItem, $TRAY_UNCHECKED) _GDIPlus_ImageDispose($hImage) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() _IEQuit($oIE) $StartWinCheck = TrayItemGetState($WS) If $StartWinCheck = 65 Then IniWrite($cfg, 'Options', 'StartWithWin', 1) ElseIf $StartWinCheck = 68 Then IniWrite($cfg, 'Options', 'StartWithWin', 0) EndIf Exit EndFunc ;==>Quit #EndRegion ;Window ;============================================================================= Do ;Main Sleep(100) Until GUIGetMsg() = $GUI_EVENT_CLOSE ;====================================================================================== Func StartWinChoose() $StartWinCheck = TrayItemGetState($WS) If $StartWinCheck = 68 Then StartWithWin() ElseIf $StartWinCheck = 65 Then RemFromStartWithWin() EndIf EndFunc ;==>StartWinChoose ;====================================================================================== Func StartWithWin() FileCreateShortcut(@AutoItExe, 'C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ipma.lnk') If FileExists('C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ipma.lnk') Then TrayItemSetState($WS, $GUI_CHECKED) IniWrite($cfg, 'Options', 'StartWithWin', 1) MsgBox(64, '', 'Application setup to start with windows') Else TrayItemSetState($WS, $GUI_UNCHECKED) IniWrite($cfg, 'Options', 'StartWithWin', 0) MsgBox(64, '', 'Could not set the application to start with windows') EndIf EndFunc ;==>StartWithWin ;====================================================================================== Func RemFromStartWithWin() FileDelete('C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ipma.lnk') Sleep(100) If FileExists('C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ipma.lnk') Then TrayItemSetState($WS, $GUI_CHECKED) IniWrite($cfg, 'Options', 'StartWithWin', 1) MsgBox(64, '', 'Could not remove the application from the start of windows') Else TrayItemSetState($WS, $GUI_UNCHECKED) IniWrite($cfg, 'Options', 'StartWithWin', 0) MsgBox(64, '', 'Removed application from start of windows') EndIf EndFunc ;==>RemFromStartWithWin ;============================================================================= Yet more polishing. ipma.ico Edited October 27, 2018 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
careca Posted October 29, 2018 Author Posted October 29, 2018 The follow up (final version) for this is HERE. Ended up finding and solving a memory leak. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now