Simpel

Again WinHTTP and Proxy

12 posts in this topic

#1 ·  Posted (edited)

Hi there.

I'm testing this code:

#include "WinHttp.au3"

; http://www.w3schools.com/php/demo_form_validation_escapechar.php
$sUserName = "SomeUserName"
$sEmail = "some.email@something.com"
$sDomain = "www.w3schools.com"
$sPage = "/php/demo_form_validation_escapechar.php"

; Data to send
$sAdditionalData = "name=" & $sUserName & "&email=" & $sEmail

; Initialize and get session handle
$hOpen = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hOpen = ' & $hOpen & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

; Get connection handle
$hConnect = _WinHttpConnect($hOpen, $sDomain)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hConnect = ' & $hConnect & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

; Make a request
$hRequest = _WinHttpOpenRequest($hConnect, "POST", $sPage)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hRequest = ' & $hRequest & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

; Send it. Specify additional data to send too. This is required by the Google API:
$hSendRequest = _WinHttpSendRequest($hRequest, "Content-Type: application/x-www-form-urlencoded", $sAdditionalData)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hSendRequest = ' & $hSendRequest & @CRLF & '>Error code: ' & @error & @TAB & "@extended: " & @extended & @CRLF) ;### Debug Console

; Wait for the response
$hReceiveResponse = _WinHttpReceiveResponse($hRequest)

; See what's returned
Dim $sReturned
If _WinHttpQueryDataAvailable($hRequest) Then ; if there is data
    Do
        $sReturned &= _WinHttpReadData($hRequest)
    Until @error
EndIf

; Close handles
_WinHttpCloseHandle($hRequest)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)

; See what's returned
ConsoleWrite("Returned: " & $sReturned & @CRLF)

But sending a request fails.

Console outputs this:

>Running:(3.3.12.0) ...
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
@@ Debug(14) : $hOpen = 0x00000000007DF540
>Error code: 0
@@ Debug(18) : $hConnect = 0x00000000008271C0
>Error code: 0
@@ Debug(22) : $hRequest = 0x00000000008B88E0
>Error code: 0
@@ Debug(26) : $hSendRequest = 0
>Error code: 1 @extended: 0
Returned:
+>17:00:18 AutoIt3.exe ended.rc:0
+>17:00:18 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.6003

I'm testing it at work. There, we always have to identify at a proxy to be allowed to go to internet. But requests via inet.au3 will work. Maybe our firewall will block the request?

Any ideas? I don't have any possibilities to test at home, because of OSX.

 

Regards, Conrad

Edited by Simpel
formating code + [Solved] + Problem again

SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites



If you need to identify proxy IE uses then you can use _WinHttpGetIEProxyConfigForCurrentUser() function.

;...
$aIEproxy = _WinHttpGetIEProxyConfigForCurrentUser()
$sProxy = $aIEproxy[2]

$hOpen = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0", $WINHTTP_ACCESS_TYPE_NAMED_PROXY, $sProxy)
;...

 


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
_ArrayDisplay($aIEproxy)

says:

[0]         1
[1]
[2]
[3]

and:

ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sProxy = ' & $sProxy & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

says:

@@ Debug(15) : $sProxy = 
@@ Debug(21) : $hOpen = 0
>Error code: 0

$aIEproxy[0] = 1 means autodetect, correct? If I now try your modified "$hOpen" it's not working.


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

AutoDetect 1 means IE doesn't use PAC.
If you get no-proxy, like you do then that's not the way to go.

How do yo identify yourself for proxy?

 


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

ipconfig /all replies

WINS-Proxy activated - NO

If I use intranet I'm always fine. When I want to use internet connection I first have to type in username and password.


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

Type in where?

Do you open some site in IE or what?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Yes.

If I open a site in IE or FF. FF says something like: "Proxy moz-proxy://xxxprx01.xxx-xxx.de:8080 Needs username and password".


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites
$sProxy = "xxxprx01.xxx-xxx.de:8080"

Now I'm a bit forward. $hSendRequest includes now "credentials are missing - username and password". Fine.

How to put username and password into the proxy variable? "USERNAME:PASSWORD@xxxprx01.xxx-xxx.de:8080" is not working.


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

