Jump to content

Need Help about Run and 911 . Thank all.


Recommended Posts

Hi everybody .
I am working to change the ip of the 911.
API 911 tells me to call a piece of software and it returns a message. But I don't know how to take it. My English is not good so I have not found a solution yet.

The problem of retrieving the message, and retrieving the hwnd of the software calling 911. Thank you . 911 API say here:

With using -hwnd= parameter, Autoproxytool.exe will send WM_COPYDATA message to your soft which launches Autoproxytool.exe, so that your soft is able to get postcheck and more info of the proxy, you also need to pass the Window Handle of your soft which launches Autoproxytool.exe and Autoproxytool.exe will send you WM_COPYDATA message with the following format and info:

1. if the proxy successful get by api:

success|ip|Ping|ProxyCountry|ProxyState|ProxyCity|911s5 account balance

2. if the proxy failed to get by api:

failed|reason for failure

Some examples of how to use it:
Autoproxytool.exe -changeproxy/US -zip=92626 -proxyport=5000 -hwnd=YOUR SOFT'S WINDOW HANDLE

Thank you for reading.

xxxxxxxxxxx

Link to comment
Share on other sites

I made an IPC based on that message (WM_COPYDATA).  You can refer to the code in my signature.

It is not very complicated.  You will need to create a GUI (showed or hidden as you wish), pass its handle to your tool as you described, and register the WM_COPYDATA message.  You should get message with the appropriate format into the string part of the message.

Refer mostly to the client part of the UDF to create your own project.  Put something together and come back with your code if you need help...

Link to comment
Share on other sites

1 hour ago, Nine said:

I made an IPC based on that message (WM_COPYDATA).  You can refer to the code in my signature.

It is not very complicated.  You will need to create a GUI (showed or hidden as you wish), pass its handle to your tool as you described, and register the WM_COPYDATA message.  You should get message with the appropriate format into the string part of the message.

Refer mostly to the client part of the UDF to create your own project.  Put something together and come back with your code if you need help...

Hi Nine . Thank you so much . i have read A simple fast IPC based on Windows Messaging .

But when i code it notworking . my code when change .

Global $hWnd = WinGetHandle("[title:Ver 1.0]") ; Get my gui hwnd   and i have change $WCD_SERVER_WINDOW_NAME = "AutoProxyTool" to get hwnd of 911
$_WCD_Verbose = True ; as for the server, you can decide to make client verbose or not

Global $hWndServer = _WCD_GetServerHandle ()

_WCD_Send($hWnd, $hWndServer, "ProxyAPI.exe -changeproxy / US -zip = 92626 -proxyport = 5000 -hwnd ="&$hWnd) ; Test 1
;WCD_Send($hWnd, $hWndServer, "ProxyTool.exe -changeproxy / US -zip = 92626 -proxyport = 5000 -hwnd ="&$hWnd) ; Test 1
;WCD_Send($hWnd, $hWndServer, "-changeproxy / US -zip = 92626 -proxyport = 5000 -hwnd ="&$hWnd) ; Test 1
Local $sString = WaitForResponse ()
ConsoleWrite ($sString & @CRLF)
_WCD_Send($hWnd, $hWndServer, 2, "5") ; adding text to a more complex request
$sString = WaitForResponse ()
ConsoleWrite ($sString & @CRLF)

Thank you again for your help. Wish you a lucky day

xxxxxxxxxxx

Link to comment
Share on other sites

In the software's root folder, there's a sub folder: "proxytool" and there's a file "Autoproxytool.exe" in it

Using your soft/script which want to implement the api to launch "Autoproxytool.exe" with the following parameters, then you are able to change proxy automatically:

😇😢😇

$WCD_SERVER_WINDOW_NAME = "AutoProxyTool"

xxxxxxxxxxx

Link to comment
Share on other sites

The WCD server is useless in your case.  You only need the client part as I told you.  Here, I put something up to help you out.  Study it, put more error handling if required.

It is untested. I cannot run it since I do not have that tool.  So you will need to figure out the missing pieces...

#include <WindowsConstants.au3>

Global Const $tagCOPYDATA = "dword data;dword len;ptr str"
Global Const $_WCD_LOGFILE = "WCD_Logfile.log"

HotKeySet("{ESC}", _Exit)

Global $_WCD_ClientResponse[3]
Global $_WCD_Verbose = True

Example()

Func Example()
  Local $hWnd = _WCD_CreateClient("Test 911")
  Local $iPID = Run("Autoproxytool.exe -changeproxy/US -zip=92626 -proxyport=5000 -hwnd=" & $hWnd)
  If $_WCD_Verbose Then __WCD_Verbose("Run = " & @error & "/" & $iPID)
  Local $sString = WaitForResponse()
  ConsoleWrite($sString & @CRLF)
  While Sleep(100)
  WEnd
EndFunc   ;==>Example

Func WaitForResponse()
  Local $sResp
  While Sleep(100)
    $sResp = _WCD_Client_GetResponse()
    If $sResp <> "" Then Return $sResp
    ConsoleWrite(".")
  WEnd
EndFunc   ;==>WaitForResponse

Func _WCD_Client_GetResponse()
  If Not $_WCD_ClientResponse[0] Then Return ""
  $_WCD_ClientResponse[0] = False
  If $_WCD_Verbose Then __WCD_Verbose("Client Response cleared with data " & $_WCD_ClientResponse[1] & " and string " & $_WCD_ClientResponse[2])
  Return SetExtended($_WCD_ClientResponse[1], $_WCD_ClientResponse[2])
EndFunc   ;==>_WCD_Client_GetResponse

Func _WCD_CreateClient($sWindowTitle = "")
  If $_WCD_Verbose Then __WCD_Verbose("--------------  Client initiated --------------")
  Local $hWCD = GUICreate($sWindowTitle)
  If $_WCD_Verbose Then __WCD_Verbose("Client handle = " & $hWCD)
  GUIRegisterMsg($WM_COPYDATA, _WCD_WM_COPYDATA_CLIENT_HANDLER)
  Return $hWCD
EndFunc   ;==>_WCD_CreateClient

Func _WCD_WM_COPYDATA_CLIENT_HANDLER($hWnd, $iMsg, $wParam, $lParam)
  Local $tData = DllStructCreate($tagCOPYDATA, $lParam), $sString = ""
  If $tData.len Then
    Local $tStr = DllStructCreate('char str[' & $tData.len - 1 & ']', $tData.str)
    $sString = $tStr.str
  EndIf
  $_WCD_ClientResponse[0] = True
  $_WCD_ClientResponse[1] = $tData.data
  $_WCD_ClientResponse[2] = $sString
  If $_WCD_Verbose Then __WCD_Verbose("Client Reception From " & $wParam & " To " & $hWnd & " with Data " & $tData.data & " and String " & $sString)
  Return 1
EndFunc   ;==>_WCD_WM_COPYDATA_CLIENT_HANDLER

Func __WCD_Verbose($sMessage)
  Local Const $sTime = "[" & @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & "] "
  FileWriteLine($_WCD_LOGFILE, $sTime & $sMessage)
EndFunc   ;==>__WCD_Verbose

Func _Exit()
  Exit
EndFunc   ;==>_Exit

 

Link to comment
Share on other sites

  • 2 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...