Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/08/2016 in all areas

  1. jchd

    For Loop Infinite

    Yes and since a so-called "infinite loop" has no exit condition, all forms are equivalent: a linear code block terminated by a backward branch. Note that the term infinite has zero practical meaning in computer science, since noone can reasonably expect anything being infinite in the real world. Abstract mathematical objects actually infinite aren't defined by means of an infinite loop. It remains that Do..Until seems to be underused in code regularly posted, compared to While..Wend, without good reason in many situations. There is no theoretic grounds to infer that more than half of useful algorithms need to check exit condition at inner code block entry (While) or exit (Until).
    1 point
  2. Danyfirex

    For Loop Infinite

    Hello. As Melba says Correct way is using While. But a for can be infinite this way. For $i = 0 To 1 Msgbox(64, "Succes", $i) $i-=1 Next Saludos
    1 point
  3. Melba23

    For Loop Infinite

    232showtime, Use a While...WEnd loop - but you will need to have some way of exiting it at some point. M23
    1 point
  4. This is a bug and has been fixed in the latest revision of AutoIt: https://www.autoitscript.com/trac/autoit/ticket/3116 You would have to wait for another release if you want to use $WIN_STATE_* constants .
    1 point
  5. There is a ticket, although I don't see much of a description. https://www.autoitscript.com/trac/autoit/attachment/ticket/3216/WinGetState Example.au3 Indeed the statement - Constants are defined in "AutoItConstants.au3" - is misleading. I'm not sure if they belong there anyway.
    1 point
  6. From the WinGetState helpfile and its example script: According to the helpfile, you can also use $WIN_STATE_MINIMIZED, but I can't find that anywhere so either I'm missing something or the helpfile is wrong there. So I guess you're forced to just take that magic number from the help file or define your own constants.
    1 point
  7. Other alternative... Run(@ComSpec & " /c start microsoft-edge:https://google.com","",@SW_HIDE) Saludos
    1 point
  8. Ah, that would do it. Thanks @Danyfirex and thanks @Xandy for the attempts. As a side note, it turns out that you cannot manually run Edge by trying to run the .exe via Windows Explorer, they don't allow it. Weird. You have to create a shortcut linking to it to be able to execute it in any fashion other than the Taskbar/Start Menu. %windir%\explorer.exe shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge Funky!
    1 point
  9. pluto41

    TPM status with wmi

    ; TPM Security Info Opt ( 'MustDeclareVars', 1 ) Local $objWMIService, $colItem, $objItem ; Declare Local $strComputer = "." ; Local Computer ; WMI Object $objWMIService = ObjGet ( "WinMgmts:{impersonationLevel=impersonate,AuthenticationLevel=pktprivacy}//" & $strComputer & "\root\CIMV2\Security\MicrosoftTpm" ) ; WMI Object check. If IsObj ( $objWMIService ) Then ConsoleWrite ( "Object YES" & @CRLF ) ; Debug console message Else ConsoleWrite ( "Object NO" & @CRLF ) Exit 1 ; Exit Script Object error / WMI MicrosoftTpm not found. EndIf $objItem = $objWMIService.InstancesOf ( "Win32_Tpm" ) For $colItems In $objItem ConsoleWrite ( "IsActivated : " & $colItems.IsActivated_InitialValue & @CRLF ) ConsoleWrite ( "IsEnabled : " & $colItems.IsEnabled_InitialValue & @CRLF ) ConsoleWrite ( "IsOwned : " & $colItems.IsOwned_InitialValue & @CRLF ) ConsoleWrite ( "SpecVersion : " & $colItems.SpecVersion & @CRLF ) ConsoleWrite ( "ManufacturerVersion : " & $colItems.ManufacturerVersion & @CRLF ) ConsoleWrite ( "ManufacturerVersionInfo : " & $colItems.ManufacturerVersionInfo & @CRLF ) ConsoleWrite ( "ManufacturerId : " & $colItems.ManufacturerId & @CRLF ) ConsoleWrite ( "PhysicalPresenceVersionInfo : " & $colItems.PhysicalPresenceVersionInfo & @CRLF ) Next Hi, I don't have TPM enabled and i am running Windows in a virtual machine. Anyway i narrowed your'e code a bit down and rewrote a little bit. Hope this works for you.
    1 point
  10. Hello You can do something Like this... #include <WinAPIGdi.au3> #include <Array.au3> ;just for Debug Global Const $PHYSICAL_MONITOR_DESCRIPTION_SIZE = 128 ;~ PHYSICAL_MONITOR structure ;~ HANDLE hPhysicalMonitor; ;~ WCHAR szPhysicalMonitorDescription[PHYSICAL_MONITOR_DESCRIPTION_SIZE]; Global Const $sTagPHYSICAL_MONITOR = "handle;wchar[128];" Local $aMonitors = _WinAPI_EnumDisplayMonitors() ;~ _ArrayDisplay($aMonitors) Local $hMonitor = $aMonitors[1][0] Local $aRet = DllCall("Dxva2.dll", "bool", "GetNumberOfPhysicalMonitorsFromHMONITOR", "handle", $hMonitor, "dword*", 0) Local $iNumberOfPhysicalMonitors = $aRet[2] ConsoleWrite("Number Of Physical Monitors: " & $iNumberOfPhysicalMonitors & @CRLF) Local $sStringTagStructure = "" For $i = 1 To $iNumberOfPhysicalMonitors $sStringTagStructure &= $sTagPHYSICAL_MONITOR Next Local $tArrayPHYSICAL_MONITOR = DllStructCreate($sStringTagStructure) Local $PtrPhysicalMonitorArray = DllStructGetPtr($tArrayPHYSICAL_MONITOR) $aRet = DllCall("Dxva2.dll", "bool", "GetPhysicalMonitorsFromHMONITOR", "handle", $hMonitor, "dword", $iNumberOfPhysicalMonitors, "ptr", $PtrPhysicalMonitorArray) For $i = 1 To $iNumberOfPhysicalMonitors ConsoleWrite("hPhysicalMonitor: " & DllStructGetData($tArrayPHYSICAL_MONITOR, (($i) * 2) - 1) & @CRLF) ConsoleWrite("PhysicalMonitorDescription: " & DllStructGetData($tArrayPHYSICAL_MONITOR, (($i) * 2)) & @CRLF) Next $tArrayPHYSICAL_MONITOR=0;free Saludos
    1 point
  11. trancexx

    HTML editor

    Here it is HTML Editor.zip Unzip the folder, save and run. ...I was greenish.
    1 point
×
×
  • Create New...