Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/26/2017 in all areas

  1. Okay, this is exciting. I'm proud to introduce CompileIt - an experimental compiler, that allows to compile AutoIt to machine code. ...Kind of. CompileIt does compilation in a similar way the Glasgow Haskell compiler does: translates the code into a lower-level language (in CompileIt's case it's C), and then compiles the code in that language. Now, this project is still in its infancy, since, although it is simple to use, AutoIt is incredibly complex on the inside (automation, COM, etc.). So, CompileIt can compile only a very small subset of what we know as AutoIt. Here's a list of things CompileIt (partially) supports (or not): Numbers, booleans, strings Some built-in functions If, For and While statements Exporting DLL functions (you can now write DLL's in AutoIt, guys!) No arrays, automation, GUI or COM. A more detailed list is included with CompileIt. CompileIt is written in AutoIt (the compiler interface), JavaScript (parser, executed with ChakraCore), and of course C. GCC is required to compile scripts. After you extract the files, run CompileIt.exe and configure it to work with GCC.
    2 points
  2. It is common courtesy in our forums to be patient and wait at least 24 hours before bumping a thread. ... and honestly get very bored hearing this broken record without any effort from you at all! Jos
    1 point
  3. or... #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;~ gone to ;~ https://www.autoitscript.com/wiki/Snippets_(_GUI_)#Animate_Display ;~ for simplicity Global $g_hGui, $g_aGuiPos, $g_hPic, $g_aPicPos, $trans = 0, $iPic, $hPic Example() Func Example() $g_hGui = GUICreate("test Animate Display", 200, 100) WinSetTrans($g_hGui, "", 150) ; i know, not needed. $g_hPic = GUICreate("", 68, 71, 10, 20, $WS_POPUp, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $g_hGui) $iPic = GUICtrlCreatePic(StringLeft(@AutoItExe,StringInStr(@AutoItExe,"\", 0, -1)) & "Examples\GUI\merlin.gif",0,0,0,0) $hPic = GUICtrlGetHandle($iPic) GUISetState(@SW_SHOW, $g_hPic) GUISetState(@SW_SHOW, $g_hGui) HotKeySet("{ESC}", "Main") HotKeySet("{Left}", "Left") HotKeySet("{Right}", "Right") HotKeySet("{Down}", "Down") HotKeySet("{Up}", "Up") HotKeySet("{PGUP}", "TransUp") HotKeySet("{PGDN}", "TransDown") $g_aPicPos = WinGetPos($g_hPic) $g_aGuiPos = WinGetPos($g_hGui) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($g_hPic) GUIDelete($g_hGui) ExitLoop EndSwitch WEnd HotKeySet("{ESC}") HotKeySet("{Left}") HotKeySet("{Right}") HotKeySet("{Down}") HotKeySet("{Up}") EndFunc ;==>Example Func Main() $g_aGuiPos = WinGetPos($g_hGui) WinMove($g_hGui, "", $g_aGuiPos[0] + 10, $g_aGuiPos[1] + 10) EndFunc ;==>Main Func Left() $g_aPicPos = WinGetPos($g_hPic) WinMove($g_hPic, "", $g_aPicPos[0] - 10, $g_aPicPos[1]) EndFunc ;==>Left Func Right() $g_aPicPos = WinGetPos($g_hPic) WinMove($g_hPic, "", $g_aPicPos[0] + 10, $g_aPicPos[1]) EndFunc ;==>Right Func Down() $g_aPicPos = WinGetPos($g_hPic) WinMove($g_hPic, "", $g_aPicPos[0], $g_aPicPos[1] + 10) EndFunc ;==>Down Func Up() $g_aPicPos = WinGetPos($g_hPic) WinMove($g_hPic, "", $g_aPicPos[0], $g_aPicPos[1] - 10) EndFunc ;==>Up Func TransUp() ;~ $trans -= 15 ;~ If $trans < 15 Then $trans = 15 ;~ If $trans > 255 Then $trans = 255 ;~ WinSetTrans($g_hPic, "", $trans) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $g_hPic, "int", 1000, "long", 0x00050010) ; fade-in EndFunc Func TransDown() ;~ $trans += 15 ;~ If $trans < 0 Then $trans = 0 ;~ If $trans > 255 Then $trans = 255 ;~ WinSetTrans($g_hPic, "", $trans) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $g_hPic, "int", 1000, "long", 0x00040010) ; fade-out EndFunc
    1 point
  4. #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> $hGUI = GUICreate('---', 950, 765, Default, Default, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX)) $idCatalog = GUICtrlCreateListView("Code|Name|Mnf|Price", 210, 40, 720, 353) GUICtrlSetResizing(-1, 102) _GUICtrlListView_SetColumnWidth($idCatalog, 0, 50) _GUICtrlListView_SetColumnWidth($idCatalog, 1, 495) _GUICtrlListView_SetColumnWidth($idCatalog, 2, 100) _GUICtrlListView_SetColumnWidth($idCatalog, 3, 70) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) ;~ GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE") ;~ GUIRegisterMsg($WM_GETMINMAXINFO, "_WM_GETMINMAXINFO") ; Monitors resizing of the GUI While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() Exit Case $GUI_EVENT_RESIZED, $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE SetColumnWidth() EndSwitch WEnd Func SetColumnWidth() ConsoleWrite(WinGetPos(ControlGetHandle($hGUI, "", $idCatalog))[2] & @CRLF) ConsoleWrite(ControlGetPos($hGUI, '', $idCatalog)[2] & @CRLF) _GUICtrlListView_SetColumnWidth($idCatalog, 1, ControlGetPos($hGUI, '', $idCatalog)[2] - 230) EndFunc ;~ Func _WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam) ; used to limit the minimum size of the GUI ;~ #forceref $hWnd, $Msg, $wParam, $lParam ;~ If $hWnd = $hGUI Then ;~ Local $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) ;~ DllStructSetData($tagMaxinfo, 7, 964) ; min width ;~ DllStructSetData($tagMaxinfo, 8, 800) ; min height ;~ SetColumnWidth() ;~ Return $GUI_RUNDEFMSG ;~ EndIf ;~ EndFunc ;==>_WM_GETMINMAXINFO ;~ Func MY_WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) ;~ SetColumnWidth() ;~ Return $GUI_RUNDEFMSG ;~ EndFunc ;==>MY_WM_SIZE
    1 point
  5. argumentum

    _WinTrust.au3

    This UDF called my attention, tried it. Could not run it. Found a better version at https://www.autoitscript.com/forum/topic/161553-help-with-converting-c-to-autoit-a-dllcall-failes/?do=findComment&comment=1186579 PS: OP code, worked for me, the expanded later work, is the one I found to be better at the above link.
    1 point
×
×
  • Create New...