| View previous topic :: View next topic |
| Author |
Message |
bluboy
Joined: 08 May 2008 Posts: 3
|
Posted: Thu May 08, 2008 8:36 am Post subject: How to set arguments for a DllCall: IsDestinationReachable() |
|
|
Using the "dllcall" function, I am trying to get the status of my internet connection by checking if a remote host is available. using the
"SENSAPI.DLL" s
"IsDestinationReachable" Function
Here is the msdn reference page on this:
http://msdn.microsoft.com/en-us/library/aa376851(VS.85).aspx
What should be the datatypes of the argument and return parameters. I have been trying to get this working for quite some time but haven't been able to do so..
This is as far as i have come
| Code: | | Result := DllCall("SENSAPI.DLL\IsDestinationReachable" ,"str", url) |
A Small code snippet for an answer would be really really great !!
PS:
I have read the thread by SKAN which doesnt work for me
And also the one by Jordis regarding dll call return values.
[ Moderator!: MSDN link fixed ] |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Thu May 08, 2008 9:43 am Post subject: |
|
|
Here is some example code (VB)
I think you are better off using something like ping, but as a learning experience, ok... Tip: search for "structures" on the forum.
HTH |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5721
|
Posted: Thu May 08, 2008 10:09 am Post subject: |
|
|
| Code: | MsgBox, % DllCall("SENSAPI.DLL\IsDestinationReachableA" , Str,"www.skan.in", Int,0 )
MsgBox, % DllCall("SENSAPI.DLL\IsDestinationReachableA" , Str,"www.google.com", Int,0 ) |
 |
|
| Back to top |
|
 |
bluboy
Joined: 08 May 2008 Posts: 3
|
Posted: Fri May 09, 2008 6:00 am Post subject: |
|
|
Thanks SKAN ,
That did the job.. Hope to put my script here soon
To nlid
You cannot fetch the result of a "ping" from AHK, So it leaves me with only this to use..
However, it would be great to use output from command line  |
|
| Back to top |
|
 |
Z Gecko Guest
|
Posted: Fri May 09, 2008 6:58 am Post subject: |
|
|
just to be a smartass:
| Quote: | To nlid
You cannot fetch the result of a "ping" from AHK, So it leaves me with only this to use.. | is not true.
You can either pipe the output from the cmd-line to a file and read it then,
or you use this nice script by corrupt http://www.autohotkey.com/forum/topic8606.html |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5721
|
Posted: Fri May 09, 2008 8:43 am Post subject: |
|
|
| bluboy wrote: | To nlid
You cannot fetch the result of a "ping" from AHK, So it leaves me with only this to use.. |
| Code: | url=www.skan.in
RunWait, ping.exe %url% -n 1,, Hide UseErrorlevel
If Errorlevel
MsgBox,16,%url%, Destination Unreachable
Else
MsgBox,64,%url%, Destination Reachable |
 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2492 Location: Australia, Qld
|
Posted: Fri May 09, 2008 9:24 am Post subject: |
|
|
It may be worth noting:
| MSDN\IsDestinationReachable wrote: | | This function is not available on Windows Vista. |
However, I did not get the expected return value, ERROR_CALL_NOT_IMPLEMENTED=0x78. I got FALSE, and I'm quite sure the destination was actually reachable... |
|
| Back to top |
|
 |
bluboy
Joined: 08 May 2008 Posts: 3
|
Posted: Wed May 14, 2008 8:18 pm Post subject: I Hereby Accept That im a n00b |
|
|
SKANs script with "RUNWAIT" just does it for me
Thanks a lot or else i would be forever trying to use dllcalls for everything
"RunWait" is my command for the day and it was right in front of my eyes so reading the AHK Help Manual gets a priority hack and is @ #1 on my To-Do List .
@ Z- Gecko
My BAD
Correction Made
Cheers  |
|
| Back to top |
|
 |
|