Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/13/2022 in all areas

  1. Means: Stop automating IE, move to Chrome, Edge or Firefox and use the WebDriver UDF to automate this browsers
    2 points
  2. You could use the com object Scripting.Dictionnary which is very close to map : #include <Constants.au3> #include <Array.au3> $sd = ObjCreate("Scripting.Dictionary") Local $array[10] = [1,2,3,4,5,6,7,8,9,0] $sd("SomeId") = $array ConsoleWrite($sd("SomeId")[3] & @CRLF)
    1 point
  3. A few comments. 1- Do not use == in if as this is reserved for case-sensitive strings comparaison 2- No need to specify number only if the input box is readonly Here a way to simplify your loop : While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $bRight If $n = 30 Then ContinueLoop $n += 1 GUICtrlSetData($iInput, $n) Case $bLeft If $n = 1 Then ContinueLoop $n -= 1 GUICtrlSetData($iInput, $n) EndSwitch WEnd
    1 point
  4. I know but: The question whether this is really needed or just creating confusion? Your proposed solution as such is not one I would advice to use in general as I mentioned. Just putting it out there..... but you don't have to provide a solution in every posted thread.
    1 point
  5. You can use GUICtrlSetLimit to set the limits of the up/down control and use the same to limit the number of char of the input. Example : Local $idInput = GUICtrlCreateInput("1", 10, 5, 100, 20, $ES_NUMBER) ; only number accepted GUICtrlSetLimit(-1, 2) ; maximum of 2 characters Local $idUpDown = GUICtrlCreateUpdown(-1) GUICtrlSetLimit(-1, 30, 1) ; up/down from 1 to 30
    1 point
  6. Just take the example from the helpfile an modify that.... as you can see it will show correctly this way: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> Example() Func Example() GUICreate("My GUI UpDown", -1, -1, -1, -1, $WS_SIZEBOX) Local $idInput = GUICtrlCreateInput("2", 10, 10, 50, 20) GUICtrlCreateUpdown($idInput) ; Attempt to resize input control GUICtrlSetPos($idInput, 10, 10, 100, 40) GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idInput $curVal = Number(GUICtrlRead($idInput)) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $curVal = ' & $curVal & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console If $curVal > 30 Then GUICtrlSetData($idInput, "30") If $curVal < 1 Then GUICtrlSetData($idInput, "1") EndSwitch WEnd MsgBox($MB_SYSTEMMODAL, "Updown", GUICtrlRead($idInput)) EndFunc ;==>Example EDIT: Added some MIN / MAX logic.. Let me know when you have questions and please post a runnable script when you want to show an issue.
    1 point
  7. That is great that you are trying to learn to program and we will be happy to help you out were we can. Just open the helpfile and look at the example of GUICtrlCreateUpdown() which will show you how you can easily do an up down action. You will of course also need an GUICtrlCreateInput() box to be filled with the new number whenever you click the UpDown buttons. Just try together to get something going and post here when you have questions.
    1 point
  8. it was fixed: https://www.autoitscript.com/trac/autoit/ticket/3167 and is in recent beta: There is workaround, you should split this: $oIE.document.parentWindow.location.href into: Local $oCOMErrorHandler = ObjEvent("AutoIt.Error")  Local $oDocument = $oIE.document if @error ..... Local $oWindow = $oDocument.parentWindow if @error ..... Local $oLocation = $oWindow.location if @error ..... Local $sHREF = $oLocation.href if @error .....
    1 point
  9. The only solution to this problem is to avoid nesting: #include <IE.au3> Global $oIE = _IECreate("http://www.autoitscript.com") Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrorFunc") For $i = 0 To 20 ConsoleWrite("isObj($oIE) = " & IsObj($oIE) & @CRLF) Next Do ProcessClose("iexplore.exe") Sleep(100) Until (Not ProcessExists("iexplore.exe")) Sleep(2000) ConsoleWrite(@CRLF & "ProcessClosed...." & @CRLF & @CRLF) For $i = 0 To 20 ConsoleWrite("isObj($oIE) = " & IsObj($oIE) & @CRLF) Next ; Global $sURL = $oIE.document.parentWindow.location.href ; COM Error handler does not return the error raised by document but by href. Does value does not explain the real problem! Global $oDocument = $oIE.document if @error = 0x800706BA Then Exit MsgBox(0, "Error #1", "RPC-Server is no longer available - means: IE has been closed by user!") Global $sURL = $oDocument.parentWindow.location.href Func _ErrorFunc($oError) ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc As IE is no longer available, we know that the error occurs after the first operation. If the first operation is successful we can then use nested oprations.
    1 point
  10. OK Got it. I found some code to guide mere here: https://www.autoitscript.com/forum/topic/197080-using-ui-automation-code-in-autoit/page/3/ I basically replaced the for loop with the following: Local $pElement1, $oElement1, $sValue1 For $i = 0 To $iElements - 1 $oUIElementArray.GetElement( $i, $pElement1 ) $oElement1 = ObjCreateInterface( $pElement1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) $oElement1.GetCurrentPropertyValue( $UIA_NamePropertyId, $sValue1 ) ConsoleWrite( "$sValue1 = " & $sValue1 & @CRLF ) Next Now the full code to enumerate through open Chrome Tabs is as so: #include "CUIAutomation2.au3" ; Window handle Local $hWindow = WinGetHandle( "[CLASS:Chrome_WidgetWin_1]" ) If Not IsHWnd( $hWindow ) Then Return ConsoleWrite( "$hWindow ERR" & @CRLF ) ConsoleWrite( "$hWindow OK" & @CRLF ) ; Activate window WinActivate( $hWindow ) Sleep( 100 ) ; UI Automation object Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement( $pDesktop ) $oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oDesktop ) Then Return ConsoleWrite( "$oDesktop ERR" & @CRLF ) ConsoleWrite( "$oDesktop OK" & @CRLF ) ; Chrome window Local $pCondition $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition ) If Not $pCondition Then Return ConsoleWrite( "$pCondition ERR" & @CRLF ) ConsoleWrite( "$pCondition OK" & @CRLF ) Local $pChrome, $oChrome $oDesktop.FindFirst( $TreeScope_Descendants, $pCondition, $pChrome ) $oChrome = ObjCreateInterface( $pChrome, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oChrome ) Then Return ConsoleWrite( "$oChrome ERR" & @CRLF ) ConsoleWrite( "$oChrome OK" & @CRLF ) ; Tab item Local $pCondition1 $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_TabItemControlTypeId, $pCondition1 ) If Not $pCondition1 Then Return ConsoleWrite( "$pCondition1 ERR" & @CRLF ) ConsoleWrite( "$pCondition1 OK" & @CRLF ) ;~ ; Find All tab items Local $pTabs, $oUIElementArray, $iElements, $pFound, $oFound, $value $oChrome.FindAll( $TreeScope_Descendants, $pCondition1, $pTabs ) $oUIElementArray = ObjCreateInterface( $pTabs, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray );Ends in array $oUIElementArray.Length( $iElements ) ConsoleWrite( "$iElements:" & $iElements & @CRLF ) Local $pElement1, $oElement1, $sValue1 For $i = 0 To $iElements - 1 $oUIElementArray.GetElement( $i, $pElement1 ) $oElement1 = ObjCreateInterface( $pElement1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) $oElement1.GetCurrentPropertyValue( $UIA_NamePropertyId, $sValue1 ) ConsoleWrite( "$sValue1 = " & $sValue1 & @CRLF ) Next Hope someone can use this code. I won't need to install Chrome UDF or the webdriver with this code ;-)
    1 point
  11. Zedna

    Resources UDF

    Link to pages with general resources description MSDN - Resources OverView & Reference You can embed any binary data into your AutoIt compiled EXE files in it's resources at compile time. As opposite to FileInstall() with resources you can use your embedded data directly without any temporary files on disk. If you wish you can save resources to disk with _ResourceSaveToFile() however. Adding data to resources can be done simply by AutoIt3Wrapper directive: #AutoIt3Wrapper_Res_File_Add=FileName, ResType, ResName As data can be used for example images,cursors,texts,sounds,videos,binary files etc. For loading/using data from resources at run time I made this tiny helper Resources UDF. Functions inside UDF: _ResourceGet($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsString($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsStringW($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsBytes($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsImage($ResName, $ResType = $RT_RCDATA, $DLL = -1) _ResourceGetAsBitmap($ResName, $ResType = $RT_RCDATA, $DLL = -1) _ResourceSaveToFile($FileName, $ResName, $ResType = $RT_RCDATA, $ResLang = 0, $CreatePath = 0, $DLL = -1) _ResourceSetImageToCtrl($CtrlId, $ResName, $ResType = $RT_RCDATA, $DLL = -1) _SetBitmapToCtrl($CtrlId, $hBitmap) _ResourcePlaySound($ResName, $Flag = 0, $DLL = -1) Notes: * to compile all script examples you must have installed Scite4AutoIt3 --> you must compile script by F7 from full Scite * for using #AutoIt3Wrapper_Res_File_Add directive you must have AutoIt3Wrapper at least version 2.0.1.22 (it's part of latest Scite4AutoIt3) * to compile all script examples must be apropriate resource data files in script directory (from resource_data.zip) * _ResourceGet() always returns pointer to data (for RT_BITMAP returns hBitmap), returning other types can be done by additional wrapper functions like _ResourceGetAsString() or _ResourceGetAsBytes() * _ResourceGetAsStringW() is for Unicode strings (Widechar) * you can use also #number instead of resource name, see examples * general supported resource types are listed in UDF as constants ($RT_BITMAP, $RT_RCDATA, ...) * information about playing video files (AVI) from resources is here thanks matrixnz * information/examples about using animated GIFs from resources is here and here thanks smashly/ProgAndy * information about running EXE files/DLL functions directly from resources is here thanks trancexx/Ward Known problems/limitations: * _ResourceGet() returns resource size (in bytes) in @extended macro but not for resource type RT_BITMAP * _ResourceSetImageToCtrl() works with "static/button" type of controls (picture,label,icon,button,checkbox,radiobutton,groupbox) * _ResourcePlaySound() plays only WAV files (not MP3 files) * _ResourceGetAsBytes() doesn't work for RT_BITMAP type because _ResourceGet() returns hBitmap instead of memory pointer in this case there could be used _ResourceGetAsImage() as workaround * _ResourceGet() has potential memory leak releasing of resources UnlockResource,FreeResource (opposite of LoadResource,LockResource) is not done because it must be done after using of resources at the end and not inside UDF * _GDIPlus_Startup() is called once at start of whole include --> no _GDIPlus_Shutdown() is called History: 2011-06-20 - fixed x64 compatibility (type: int->ptr) - internal change: FindResourceA -> FindResourceW (& type: str->wstr) - _SetBitmapToCtrl() --> $CtrlId parameter now supports also -1 (thanks guinness) - _WinAPI_LoadLibraryEx($DLL, $LOAD_LIBRARY_AS_DATAFILE) instead of _WinAPI_LoadLibrary($DLL) (thanks arcker) - added au3.user.calltips.api, au3.userudfs.properties (thanks guinness) - merged resource_au3.zip + resource_data.zip to one file resources.zip 2010-02-12 - all examples now use fixed #AutoIt3Wrapper_Res_File_Add directive from latest Scite4Autoit3 (no need for ResHacker.exe) - added support for buttons (also checkboxes,radiobuttons,groupboxes) in _ResourceSetImageToCtrl()/_SetBitmapToCtrl() thanks Melba 2009-08-25 - fixed corrupted topic (appeared after forum upgrade) - removed some AU3 tags from topic, note: all AU3 code is untouched inside attached ZIP 2008-11-27 - added _ResourceGetAsStringW() --> for Unicode strings (Widechar) 2008-11-10 - added two very simple examples 2008-08-14 - change: _GDIPlus_Startup() is called once at start of whole include--> no _GDIPlus_Shutdown() is called - fixed support for animated GIFs in _ResourceGetAsImage() --> removed_MemGlobalFree($hData) - used simpler UDF syntax (from WinAPI) instead of DllCall() where possible - added new example for animated GIF image 2008-07-08 - just corrected some typos in this topic (no code changes) 2008-06-25 - big thanks to ProgAndy for ideas,improvements! - added _ResourceGetAsImage(), _ResourceGetAsBitmap() - added optional $DLL parameter to all functions - for loading resources from external EXE,DLL files - fixed previous limitation in _ResourceSaveToFile() - now supports also RT_BITMAP type - new examples in resource_test.au3 2008-05-02 - added new RT,SND constants - fixed bad order of parameters ResName x ResType in FindResourceExA (thanks SmOke_N) - added DeleteObject of oldBmp from STM_SETIMAGE in _SetBitmapToCtrl (thanks ProgAndy) - added settinng SS_BITMAP style to control before STM_SETIMAGE in_SetBitmapToCtrl (support for labels) 2008-04-24 - added support for JPG,GIF,PNG in _ResourceSetImageToCtrl() using GDI+ - thanks ProgAndy - reverted all examples back from #AutoIt3Wrapper_Res_File_Add= to#AutoIt3Wrapper_run_after=ResHacker.exe -add - updated both ZIP archives 2007-10-16 - added _ResourcePlaySound() - thanks Larry - corrected local declaration of $struxt - was problem when Opt("MustDeclareVars",1) - updated resource_test.au3 and resource.au3 in resource_au3.zip 2007-09-14 - added optional parameter $CreatePath in _ResourceSaveToFile() - updated resource_test.au3 and resource.au3 in resource_au3.zip 2007-09-11 - in examples used new AutoIt3Wrapper directive#AutoIt3Wrapper_Res_File_Add from latest Scite4AutoIt3 (instead of #AutoIt3Wrapper_run_after=ResHacker.exe -add ...) - updated resource_test.au3 and resource_test_ie.au3 in resource_au3.zip 2007-09-05 - in #AutoIt3Wrapper_run_after=ResHacker.exe -add ... directive can be resource type in text form -->rcdata instead of 10, bitmap instead of 2 and so on (note: but for htmlmust be used 23 still) - updated only resource_test.au3 in resource_au3.zip 2007-09-04 - added description at top of this topic - added _ResourceSaveToFile() - source is also example for using _ResourceGetAsBytes() - more error checking in UDF and error codes are now differrent todistinguish possible problem - default ResType = 10 ($RT_RCDATA) in all functions - updated both ZIP archives 2007-08-29 - added TODO list - removed not used local variables in _ResourceSetImageToCtrl() - ziparchive not updated yet - revisited WWW links and TODO list and added list of functions 2007-08-10 - first version resource_test_min1.au3 - very simple example script of using UDF #AutoIt3Wrapper_Res_File_Add=image3.jpg, rt_rcdata, TEST_JPG_1 #include "resources.au3" $gui = GUICreate("Data from resources simple example 1",400,150) $pic1 = GUICtrlCreatePic("",0,0,400,150) _ResourceSetImageToCtrl($pic1, "TEST_JPG_1") ; set JPG image to picture control from resource GUISetState(@SW_SHOW) While 1 If GUIGetMsg() = -3 Then Exit WEnd resource_test.au3 - complex example script of using UDF #AutoIt3Wrapper_Res_File_Add=test_1.txt, rt_rcdata, TEST_TXT_1 #AutoIt3Wrapper_Res_File_Add=image1.bmp, rt_bitmap, TEST_BMP_1 #AutoIt3Wrapper_Res_File_Add=image2.bmp, rt_bitmap, TEST_BMP_2 #AutoIt3Wrapper_Res_File_Add=image3.jpg, rt_rcdata, TEST_JPG_3 #AutoIt3Wrapper_Res_File_Add=binary1.dat, rt_rcdata, TEST_BIN_1 #AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Media\tada.wav, sound, TEST_WAV_1 #include "resources.au3" $gui = GUICreate("Data from resources example",820,400) $pic1 = GUICtrlCreatePic("",0,0,400,300) $pic2 = GUICtrlCreatePic("",400,0,400,150) $pic3 = GUICtrlCreatePic("",400,150,400,150) $pic4 = GUICtrlCreatePic("",600,320,400,100) $label1 = GUICtrlCreateLabel("",20,320,380,100) $label2 = GUICtrlCreateLabel("",400,320,200,100) GUISetState(@SW_SHOW) ; get string from resource $string = _ResourceGetAsString("TEST_TXT_1") GUICtrlSetData($label1, $string) ; set BMP image to picture control from resource bitmap _ResourceSetImageToCtrl($pic1, "TEST_BMP_1", $RT_BITMAP) ; get bitmap from resource (as pointer) $hBmp = _ResourceGet("TEST_BMP_2", $RT_BITMAP) ; and use it for whatever you like _SetBitmapToCtrl($pic2, $hBmp) ; set JPG image to picture control from resource _ResourceSetImageToCtrl($pic3, "TEST_JPG_3") ; set image to picture control from external DLL resource _ResourceSetImageToCtrl($pic4, "#14355", $RT_BITMAP, @SystemDir & "\shell32.dll") ; get/use picture from resources as hImage type $size1 = _ResourceGetImageSize("TEST_BMP_1", $RT_BITMAP) $size2 = _ResourceGetImageSize("TEST_JPG_3") GUICtrlSetData($label2, $size1 & @CRLF & $size2) ; save binary data or another type (image) from resource to file and get its size in bytes $size1 = _ResourceSaveToFile(@ScriptDir & "\binary_data1.dat", "TEST_BIN_1") $size2 = _ResourceSaveToFile(@ScriptDir & "\binary_data2.bmp", "TEST_BMP_1", $RT_BITMAP) ; save binary data from resource to file (create not existing directory) _ResourceSaveToFile("C:\Dir1\SubDir2\binary_data1.dat", "TEST_BIN_1", $RT_RCDATA, 0, 1) _ResourceSaveToFile("C:\Dir1\SubDir2\binary_data2.bmp", "TEST_BMP_1", $RT_BITMAP, 0, 1) ; play WAV from resource (sync/async) _ResourcePlaySound("TEST_WAV_1") _ResourcePlaySound("TEST_WAV_1", $SND_ASYNC) While 1 If GUIGetMsg() = -3 Then Exit WEnd Func _ResourceGetImageSize($ResName, $ResType = 10) ; $RT_RCDATA = 10 ; get/use picture from resources as hImage type $hImage = _ResourceGetAsImage($ResName, $ResType) $width = _GDIPlus_ImageGetWidth ($hImage) $height = _GDIPlus_ImageGetHeight($hImage) Return "Size of " & $ResName & " is: " & $width & "x" & $height EndFunc resources.zip - UDF + examples + sample resource data for examples Previous downloads: 7195 resources.zip
    1 point
  12. After Several Minutes searching the forums for a simple solution to calculating for the Unix Time, as required for another project I am working on, I was astonished to not find one clean and universal solution. After looking over the helpfile, I noticed one simple solution given in the example with _DateDiff(). However it did not account for my current timezone or daylight savings time. Without further ado... This is my example of Calculating for a current Unix Time stamp or seconds since Jan, 1st, 1970 00:00:00 GMT. This function will account for your timezone as well as for daylight savings time. Update: v0.3 -Added Function to revert a Unix Time stamp into Date form. -Added parameter to original _GetUnixTime() allowing for a custom date since Jan 1st 1970 to be passed and converted to Unix Time. #include <Date.au3> #include <Array.au3> #include <Constants.au3> Local $iUnixTime1 = _GetUnixTime() MsgBox($MB_SYSTEMMODAL, "Unix Timestamp", "Seconds Since Jan, 1st, 1970 00:00:00 GMT" & @CRLF & $iUnixTime1) Local $sUnixDate1 = _GetDate_fromUnixTime($iUnixTime1) MsgBox($MB_SYSTEMMODAL, "Unix Timestamp", "Get Date from Unix Timestamp in Local Time" & @CRLF & $sUnixDate1) $sUnixDate1 = _GetDate_fromUnixTime($iUnixTime1, False) MsgBox($MB_SYSTEMMODAL, "Unix Timestamp", "Get Date from Unix Timestamp with $iReturnLocal = False which returns UTC Time" & @CRLF & $sUnixDate1) Local $iUnixTime2 = _GetUnixTime('2013/01/01 00:00:00') MsgBox($MB_SYSTEMMODAL, "Unix Timestamp", "Seconds since 2013/01/01 00:00:00" & @CRLF & $iUnixTime2) ; Get timestamp for input datetime (or current datetime). Func _GetUnixTime($sDate = 0);Date Format: 2013/01/01 00:00:00 ~ Year/Mo/Da Hr:Mi:Se Local $aSysTimeInfo = _Date_Time_GetTimeZoneInformation() Local $utcTime = "" If Not $sDate Then $sDate = _NowCalc() If Int(StringLeft($sDate, 4)) < 1970 Then Return "" If $aSysTimeInfo[0] = 2 Then ; if daylight saving time is active $utcTime = _DateAdd('n', $aSysTimeInfo[1] + $aSysTimeInfo[7], $sDate) ; account for time zone and daylight saving time Else $utcTime = _DateAdd('n', $aSysTimeInfo[1], $sDate) ; account for time zone EndIf Return _DateDiff('s', "1970/01/01 00:00:00", $utcTime) EndFunc ;==>_GetUnixTime ;$blTrim: Year in short format and no seconds. Func _GetDate_fromUnixTime($iUnixTime, $iReturnLocal = True) Local $aRet = 0, $aDate = 0 Local $aMonthNumberAbbrev[13] = ["", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] Local $timeAdj = 0 If Not $iReturnLocal Then Local $aSysTimeInfo = _Date_Time_GetTimeZoneInformation() Local $timeAdj = $aSysTimeInfo[1] * 60 If $aSysTimeInfo[0] = 2 Then $timeAdj += $aSysTimeInfo[7] * 60 EndIf $aRet = DllCall("msvcrt.dll", "str:cdecl", "ctime", "int*", $iUnixTime + $timeAdj ) If @error Or Not $aRet[0] Then Return "" $aDate = StringSplit(StringTrimRight($aRet[0], 1), " ", 2) Return $aDate[4] & "/" & StringFormat("%.2d", _ArraySearch($aMonthNumberAbbrev, $aDate[1])) & "/" & $aDate[2] & " " & $aDate[3] EndFunc ;==>_GetUnixDate Enjoy! Realm Update: >Added some functionality and a suggestion from FireFox
    1 point
  13. mike2003, Opt("GUICloseOnESC", 0) should do the trick. M23
    1 point
  14. trancexx

    ResHacker project

    Resources viewer and compiler. You can drop file (dll, exe ...) on treeview or use menu control to load file, or drop file on executable after compiled or just run and use it as a resource dll compiler. Constructive comments are always welcomed. New script attached (16th April 2009) How to use compiling option: - click on Action menu. - choose Initialize Compiler. - go to menu again and choose Generate Initial DLL - any file that you want to add to your resource dll drop on tree view or use Add Resource button. New window pops up. You need to chose type, name and language of resource. You can choose to use predifined values, only name is required in that case. - when you are done with modifications save new dll file. File menu will have Save as... option - that's it. You have your resource dll compiled with AutoIt Supported resources: - RT_CURSOR - RT_BITMAP - RT_ICON - RT_MENU - RT_DIALOG - RT_STRING - RT_ACCELERATOR - RT_GROUP_CURSOR - RT_GROUP_ICON - RT_VERSION - RT_ANICURSOR - RT_ANIICON - RT_HTML - RT_MANIFEST - AVI (special) - WAV (special) - JPEG (special) - PNG (special) - GIF (special) By supported I mean that resource can be viewed and/or saved. Other resources are shown as hexadecimals, with ASCII character and address display. Download script (zip format due to upload size limit): ResourcesViewerAndCompiler.zip edit: had to remove the old attachment to make more space in my attachment folder.
    1 point
  15. MyEarth

    Detect GPT Drive

    Untested ConsoleWrite("_IsDiskGPT: " & _IsDiskGPT() & @CRLF) Func _IsDiskGPT() Local $oWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") If Not IsObj($oWMIService) Then Return SetError(1, 0, 0) Local $o_ProcessInfo = $oWMIService.ExecQuery("Select * from Win32_DiskPartition WHERE Index = 0") Local $sReturn For $o_ObjProcess In $o_ProcessInfo $sReturn = $o_ObjProcess.Type ExitLoop Next If StringInStr($sReturn, "GPT") Then Return 1 Return 0 EndFunc ;==>_IsDiskGPT
    1 point
  16. I'm still not sure what "in memory" means in this context, but if it's simply "from a script" then: RegWrite("HKCU\SOFTWARE\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "http://www.autoitscript.com")
    1 point
  17. Thanks for a quick response. I'm really new to scripting, so please bare me if I don't make any sense. I used ShellExecute and was successful in getting the applicaiton installed silently, but was not able to pass the parameters that I wanted to. This is what I have in my script: ShellExecute("\\Server\Dragon\DNS10\setup.exe", "/S /v/qn, SERIALNUMBER=xxxxx-xxx-xxxx-xxxx-xx ADDLOCAL=ALL ALLUSERS=1 WEBREGISTRATION=1 DEFAULTSINI=nsdefaults.ini ROAMINGUSERINI=roamingdef.ini ROAMINGUSEROPTIONS=testroamoptions.ini") Any help will be highly appreciated. Thanks!
    1 point
  18. Trancexx, Cedo maiori, It would have to be stored in a different way, and so they are intending to change it by 2038, so yes it could reach that point, but by then we'll be using a new method, and will all own quantum computers (hopefully). My method doesn't do pre 1970 either. Kafu, I knew that was a bad idea, kuckily ours broke before it could do any real damage. MDiesel
    1 point
  19. If you don't want the title bar, you can use any of these two styles in GUICreate() > $WS_POPUP - Creates a window without a title bar, and without border. > $WS_POPUPWINDOW - Creates a windows without a title bar but with a border.
    1 point
  20. none of these are likely to be implemented
    0 points
×
×
  • Create New...