Click here to Skip to main content
13,301,195 members (81,685 online)
Click here to Skip to main content
Add your own
alternative version


71 bookmarked
Posted 20 Jul 2000

Ping for Windows

, 15 Feb 2001
Rate this:
Please Sign up or sign in to vote.
A simple Windows based ping program
<!-- Download Links -->
  • Download source files - 133 Kb
  • Download executable - 108 Kb
  • <!-- Article image -->

    Sample Image - WinPing.jpg

    <!-- Main HTML starts here -->


    This is an extremely simple Ping program for Windows. I'm using Chris Maunder's auto-completion combo box class and there's code borrowed from a Winsock 2.0 book. Credits are mentioned on the About box.

    Please see the code for details - it's quite simple.


    7 Sep 2000:

    • Fixes to MRU Combo
    • Fixes to Duplicate host/ip addresses
    • Fixes to Ping times (Now correct)

    16 Sep 2001:

    • Updated source code


    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    About the Author

    Software Developer (Senior) Software Kinetics
    United Kingdom United Kingdom

    Software Kinetics
    are experts in developing customised and bespoke applications and have expertise in the development of desktop, mobile and internet applications on Windows.

    We specialise in:

    • User Interface Design
    • Desktop Development
    • Windows Phone Development
    • Windows Presentation Framework
    • Windows Forms
    • Windows Communication Framework
    • Windows Services
    • Network Applications
    • Database Applications
    • Web Development
    • Web Services
    • Silverlight

    Visit Software Kinetics

    You may also be interested in...

    Comments and Discussions

    QuestionIt's pinging a virtual machine on VMWare when I pause that Pin
    cnalmeida14-Oct-15 4:51
    membercnalmeida14-Oct-15 4:51 
    QuestionUpdates for vs2013 - Continued Pin
    rhfritz19-Sep-15 9:49
    memberrhfritz19-Sep-15 9:49 
    SuggestionUpdates for vs2013 Pin
    rhfritz19-Sep-15 9:43
    memberrhfritz19-Sep-15 9:43 
    QuestionPing Pin
    Member 1170006121-May-15 10:28
    memberMember 1170006121-May-15 10:28 
    QuestionAwesome, thank you! Pin
    J Eakin21-Mar-13 9:35
    memberJ Eakin21-Mar-13 9:35 
    Generalyou are a hero ! man Pin
    batsword4-Sep-10 20:17
    memberbatsword4-Sep-10 20:17 
    GeneralBug Pin
    StKgn22-Apr-10 1:12
    memberStKgn22-Apr-10 1:12 
    GeneralRe: Bug Pin
    Norm .net22-Apr-10 1:28
    groupNorm .net22-Apr-10 1:28 
    GeneralNon administrator account Pin
    saenz tomas24-Mar-10 8:08
    membersaenz tomas24-Mar-10 8:08 
    GeneralMy vote of 1 Pin
    Sheetal_Joshi8-Dec-09 7:10
    memberSheetal_Joshi8-Dec-09 7:10 
    Generalit is not a real multi-thread ? [modified] Pin
    Adore C++4-Dec-08 11:51
    memberAdore C++4-Dec-08 11:51 
    GeneralNot working on Vista Pin
    TRK29-Oct-07 10:35
    memberTRK29-Oct-07 10:35 
    GeneralRe: Not working on Vista Pin
    Member 446097211-Mar-08 5:30
    memberMember 446097211-Mar-08 5:30 
    GeneralRe: Not working on Vista Pin
    ashishbhadiyadra13-Apr-09 20:14
    memberashishbhadiyadra13-Apr-09 20:14 
    GeneralRe: Not working on Vista Pin
    cniculescu23-Sep-09 11:21
    membercniculescu23-Sep-09 11:21 
    GeneralRe: Not working on Vista Pin
    liugh69819-Feb-10 23:45
    memberliugh69819-Feb-10 23:45 
    GeneralRe: Not working on Vista Pin
    steveh211212-Jul-14 23:24
    membersteveh211212-Jul-14 23:24 
    GeneralRe: Not working on Vista Pin
    zhangchunming11-Mar-12 2:35
    memberzhangchunming11-Mar-12 2:35 
    GeneralExcellent work! Pin
    428820-Aug-07 11:35
    member428820-Aug-07 11:35 
    GeneralCalling OnTimer(); after calling socket( Pin
    marreoragarn10-May-07 6:33
    membermarreoragarn10-May-07 6:33 

    I making this program to an console app. Because of that I need to change the code. In debuging mode, after calling rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
    The socket is SOCKET == ERROR and goes into Error mode instead of going to the OnPing as it does in the winapp.

    Why does the compiler go to OnTimer after that the socket funktion is called?

    Look here
    -> rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
    -> void CWinPingDlg::OnTimer(UINT nIDEvent)

    I am nott familiar with sockets!

    Any suggestions?

    Generalwhen my firewall is open this ping program cannot ping to the web server Pin
    sude6-Dec-06 17:10
    membersude6-Dec-06 17:10 
    GeneralRequest Pin
    rahul_s99915-Jun-06 15:30
    memberrahul_s99915-Jun-06 15:30 
    GeneralRange maintaining Pin
    atunamatata13-Apr-06 22:10
    memberatunamatata13-Apr-06 22:10 
    GeneralRe: Range maintaining Pin
    webmastersitesi5-Jan-09 19:15
    memberwebmastersitesi5-Jan-09 19:15 
    GeneralWSAError: 10022 Pin
    kkooccuurr30-May-05 11:51
    memberkkooccuurr30-May-05 11:51 
    Generalsource files Pin
    surfman1910-Feb-04 2:49
    membersurfman1910-Feb-04 2:49 
    QuestionHow can I stop the ping-request Pin
    JessicaLampe13-Dec-03 6:39
    sussJessicaLampe13-Dec-03 6:39 
    QuestionHow to send and receive a broadcast ping Pin
    elsayed_mazen14-Oct-03 18:33
    memberelsayed_mazen14-Oct-03 18:33 
    Generalping under XP Pin
    yyyKaktus29-Sep-03 20:22
    memberyyyKaktus29-Sep-03 20:22 
    GeneralRe: ping under XP Pin
    mohamad15-May-04 0:38
    membermohamad15-May-04 0:38 
    GeneralRe: ping under XP Pin
    same.wong21-Aug-12 16:13
    membersame.wong21-Aug-12 16:13 
    GeneralBug Pin
    Yossi Meir15-Mar-03 22:47
    memberYossi Meir15-Mar-03 22:47 
    GeneralRe: Bug Pin
    Hanney Wang16-Mar-03 20:08
    memberHanney Wang16-Mar-03 20:08 
    GeneralNot work very well - A bug. Pin
    Hanney Wang24-Dec-02 17:36
    memberHanney Wang24-Dec-02 17:36 
    GeneralRe: Not work very well - A bug. Pin
    Jesús O.1-Feb-03 10:47
    memberJesús O.1-Feb-03 10:47 
    GeneralRe: Not work very well - A bug. Pin
    Norm Almond1-Feb-03 23:14
    memberNorm Almond1-Feb-03 23:14 
    GeneralRe: Not work very well - A bug. Pin
    Hanney Wang15-Mar-03 3:25
    memberHanney Wang15-Mar-03 3:25 
    GeneralRe: Not work very well - A bug - for Sonu Kapoor . Pin
    Hanney Wang30-Mar-03 16:36
    memberHanney Wang30-Mar-03 16:36 
    GeneralRe: Not work very well - A bug - for Sonu Kapoor . Pin
    Sonu Kapoor1-Apr-03 1:39
    memberSonu Kapoor1-Apr-03 1:39 
    GeneralRe: Not work very well - A bug - for Sonu Kapoor . Pin
    SonicYouth21-Sep-05 22:32
    memberSonicYouth21-Sep-05 22:32 
    QuestionCould you give me a TIP? Pin
    kODe mASTeR22-Nov-02 13:45
    memberkODe mASTeR22-Nov-02 13:45 
    Generalurgent !!!!! Pin
    balajiParthasarathy19-Aug-02 4:46
    sussbalajiParthasarathy19-Aug-02 4:46 
    GeneralRe: urgent !!!!! Pin
    Tak19-Oct-02 7:43
    memberTak19-Oct-02 7:43 
    GeneralFinding local IP Pin
    Camran3-Jul-02 19:05
    memberCamran3-Jul-02 19:05 
    GeneralRe: Finding local IP Pin
    Anonymous3-Jul-02 22:11
    memberAnonymous3-Jul-02 22:11 
    GeneralRe: Finding local IP Pin
    Micky Cheng3-Jul-02 22:23
    memberMicky Cheng3-Jul-02 22:23 
    GeneralRe: Finding local IP Pin
    Anonymous6-Jul-02 16:22
    memberAnonymous6-Jul-02 16:22 
    GeneralNeed Help!!!! Pin
    aimmilly19-May-02 14:12
    memberaimmilly19-May-02 14:12 
    GeneralRe: Need Help!!!! Pin
    Norm Almond3-Jul-02 22:14
    memberNorm Almond3-Jul-02 22:14 
    QuestionWin2K/NT4 only as administrator ??? Pin
    Olli23-Apr-02 0:59
    memberOlli23-Apr-02 0:59 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Terms of Use | Mobile
    Web03 | 2.8.171207.1 | Last Updated 16 Feb 2001
    Article Copyright 2000 by NormDroid
    Everything else Copyright © CodeProject, 1999-2017
    Layout: fixed | fluid