My guess you are dealing with proxy that supports session based authentication. That means that for every session you have to authenticate.
If that's true you need to extend _WinHttpOpen() and add authentication routine. Like this maybe:

#include "WinHttp.au3"

Global Const $sAddress = "http://xxxprx01.xxx-xxx.de:8080" ; address of your proxy that requires authorization

; Credentials
Global Const $sUserName = "user", $sPassword = "password"
; Open session (with credentials from above)
Global $hOpen = OpenProxySession($sAddress)


; Try some site now
$hConnect = _WinHttpConnect($hOpen, "http://google.com")
; Simple-request it...
MsgBox(64, "Returned (first 1400 characters of google.com)", StringLeft(_WinHttpSimpleRequest($hConnect), 1400) & "...")
; Close handle
_WinHttpCloseHandle($hConnect)


; Finally close session
_WinHttpCloseHandle($hOpen)



Func OpenProxySession($sAddress)
    ; Initialize and get session handle
    Local $hOpen = _WinHttpOpen()
    If $hOpen Then
        ; Get connection handle
        Local $hConnect = _WinHttpConnect($hOpen, $sAddress)

        If $hConnect Then
            ; Specify the reguest
            Local $hRequest = _WinHttpOpenRequest($hConnect)
            If $hRequest Then
                ; Send the request
                _WinHttpSendRequest($hRequest)

                ; Wait for the response
                _WinHttpReceiveResponse($hRequest)

                ; Query status code
                Local $iStatusCode = _WinHttpQueryHeaders($hRequest, $WINHTTP_QUERY_STATUS_CODE)
                ; Check status code
                If $iStatusCode = $HTTP_STATUS_DENIED Or $iStatusCode = $HTTP_STATUS_PROXY_AUTH_REQ Then
                    ; Query Authorization scheme
                    Local $iSupportedSchemes, $iFirstScheme, $iAuthTarget
                    If _WinHttpQueryAuthSchemes($hRequest, $iSupportedSchemes, $iFirstScheme, $iAuthTarget) Then
                        ; Set passed credentials
                        _WinHttpSetCredentials($hRequest, $iAuthTarget, $iFirstScheme, $sUserName, $sPassword)
                        ; Send request again now
                        _WinHttpSendRequest($hRequest)
                        ; And wait for the response again
                        _WinHttpReceiveResponse($hRequest)
                        ; Excellent. You should be in if credentials were ok!!!
                    EndIf
                EndIf
                _WinHttpCloseHandle($hRequest)
            EndIf
            _WinHttpCloseHandle($hConnect)
        EndIf
    EndIf
    ; Return session handle
    Return $hOpen
EndFunc

But that's really only my guess.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Scratch that, this should work:

#include "WinHttp.au3"

Global Const $sProxy = "http://xxxprx01.xxx-xxx.de:8080" ; address of your proxy that requires authorization
; Credentials
Global Const $sUserName = "username", $sPassword = "password" ; set correct 

; Open session
Global $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240", $WINHTTP_ACCESS_TYPE_NAMED_PROXY, $sProxy)
;~ _WinHttpSetOption($hOpen, $WINHTTP_OPTION_REDIRECT_POLICY, $WINHTTP_OPTION_REDIRECT_POLICY_NEVER)

; Try some site now
$hConnect = _WinHttpConnect($hOpen, "http://www.w3.org/")

$hRequest = _WinHttpSimpleSendRequest_ProxyAuth($hConnect)
; Simple-read...
MsgBox(4096, "http://www.w3.org/ says", _WinHttpSimpleReadData($hRequest))


; Close handles
_WinHttpCloseHandle($hRequest)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)



