NOTE: I am moving my web site, the old example is currently not available, but this is a newer example here:
http://forum.skype.com/index.php?showtopic=142821
I created this C# example so that people can learn a little better on how to process status messages for Skype4COMLib. Basically, it shows how to deal with ambiguous references and processes status messages for Attachment, Connection, Call, User, and Message status.
Additionally is has a Silent Mode button so you can enable silent mode as well. It has 2 links as well, the top one opens a browser window to the Skype.com site for additional Skype4COMLib examples, the Copyright link opens a browser window to my web site for addtional examples as well.
It also has the ability to start Skype if it is not running, as well as stop when a Skype user logs off or Skype is stopped. It uses Checkboxes for these 2 options. It was done In Microsoft Visual C# 2005 Express Edition which is free and can be found here:
http://msdn.microsoft.com/vstudio/express/visualcsharp/
The Entire C# project is contained here which contains all source and object:
http://testing.onlytherightanswers.com/Sky...y_ZOverLord.zip
It also is in the Skype4COM example pages under CS here as well:
https://developer.skype.com/Docs/Skype4COM/...ple?action=show
NOTE: You will need to have a copy of the latest Skype4COMLib installed on your system, which was not included in the Zip file can can be found here ("If you have Skype 3.0 for Windows on your system, it should be there already"):
https://developer.skype.com/Download
What can this do? ("From the comments in the source code"):
Example of Skype4COM status messages. Includes:
//
// Attachment Status
// Connection Status
// User Status
// Call Status
// Message Status
// Silent Mode
//
// As you can see the release version of this example program is very small, 24KB to be
// exact, not including the Interop and other .NET files. Checkbox settings are stored
// without the use of any registry data by using the .NET Application Settings User data.
//
// Any of the links listed here can be opened by simply holding down the CTRL key and
// clicking on the link.
//
// NOTE: This example program does NOT include the Skype4COMLib .dll. If you are using the
// Skype 3.0 for Windows release, the Skype4COMLib .dll should be already installed
// on your system. If needed you can download the latest Skype4COMLib .dll and
// then register it from here: https://developer.skype.com/Docs/Skype4COM
//
// Also includes CheckBoxes to stop at user logoff and Exit as well as Start Skype if needed.
// Added a Silent Mode Button as well. You can clear the text in the window at anytime by
// using the "Clear" button".
//
// Ways to use this Example program:
//
// 1. Start The Example program with Skype not running and the "Start Skype if not running"
// checkbox is checked. This will show you how this example program starts Skype and
// attaches to the Skype client. You can then change User status, make a test call to
// Echo123, send a chat message to Echo123 and see that the Example program is processing
// all the events as it should.
//
// 2. Stop this Example program while Skype is running. Start the Example program and do the
// same tests as above to see the events processed.
//
// 3. Uncheck the "Start Skype if not running" checkbox. Stop Skype. Stop this example
// program, then start this example program, and then start Skype. Do the same tests as
// above and see that the Example program is processing all the events as it should.
//
// 4. Leaving the "Start Skype if not running" checkbox unchecked. Start Skype then start
// this program, so you can see what happens when Skype is already running vs stopped
// as in the above example.
//
// 5. By checking the "Stop at Skype Logoff or Exit" you can test to see that this
// example program goes away when that checkbox is checked when the Skype User logs off
// or the Skype client is stopped. If you uncheck this checkbox, and the Skype user logs
// off or the Skype client is stopped you can see how this example program links back up
// to the Skype client when another logon is tried, or the Skype client is re-started.
//
// 6. By unchecking the "Stop at Skype Logoff or Exit" checkbox, you can see what status
// messages are sent when a Skype User logs off or exits Skype. You can also see how
// to re-attach when a Skype User logs back in, or the Skype client is restarted.
//
// 7. Additional logic could be added to this example program if needed to help you isolate
// and locate problems you may have in another program, and this can be done quickly.
//
// 8. By removing the authorization in the Skype client via Tools -> Options -> Privacy ->
// Manage other programs Access to Skype, you can use the same tests above to act as if
// it was a new installation in each case using different checkbox settings and even
// using the "Silent Mode" button as well.
//
// 9. The "Silent Mode" button can be used in four ways:
//
// a. If Skype is NOT running and the "Start Skype if not running" checkbox is checked
// and you click on the "Silent Mode" button. Skype will be started and as soon as
// this example program attaches to Skype. The Silent Mode request will be processed.
//
// b. If Skype is NOT running and the "Start Skype if not running" checkbox is NOT
// checked, the Silent Mode request will be queued until Skype is started and this
// example program attaches to Skype and then the Silent mode request will be
// processed.
//
// c. If Skype is running, and this example program is attached to Skype then the
// Silent mode request will be processed immediately.
//
// d. If Skype is running, but no Skype User is logged in, the Silent Mode request will
// be queued and processed as soon as this example program is attached to the Skype
// client ("Once a Skype User Logs On").
//
// This also shows how you can integrate a Skype interface into your application that
// can spawn Skype at some later time, not just at your application startup, but based on
// a button or link click. So as you can see, you can start Skype at anytime, not just
// at your application startup. If Skype was not running, and your application does other
// things that does not require the Skype interface, this can be useful to invoke Skype
// when needed, if it was not running already.
//
// NOTE: The Silent Mode request response does timeout, however it does complete. This
// causes a GUI hang at the moment, a bug report has been filed for this.
//
//10. Try all these above examples and any more you can think of using Auto-Logon and also
// without automatically logging in when Skype starts. You can see that this example
// program handles all these situations without throwing any exceptions ("minus the one
// listed above"). It is important to plan for all the possible situations that your
// application could encounter while interfacing to Skype and this example program is a
// way to show you how to deal with these situations gracefully. You can run this example
// program in debug if needed to see this.
//
// The intent of this example program was to show methods to handle all the initialization
// possibilities in a C# programming environment using Microsoft Visual C# 2005 Express
// Edition when interfacing to Skype4COMLib. Which is FREE and can be located at:
//
// http://msdn.microsoft.com/vstudio/express/visualcsharp/
//
// Documentation on Skype4COMLib can be found here:
//
// https://developer.skype.com/Docs/Skype4COM
//
// There are many other status messages and events that Skype4COMLib supports but most of
// the popular ones are used here as examples to get you started with learning how to
// interface to the Skype4COMLib using C# and at no cost by using the Microsoft Express
// Edition.
//
// Things can get a little tricky when using C# to interface to Skype4COMLib. This is because
// there are some ambiguous references for Attachment and Connection events. This means that
// in order to process these events you really need two attach statements, one for normal
// processing of the other events and one for the Skype class that handles Attachment and
// Connection events.
//
// Hopefully by looking at this code, and playing with it a bit, you can
// see why things are done here as they are, any questions just shout.
//
// ZOverLord AKA on Skype as TheUberOverLord
Any questions please shout.