Leaderboard
Popular Content
Showing content with the highest reputation on 05/07/2019 in all areas
-
10 years in the life of a software is terribly long. You should know that you will probably need to rewrite your program after 4-5 years because of requirement changes, technology changes, organisational changes, strategy changes. I have been developing software almost all my life. And one thing I truly believe in, is to get a software out as fast as you can (with the highest possible standards) to help the staff of your company or client staff and make your software evolves over time, knowing that in a near future, you will have to rewrite it...2 points
-
Hey folks, This is actually the beginnings of something else - but I was pretty happy with how this part turned out. So hey, here is a clock. it is drag-able Escape (after clicking on clock) : Exit Wheel: Grow & Shrink Click Wheel: Reset Size Edit: somehow missed an include directive... #AutoIt3Wrapper_Au3Check_Parameters = -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #NoTrayIcon #include <GDIPlus.au3> #include <GUIConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Global $hGUI, $iWinH, $iWinW, $iChSize, _ $iStartSz, $iMargin, $iCanvasSz, $iWinXStartPos Global Const $PI = 4 * ATan(1) Global Const $MAGIC_PINK = 0xFF00FF, $MAGIC_PINK_ARGB = 0xFFFF00FF $iWinH = @DesktopHeight $iWinW = $iWinH $iCanvasSz = $iWinH $iMargin = 4 $iStartSz = Int($iWinH / 4) - (2 * $iMargin) $iWinXStartPos = 0 ;Right Side: ide@DesktopWidth - ($iStartSz + (2 * $iMargin)) $hGUI = GUICreate("Clock", $iWinW, $iWinH, $iWinXStartPos, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUISetBkColor($MAGIC_PINK) _WinAPI_SetLayeredWindowAttributes($hGUI, $MAGIC_PINK, 0xF0) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") GUIRegisterMsg($WM_MOUSEWHEEL, "WM_MOUSEWHEEL") GUIRegisterMsg($WM_NCMBUTTONDOWN, "WM_NCMBUTTONDOWN") Clock() Func Clock() Local $hGraphic, $hClockBitmap, $hClockGraphic Local $iSize, $iDigSize, $iOrigin Local $iNumDist, $iDigXOffset, $iDigYOffset Local $ixOffset, $iyOffset Local $hFrameBrush, $hNoseBrush, $hHighlightBrush, $hFaceBrush Local $hBlackPen, $hSecPen, $hMinPen, $hHourPen Local $iSec, $iMin, $iHour Local $ixSecOffset, $iySecOffset, $ixMinOffset, $iyMinOffset, _ $ixHourOffset, $iyHourOffset $iDigSize = $iSize / 20 $iChSize = $iStartSz _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hClockBitmap = _GDIPlus_BitmapCreateFromGraphics($iCanvasSz, $iCanvasSz, $hGraphic) $hClockGraphic = _GDIPlus_ImageGetGraphicsContext($hClockBitmap) _GDIPlus_GraphicsSetSmoothingMode($hClockGraphic, 4) $hFrameBrush = _GDIPlus_BrushCreateSolid(0xFF80BBCC) $hNoseBrush = _GDIPlus_BrushCreateSolid(0xEE778888) $hHighlightBrush = _GDIPlus_BrushCreateSolid(0x44FF00FF) $hFaceBrush = _GDIPlus_BrushCreateSolid(0xFFEEF0FF) $hSecPen = _GDIPlus_PenCreate(0xBB882255, 1) $hMinPen = _GDIPlus_PenCreate(0xBBFF8833, 4) $hHourPen = _GDIPlus_PenCreate(0xEE4488AA, 5) $hBlackPen = _GDIPlus_PenCreate(0xFF000000, 4) Do If $iSize <> $iChSize Or @SEC <> $iSec Then $iSize = $iChSize $iDigSize = $iSize / 20 $iOrigin = Int($iSize / 2) + $iMargin $iNumDist = $iSize / 2 - ($iSize / 8) $iDigXOffset = .55 * $iDigSize $iDigYOffset = -(.7 * $iDigSize) _GDIPlus_GraphicsClear($hClockGraphic, $MAGIC_PINK_ARGB) _GDIPlus_GraphicsFillEllipse($hClockGraphic, $iMargin, $iMargin, $iSize, $iSize, $hFrameBrush) _GDIPlus_GraphicsFillEllipse($hClockGraphic, $iMargin + 8, $iMargin + 8, $iSize - 8, $iSize - 8, $hHighlightBrush) _GDIPlus_GraphicsFillEllipse($hClockGraphic, $iMargin + 8, $iMargin + 8, $iSize - 16, $iSize - 16, $hFaceBrush) _GDIPlus_GraphicsDrawEllipse($hClockGraphic, $iMargin, $iMargin, $iSize, $iSize, $hBlackPen) For $i = 1 To 12 $ixOffset = Int($iNumDist * Sin($i * ($PI / 6))) $iyOffset = Int($iNumDist * Cos($i * ($PI / 6))) $ixOffset -= (StringLen($i) * $iDigXOffset) $iyOffset -= $iDigYOffset _GDIPlus_GraphicsDrawString($hClockGraphic, $i, ($iOrigin + $ixOffset), ($iOrigin - $iyOffset), "Symbol", $iDigSize) Next $iSec = @SEC $iMin = 60 * @MIN + $iSec $iHour = (3600 * @HOUR) + $iMin $ixSecOffset = Int((0.83 * $iNumDist) * Sin($iSec * ($PI / 30))) $iySecOffset = Int((0.83 * $iNumDist) * Cos($iSec * ($PI / 30))) $ixMinOffset = Int((0.85 * $iNumDist) * Sin($iMin * ($PI / 1800))) $iyMinOffset = Int((0.85 * $iNumDist) * Cos($iMin * ($PI / 1800))) $ixHourOffset = Int((0.65 * $iNumDist) * Sin($iHour * ($PI / 21600))) $iyHourOffset = Int((0.65 * $iNumDist) * Cos($iHour * ($PI / 21600))) _GDIPlus_GraphicsDrawLine($hClockGraphic, $iOrigin, $iOrigin, $iOrigin + $ixHourOffset, $iOrigin - $iyHourOffset, $hHourPen) _GDIPlus_GraphicsDrawLine($hClockGraphic, $iOrigin, $iOrigin, $iOrigin + $ixMinOffset, $iOrigin - $iyMinOffset, $hMinPen) _GDIPlus_GraphicsDrawLine($hClockGraphic, $iOrigin, $iOrigin, $iOrigin + $ixSecOffset, $iOrigin - $iySecOffset, $hSecPen) _GDIPlus_GraphicsFillEllipse($hClockGraphic, $iOrigin - 3, $iOrigin - 3, 6, 6, $hNoseBrush) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hClockBitmap, 0, 0, $iCanvasSz, $iCanvasSz) EndIf Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_BrushDispose($hFrameBrush) _GDIPlus_BrushDispose($hNoseBrush) _GDIPlus_BrushDispose($hHighlightBrush) _GDIPlus_BrushDispose($hFaceBrush) _GDIPlus_PenDispose($hSecPen) _GDIPlus_PenDispose($hMinPen) _GDIPlus_PenDispose($hHourPen) _GDIPlus_PenDispose($hBlackPen) _GDIPlus_BitmapDispose($hClockBitmap) _GDIPlus_GraphicsDispose($hClockGraphic) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Clock Func WM_NCMBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam $iChSize = $iStartSz EndFunc ;==>WM_NCMBUTTONDOWN Func WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Local $iWheelDist, $iRate $iRate = 0.25 $iWheelDist = BitShift($wParam, 16) $iChSize -= Int($iRate * $iWheelDist) If $iChSize < 120 Then $iChSize = 120 If $iChSize > $iCanvasSz - (2 * $iMargin) Then $iChSize = $iCanvasSz - (2 * $iMargin) EndFunc ;==>WM_MOUSEWHEEL Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Return $HTCAPTION EndFunc ;==>WM_NCHITTEST1 point
-
What difference does it make if you're writing it now and AutoIt stops being supported? You can write a program in the first version of COBOL if you wanted to, as long as you still have the compiler for it, even though it's not still supported. Whether Microsoft's API calls stay the same isn't up to the developers of AutoIt, no one can predict that unless they work for MS. If they change, and AutoIt no longer works, then you'll have to find a new language to work in, 10 years from now. As long as MS doesn't change things too drastically, you can keep programming in the language until it doesn't work.1 point
-
@supraaxdd Good luck! I was the same and I learned to think more logically as I programmed for longer, I guess everyone goes through that at some point in their life1 point
-
Makes sense. The fact that I am new, might be an obstacle but I'll figure it out eventually. What I realised is that when I program more, I tend to think more logically. Thank you for your explanations and have a good day! Kind Regards, Supra1 point
-
It is pretty unclear what you are after, so please try to explain what it is you want to know. In General: AutoIt3 is written is C++ and of course is using many standard Windows API calls..... but that should be obvious ...right? Jos1 point
-
#include <ie.au3> #include <string.au3> #include <array.au3> $oIE=_IECreate("https://www.rightmove.co.uk/house-prices/detail.html?country=england&locationIdentifier=POSTCODE%5E1603593&searchLocation=SW1V+1AA&year=1&referrer=listChangeCriteria") $sText=_IEBodyreadHTML($oIE) _IEQuit($oIE) $sResult=_StringBetween($sText,'<div class="soldAddress">','</div>') ;~ _ArrayDisplay($sResult) ConsoleWrite($sResult[0] & @CRLF) MsgBox(262144, Default, $sResult[0],0) or without browser #include <string.au3> #include <array.au3> #include <Inet.au3> $sText = _INetGetSource("https://www.rightmove.co.uk/house-prices/detail.html?country=england&locationIdentifier=POSTCODE%5E1603593&searchLocation=SW1V+1AA&year=1&referrer=listChangeCriteria") $sResult = _StringBetween($sText, '<div class="soldAddress">', '</div>') ;~ _ArrayDisplay($sResult) ConsoleWrite($sResult[0] & @CRLF) MsgBox(262144, Default, $sResult[0], 0)1 point
-
SEKOMD, Microsoft cannot tell you what will happen in 10 or 20 years - so it is a bit much to ask a bunch of amateurs! But what we can say is that as long as the Windows API remains backwards compatible (which seems a pretty good bet at the moment) then AutoIt will continue to function more or less in the same manner as now. If Windows changes completely then obviously AutoIt will cease to function with the newer versions. As to new releases of AutoIt - it does most things that the people using it need to do now, so what else would you like to see added? Remember that everyone involved in development of the core code or standard UDFs is a volunteer and as such can only devote a limited amount of their time. And that as an interpreted language there are limits on such things as speed of execution, multi-threading (or the lack of it), and several other areas. You speak of a choice between C# and AutoIt - that is a question of apples and pears and much would depend on what exactly you want this "big program" of yours to do. If you could give more details about it I am sure that those here familiar with both languages would be more than happy to give their opinion. M231 point
-
Find all autoit scripts inside a folder and compile them
AasimPathan reacted to FrancescoDiMuro for a topic
@AasimPathan Change this line of code FileCopy($M_V_Scalar_Object_Array[$M_V_Scalar_Object_ArrayToInteger], $M_V_Scalar_Object_AutoItCompiledRootDirectory, $FC_OVERWRITE, $FC_CREATEPATH) to FileCopy($M_V_Scalar_Object_Array[$M_V_Scalar_Object_ArrayToInteger], $M_V_Scalar_Object_AutoItCompiledRootDirectory, BitOr($FC_OVERWRITE, $FC_CREATEPATH))1 point