Func _WinHttpSimpleSendRequest_ProxyAuth($hConnect, $sType = Default, $sPath = Default, $sReferrer = Default, $sDta = Default, $sHeader = Default)
    ; Specify the reguest
    Local $hRequest = _WinHttpSimpleSendRequest($hConnect, $sType, $sPath, $sReferrer, $sDta, $sHeader)
    If $hRequest Then
        ConsoleWrite(_WinHttpQueryHeaders($hRequest) & @CRLF) ; let's print what the proxy says
        ; Query status code
        Local $iStatusCode = _WinHttpQueryHeaders($hRequest, $WINHTTP_QUERY_STATUS_CODE)
        ; Check status code
        If $iStatusCode = $HTTP_STATUS_PROXY_AUTH_REQ Then
            ; Query Authorization scheme
            Local $iSupportedSchemes, $iFirstScheme, $iAuthTarget
            If _WinHttpQueryAuthSchemes($hRequest, $iSupportedSchemes, $iFirstScheme, $iAuthTarget) Then
                ; Set passed credentials
                _WinHttpSetCredentials($hRequest, $iAuthTarget, $iFirstScheme, $sUserName, $sPassword)
                ; Send request again now
                _WinHttpSendRequest($hRequest)
                ; And wait for the response again
                _WinHttpReceiveResponse($hRequest)
                ; Excellent. You should be in if credentials were ok!!!
            EndIf
        EndIf
    EndIf
    Return $hRequest
EndFunc

However I'm not sure what will happen if you "open" address that redirects to another address. Proxy I tested this with doesn't cache credentials, and therefore redirects fail. If that would happen to you then uncomment the line below _WinHttpOpen() and test it again.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Thank you. It's working.

Sorry for delay. I had to test it under various conditions. And it took me a long time to understand how WinHttp.au3 and your snippet works.

Sometimes my code was running and then with little changes not.

Thanks and regards, Conrad


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Hi,

now it's broken. They changed something. This is your code modified by me:

#include "WinHttp.au3"

Global Const $sProxy = "http://PROXY:8080" ; address of your proxy that requires authorization
; Credentials
Global Const $sUserName = "USER", $sPassword = "PASSWORD" ; set correct

; Open session
Global $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240", $WINHTTP_ACCESS_TYPE_NAMED_PROXY, $sProxy)
;~ _WinHttpSetOption($hOpen, $WINHTTP_OPTION_REDIRECT_POLICY, $WINHTTP_OPTION_REDIRECT_POLICY_NEVER)

; Try some site now
$hConnect = _WinHttpConnect($hOpen, "http://posttestserver.com")

$hRequest = _WinHttpSimpleSendRequest_ProxyAuth($hConnect)
; Simple-read...
MsgBox(4096, "http://posttestserver.com/ says", _WinHttpSimpleReadData($hRequest))

$msg = _POST()
MsgBox(0, '', $msg)
ClipPut($msg)
Exit

; Close handles
_WinHttpCloseHandle($hRequest)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)

Func _POST()
   Local $sData = ("Something to test and post.")
   Local $vRequest = _WinHttpSimpleRequest($hConnect, "POST", "http://posttestserver.com/post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded")
   If @error Then Return "Unable To Send Request"
   Return $vRequest
EndFunc

Func _WinHttpSimpleSendRequest_ProxyAuth($hConnect, $sType = Default, $sPath = Default, $sReferrer = Default, $sDta = Default, $sHeader = Default)
    ; Specify the reguest
    Local $hRequest = _WinHttpSimpleSendRequest($hConnect, $sType, $sPath, $sReferrer, $sDta, $sHeader)
    If $hRequest Then
;~         ConsoleWrite(_WinHttpQueryHeaders($hRequest) & @CRLF) ; let's print what the proxy says
        ; Query status code
        Local $iStatusCode = _WinHttpQueryHeaders($hRequest, $WINHTTP_QUERY_STATUS_CODE)
        ; Check status code
        If $iStatusCode = $HTTP_STATUS_PROXY_AUTH_REQ Then
            ; Query Authorization scheme
            Local $iSupportedSchemes, $iFirstScheme, $iAuthTarget
            If _WinHttpQueryAuthSchemes($hRequest, $iSupportedSchemes, $iFirstScheme, $iAuthTarget) Then
                ; Set passed credentials
                _WinHttpSetCredentials($hRequest, $iAuthTarget, $iFirstScheme, $sUserName, $sPassword)
                ; Send request again now
                _WinHttpSendRequest($hRequest)
                ; And wait for the response again
                _WinHttpReceiveResponse($hRequest)
                ; Excellent. You should be in if credentials were ok!!!
            EndIf
        EndIf
    EndIf
    Return $hRequest
