|
-
Jan 7th, 2009, 12:33 AM
#1
Thread Starter
Frenzied Member
Microsoft SMS Sender
The free app from microsoft sends sms from your pc via your mobile (if compatable)
http://www.microsoft.com/downloads/d...FYu2c0fA%3d%3d
Does any one know if we able to access the source code or how to go about contacting some one to get it?
regards
toe
-
Jan 7th, 2009, 04:57 AM
#2
Frenzied Member
Re: Microsoft SMS Sender
I would very much doubt you will get the source code.
You could write your own using RAPI
-
Mar 13th, 2009, 07:15 AM
#3
Re: Microsoft SMS Sender
Here is code that allows you to send sms message:
Code:
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace myWireless
{
#if ( !WCE && !PPC && !SP)
#error "Wireless functions are only for the PPC and SMARTPHONE"
#endif
/// <summary>
/// Short Message Service.
/// </summary>
public class SMS
{
private static string SMS_MSGTYPE_TEXT = "Microsoft Text SMS Protocol";
private static long SMS_MODE_SEND = 0x00000002;
private static long SMS_OPTION_DELIVERY_NONE = 0x00000000;
//private static long SMS_OPTION_DELIVERY_NO_RETRY = 0x00000001;
//private static long PS_MESSAGE_OPTION_NONE = 0x00000000;
private enum SMS_DATA_ENCODING
{
SMSDE_OPTIMAL=0,
SMSDE_GSM,
SMSDE_UCS2,
}
private enum PROVIDER_SPECIFIC_MESSAGE_CLASS
{
PS_MESSAGE_CLASS0 = 0,
PS_MESSAGE_CLASS1,
PS_MESSAGE_CLASS2,
PS_MESSAGE_CLASS3,
}
private enum PROVIDER_SPECIFIC_REPLACE_OPTION
{
PSRO_NONE = 0,
PSRO_REPLACE_TYPE1,
PSRO_REPLACE_TYPE2,
PSRO_REPLACE_TYPE3,
PSRO_REPLACE_TYPE4,
PSRO_REPLACE_TYPE5,
PSRO_REPLACE_TYPE6,
PSRO_REPLACE_TYPE7,
PSRO_RETURN_CALL,
PSRO_DEPERSONALIZATION,
}
/*
private struct TEXT_PROVIDER_SPECIFIC_DATA
{
public IntPtr dwMessageOptions;
public PROVIDER_SPECIFIC_MESSAGE_CLASS psMessageClass;
public PROVIDER_SPECIFIC_REPLACE_OPTION psReplaceOption;
}
*/
[DllImport("sms.dll")]
private static extern IntPtr SmsOpen(String ptsMessageProtocol, IntPtr dwMessageModes, ref IntPtr psmshHandle, IntPtr phMessageAvailableEvent);
[DllImport("sms.dll")]
private static extern IntPtr SmsSendMessage(IntPtr smshHandle, IntPtr psmsaSMSCAddress, IntPtr psmsaDestinationAddress, IntPtr pstValidityPeriod, byte[] pbData, IntPtr dwDataSize,
byte[] pbProviderSpecificData, IntPtr dwProviderSpecificDataSize, SMS_DATA_ENCODING smsdeDataEncoding,
IntPtr dwOptions, IntPtr psmsmidMessageID);
[DllImport("sms.dll")]
private static extern IntPtr SmsClose(IntPtr smshHandle);
/// <summary>
/// Sends a SMS message to the phone number specified.
/// </summary>
/// <param name="sPhoneNumber">The phone number of the recipent</param>
/// <param name="sMessage">The message to send.</param>
unsafe public static void SendMessage(string sPhoneNumber, string sMessage)
{
IntPtr hSms = IntPtr.Zero;
try
{
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref hSms, IntPtr.Zero);
if (res != IntPtr.Zero)
throw new Exception("Could not open SMS.");
Byte[] bDest = new Byte[516];
fixed (byte* pAddr = bDest)
{
byte *pCurrent = pAddr;
Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}
// The data for the TEXT_PROVIDER_SPECIFIC_DATA
Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;
res = SmsSendMessage(hSms, IntPtr.Zero, (IntPtr)pAddr, IntPtr.Zero, bMessage, (IntPtr)nMsgSize,
ProvData, (IntPtr)ProvData.Length, SMS_DATA_ENCODING.SMSDE_OPTIMAL, (IntPtr)SMS_OPTION_DELIVERY_NONE, IntPtr.Zero);
if (res != IntPtr.Zero)
throw new Exception("SMS send failed.");
}
}
finally
{
if (hSms != IntPtr.Zero)
SmsClose(hSms);
}
}
}
}
-
Mar 17th, 2009, 10:20 AM
#4
Frenzied Member
Re: Microsoft SMS Sender
HI,
is this not just sending from the PDA - you can do this with the pocketoutlook name space easily - http://msdn.microsoft.com/en-us/netf.../bb905518.aspx
toecutter was looking for a solution to send from the PC using the PDA
Pete
-
Mar 17th, 2009, 04:13 PM
#5
Thread Starter
Frenzied Member
Re: Microsoft SMS Sender
 Originally Posted by petevick
