Jump to content

allSystemsGo

Active Members
  • Posts

    211
  • Joined

  • Last visited

Profile Information

  • Location
    The boonies

Recent Profile Visitors

220 profile views

allSystemsGo's Achievements

  1. Thanks for the quick answers! Yeah...haven't worked with arrays in autoit in a while
  2. So.. I am trying to do this #include <File.au3> #include <array.au3> $source = $cmdline[1] $destinationdir = $cmdline[2] $aArray = _FileListToArray($destinationdir) For $i = 1 to $aArray(Ubound-1) $dest = $aArray[$i] DirCopy($source, $dest) Next After I compile and run from CMD I get the following error (see screenshot) Any help is appreciated!
  3. I finally got it working then found out that GDI doesnt render in RDP environment.
  4. I am trying (emphasis on trying) to create a simple clock in autoit. I thought, hey, would be a good time to use GDI. How do I refresh a GDI string? For example, when the minute updates, actually put the new data for the minute in the gui. Here is my code so far #include <GUIConstantsEx.au3> #include <GDIPlus.au3> Do Until @Sec = 0 clock() Func Clock() Local $hGUI, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout $hour = @HOUR $min= @MIN $ellipses= ":" $timeOfDay="AM" $seconds=@SEC If $hour >12 then $timeOfDay = "PM" If $hour >12 Then $hour = @Hour - 12 Local $sHour = $hour, $aInfo Local $sEllipses = $ellipses, $bInfo Local $sMin= $min, $cInfo Local $sTimeOfDay= $timeOfDay, $dInfo $hGUI = GUICreate("GDI+", 400, 300) While 1 ; Create GUI GUISetState(@SW_SHOW) If @MIN <> $min Then $min = @MIN If @HOUR <> $Hour Then $Hour = @HOUR If $hour >12 Then $hour = @Hour - 12 ; Draw a string _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hBrush = _GDIPlus_BrushCreateSolid(0xFF00007F) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Calibri") $hFont = _GDIPlus_FontCreate($hFamily, 18, 2) $tLayout = _GDIPlus_RectFCreate(140, 110, 0, 0) $uLayout=_GDIPlus_RectFCreate(180, 110, 0, 0) $vLayout=_GDIPlus_RectFCreate(210, 110, 0, 0) $wLayout=_GDIPlus_RectFCreate(240, 110, 0, 0) $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sHour, $hFont, $tLayout, $hFormat) $bInfo= _GDIPlus_GraphicsMeasureString($hGraphic, $sEllipses, $hFont, $uLayout, $hFormat) $cInfo=_GDIPlus_GraphicsMeasureString($hGraphic, $sMin, $hFont, $vLayout, $hFormat) $dInfo=_GDIPlus_GraphicsMeasureString($hGraphic, $sTimeOfDay, $hFont, $wLayout, $hFormat) _GDIPlus_GraphicsDrawStringEx($hGraphic, $sHour, $hFont, $aInfo[0], $hFormat, $hBrush) _GDIPlus_GraphicsDrawStringEx($hGraphic, $sEllipses, $hFont, $bInfo[0], $hFormat, $hBrush) _GDIPlus_GraphicsDrawStringEx($hGraphic, $sMin, $hFont, $cInfo[0], $hFormat, $hBrush) _GDIPlus_GraphicsDrawStringEx($hGraphic, $sTimeOfDay, $hFont, $dInfo[0], $hFormat, $hBrush) sleep(60000) ;~ If @MIN <> $min Then $min = @MIN ;~ _GDIPlus_GraphicsDrawStringEx($hGraphic, $sMin, $hFont, $cInfo[0], $hFormat, $hBrush) ;~ If @HOUR <> $Hour Then $Hour = @HOUR ;~ If $hour >12 Then $hour = @Hour - 12 ;~ _GDIPlus_GraphicsDrawStringEx($hGraphic, $sHour, $hFont, $aInfo[0], $hFormat, $hBrush) ;~ GUIDelete($hGraphic) ; Loop until the user exits. ;~ Do ;~ Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Wend EndFunc
  5. Are you using the IE udf? #include <ie.au3> Local $oIE, $GUI_Button_Back, $GUI_Button_Forward Local $GUI_Button_Home, $GUI_Button_Stop, $msg $oIE = _IECreateEmbedded() ; Create a simple GUI for our output GUICreate("TEST",1050,600,(@DesktopWidth-1050)/2,(@DesktopHeight-600)/2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUICtrlCreateObj($oIE, 5, 5, 1045, 550) $GUI_Button_Extract = GUICtrlCreateButton("Extract", 700, 565, 100, 30) GUISetState() ;Show GUI _IENavigate($oIE, "http://www.autoitscript.com") While 1 Local $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd
  6. What is not working? I've embedded IE pages into several GUIs. What are you expecting to see or have happen?
  7. Divide it up into regions #Region Function 1 ;do stuff #EndRegion Function 1
  8. Maybe the If..Then...ElseIf statement would work well here?
  9. Is it possible to create a GUI that would allow the user to add objects to the interface and then drag and drop where they want them? I've searched the forum and found a good concept by M23, but it was creating GUIs rather than objects. Thanks!
  10. Check out rule # 1 http://www.autoitscript.com/forum/index.php?app=forums&module=extras&section=boardrules
  11. asianqueen, If you run the code above, what error do you get, if any?
  12. asianqueen, You need to download the latest version of autoit. However, try using _FileReadToArray() and see if that works.
×
×
  • Create New...