EndFunc

The output my clipboard contains:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<!-- FileName: index.html
     Language: [en]
-->
<!--Head-->
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  <meta http-equiv="X-UA-Compatible" content="IE=7" />
  <title>Proxy Message</title>
  <script src="/mwg-internal/de5fs23hu73ds/files/javascript/sw.js" type="text/javascript" ></script>
  <link rel="stylesheet" href="/mwg-internal/de5fs23hu73ds/files/default/stylesheet.css" />
</head>
<!--/Head-->
<!--Body-->
<body onload="swOnLoad();">
  <table class='bodyTable'>
    <tr>
      <td class='bodyData' background='/mwg-internal/de5fs23hu73ds/files/default/img/bg_body.gif'>
<!--Logo-->
<table class='logoTable'>
  <tr>
    <td class='logoData'>
      <a href='http://www.xxxxxxxxxxxxxxx.de'>
        <img src='/mwg-internal/de5fs23hu73ds/files/default/img/logo_mwg.png'></a>
    </td>
  </tr>
</table>
<!--/Logo-->
<!--Contents-->
<!-- FileName: authenticationrequired.html
     Language: [en]
-->
<!--Title-->
<table class='titleTable' background='/mwg-internal/de5fs23hu73ds/files/default/img/bg_navbar.jpg'>
  <tr>
    <td class='titleData'>
      Authentication Required
    </td>
  </tr>
</table>
<!--/Title-->

<!--Content-->
<table class="contentTable">
  <tr>
    <td class="contentData">
      You must be authenticated to access this URL.
    </td>
  </tr>
</table>
    
<script language="javascript" type="text/javascript">
   urlprotocol = "http";
   statuscode=407;

   if(statuscode==401 && urlprotocol == "ftp"){
      document.write("<form name=\"ftpform\" method=\"get\" action=\"\">");
      document.write("<table class=\"contentData\">");
      document.write("<tr><td class=\"contentData\" colspan=2>Please enter your credentials in the form below and click \"Access FTP\" button if your browser doesn't present authentication promt for FTP sites.</td></tr>");
      document.write("<tr><td class=\"contentData\">Username:</td><td><input type=\"text\" id=\"ftpUsername\" name=\"ftpUsername\" size=40 /></td></tr>");
      document.write("<tr><td class=\"contentData\">Password:</td><td><input type=\"password\" id=\"ftpPassword\" name=\"ftpPassword\" size=40 /></td></tr>");
      document.write("<tr><td class=\"contentData\" colspan=2 align=center><input type=\"button\" onclick=\"redirectToFTP();\" value=\"Access FTP\" /></td></tr>");
      document.write("</table>");
      document.write("</form>");
   }
   
   function redirectToFTP(){
      var username=escape(document.getElementById("ftpUsername").value);
      var password=escape(document.getElementById("ftpPassword").value);
      location.href = "ftp://"+username+":"+password+"@posttestserver.com:80/http://posttestserver.com/post.php"
   }
</script>
<!--/Content-->

<!--Info-->
<table class="infoTable">
  <tr>
    <td class="infoData">
      <b>URL: </b><script type="text/javascript">break_line("http://posttestserver.com/http://posttestserver.com/post.php");</script><br />
    </td>
  </tr>
</table>
<!--/Info-->

<!--/Contents-->
<!--Policy-->
<table class='policyTable'>
  <tr>
    <td class='policyHeading'>
      <hr>
      Company Acceptable Use Policy
    </td>
  </tr>
  <tr>
    <td class='policyData'>
      This is an optional acceptable use disclaimer that appears on every page. You may change the wording or remove this section entirely in index.html.
    </td>
  </tr>
</table>
<!--/Policy-->
<!--Foot-->
<table class='footTable'>
  <tr>
    <td class='helpDeskData' background='/mwg-internal/de5fs23hu73ds/files/default/img/bg_navbar.jpg'>
      For assistance, please contact your system administrator.
    </td>
  </tr>
  <tr>
    <td class='footData'>
      generated <span id="time">2016-05-09 21:46:25</span> by McAfee Web Gateway
      <br />