I don't think ill be able to do anything as i only have the express version.
-
Nov 20th, 2013, 11:44 AM
#6
New Member
Re: Microsoft SMS Sender
 Originally Posted by Lightning
Here is code that allows you to send sms message:
Code:
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace myWireless
{
#if ( !WCE && !PPC && !SP)
#error "Wireless functions are only for the PPC and SMARTPHONE"
#endif
/// <summary>
/// Short Message Service.
/// </summary>
public class SMS
{
private static string SMS_MSGTYPE_TEXT = "Microsoft Text SMS Protocol";
private static long SMS_MODE_SEND = 0x00000002;
private static long SMS_OPTION_DELIVERY_NONE = 0x00000000;
//private static long SMS_OPTION_DELIVERY_NO_RETRY = 0x00000001;
//private static long PS_MESSAGE_OPTION_NONE = 0x00000000;
private enum SMS_DATA_ENCODING
{
SMSDE_OPTIMAL=0,
SMSDE_GSM,
SMSDE_UCS2,
}
private enum PROVIDER_SPECIFIC_MESSAGE_CLASS
{
PS_MESSAGE_CLASS0 = 0,
PS_MESSAGE_CLASS1,
PS_MESSAGE_CLASS2,
PS_MESSAGE_CLASS3,
}
private enum PROVIDER_SPECIFIC_REPLACE_OPTION
{
PSRO_NONE = 0,
PSRO_REPLACE_TYPE1,
PSRO_REPLACE_TYPE2,
PSRO_REPLACE_TYPE3,
PSRO_REPLACE_TYPE4,
PSRO_REPLACE_TYPE5,
PSRO_REPLACE_TYPE6,
PSRO_REPLACE_TYPE7,
PSRO_RETURN_CALL,
PSRO_DEPERSONALIZATION,
}
/*
private struct TEXT_PROVIDER_SPECIFIC_DATA
{
public IntPtr dwMessageOptions;
public PROVIDER_SPECIFIC_MESSAGE_CLASS psMessageClass;
public PROVIDER_SPECIFIC_REPLACE_OPTION psReplaceOption;
}
*/
[DllImport("sms.dll")]
private static extern IntPtr SmsOpen(String ptsMessageProtocol, IntPtr dwMessageModes, ref IntPtr psmshHandle, IntPtr phMessageAvailableEvent);
[DllImport("sms.dll")]
private static extern IntPtr SmsSendMessage(IntPtr smshHandle, IntPtr psmsaSMSCAddress, IntPtr psmsaDestinationAddress, IntPtr pstValidityPeriod, byte[] pbData, IntPtr dwDataSize,
byte[] pbProviderSpecificData, IntPtr dwProviderSpecificDataSize, SMS_DATA_ENCODING smsdeDataEncoding,
IntPtr dwOptions, IntPtr psmsmidMessageID);
[DllImport("sms.dll")]
private static extern IntPtr SmsClose(IntPtr smshHandle);
/// <summary>
/// Sends a SMS message to the phone number specified.
/// </summary>
/// <param name="sPhoneNumber">The phone number of the recipent</param>
/// <param name="sMessage">The message to send.</param>
unsafe public static void SendMessage(string sPhoneNumber, string sMessage)
{
IntPtr hSms = IntPtr.Zero;
try
{
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref hSms, IntPtr.Zero);
if (res != IntPtr.Zero)
throw new Exception("Could not open SMS.");
Byte[] bDest = new Byte[516];
fixed (byte* pAddr = bDest)
{
byte *pCurrent = pAddr;
Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}
// The data for the TEXT_PROVIDER_SPECIFIC_DATA
Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;
res = SmsSendMessage(hSms, IntPtr.Zero, (IntPtr)pAddr, IntPtr.Zero, bMessage, (IntPtr)nMsgSize,
ProvData, (IntPtr)ProvData.Length, SMS_DATA_ENCODING.SMSDE_OPTIMAL, (IntPtr)SMS_OPTION_DELIVERY_NONE, IntPtr.Zero);
if (res != IntPtr.Zero)
throw new Exception("SMS send failed.");
}
}
finally
{
if (hSms != IntPtr.Zero)
SmsClose(hSms);
}
}
}
}
Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
In the above line at (int)AddressType underlined as red line when i am using this code in visual studio. How can i solve that please guide me. I am new to .net. so please help me and give me a ready to use code to send sms from nokia mobile using pc suite in c# code
-
Nov 30th, 2013, 03:50 PM
#7
Re: Microsoft SMS Sender
This code is for Windows Mobile 6.5 and visual Studio 2003.... newer wont work
-
Dec 2nd, 2013, 08:36 PM
#8
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|