<br />
      Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
    </td>
  </tr>
</table>
<!--/Foot-->
      </td>
    </tr>
  </table>
</body>
<!--/Body-->
</html>

_WinHttpSimpleReadData is working _WinHttpSimpleRequest not. What's wrong?

Regards, Conrad

Edited by Simpel

SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • wakillon
      By wakillon
      HttpHeaderWatcher v1.0.1.3
       

      Some time ago, some members asked how to see the Http Requests.
      There are quite a few external applications but not in AutoIt!
      HttpHeaderWatcher in association with WinPcap, very modestly solves this lack.
       
      Once done this http watcher, i asked me : why not Re-build a WinHttp Request in AutoIt from a selected Request in one Click ?
      So i have added a "Create au3" button who open the WinHttp Request of your choice in AutoIt format in SciTE Editor.
      Voila voila, hope it can help ! 
      Buttons were made online with chimply.com the easy and free buttons generator !
      See Help for more infos.
      previous downloads : 253
      source and executable are available in the Download Section
      Hope you like it !
    • CodingMonkey81
      By CodingMonkey81
      All,
      I'm working on automating the update process for a piece of software that we use at my company. The installer file always contains the version number as a part of the file name (eg InstallFile_9342.msi) and the numbers always change with every update.
      How do I use AutoIt to run the program? I know I can't use a wildcard in place of the numbers when using the "Run" command. 
      I tried 
      Local $aArray = _FileListToArray("C:\path\to\file", "InstallFile_*.msi", 0, 1) Run("$aArray") and I also tried
      Local $bInstall = FileFindFirstFile("InstallFile_*.msi") Run("$bInstall") and neither worked. 
      Can someone please point me in the right direction? I've done some searching on the forum and haven't found anyone in a similar situation before.
      Thanks!
    • RHolmes
      By RHolmes
      I have a program that has a control that changes color a few seconds into running. So ideally, I would poll this to tell when an event has occurred. 
      I can't seem to retrieve the correct color value for a control. It always seems to return white indicating that its selecting somewhere else in the window.
      In the PixelGetColor call I'm adding half the width to the x value and subtracting half the height to the y value  in order to get the center of the control. (assuming the coords returned by ControlGetPos are top left - which i can't be sure of) But I've also tried without modifying the x/y and with changing the PixelCoordMode option to 2. Maybe I'm making a silly mistake and can't see it? Any help would be appreciated.
      Code is below:
      Opt("PixelCoordMode", 0)
      FileChangeDir( "C:\Where\My\File\Is" );
      Run( "MyProgram.exe" )
      Local $hClient = WinWaitActive( $CLIENT_TITLE, "", 10 )
      Local $systemIndicatorClassNN= "[CLASS:Qt5QWindowIcon; INSTANCE:99]"
      Local $hSystemIndicator = ControlGetHandle ( $hClient, "", $systemIndicatorClassNN)
      Local $xywh = ControlGetPos ( $hClient, "", $hSystemIndicator )
      For $i = 10 To 1 Step -1
            $color = PixelGetColor ( $xywh[0] + ($xywh[2]/2), $xywh[1] - ($xywh[3]/2), $hClient )
            LogToFile( $color )
            Sleep( 2000 )
      Next
    • VAN0
      By VAN0
      Hello.
      I have a program XX that asks for user confirmation on exit, which hangs the system reboot/shutdown process until I confirm. So I decided create a autoit script that would automatically close that dialog and let the system reboot/shutdown.
      The problem I'm facing is that my scripts now exits before the XX.
      Is there a way delay script exit until the XX is closed but only when system is rebooting/shutting down?
       
      Thank you.
    • nhardel
      By nhardel
      I have been working on trying to develop some scripts to interface with the REST/JSON API from the Orion SDK.  This is where I will ask my questions and hopefully get some community responses that could help benefit others. 
      https://github.com/solarwinds/OrionSDK
      I am trying to create examples of how to interface with the API from autoit.  This should be a knowledge dump for this task.