I don't have a WinMo 6 device and I've not installed the SDKs so I don't
even have an emulator to test this code with, but it probably looks
something like what's below. The documentation isn't too helpful in
telling us what DLL it's in, so I guessed at coredll.dll. Might be
cellcore.dll if not.
// calling code:
uint ret = SndSetSound(SoundEvent.All, sfi, true);
// declaration
enum SoundEvent
{
All = 0,
RingLine1,
RingLine2,
KnownCallerLine1,
RoamingLine1,
RingVoip
}
enum SoundType
{
On = 0,
File,
Vibrate,
None
}
/*
typedef struct tagSNDFILEINFO {
TCHAR szPathName[MAX_PATH];
TCHAR szDisplayName[MAX_PATH];
SND_SOUNDTYPE sstType;
} SNDFILEINFO;
* */
class SoundFileInfo
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
private string szPathNameNative;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
private string szDisplayNameNative;
public SoundType sstType;
public string szPathName
{
get { return szPathNameNative.Substring(0,
szPathNameNative.IndexOf('\0')); }
set { szPathNameNative = value; }
}
public string szDisplayName
{
get { return szDisplayNameNative.Substring(0,
szDisplayNameNative.IndexOf('\0')); }
set { szDisplayNameNative = value; }
}
}
[DllImport("coredll.dll", SetLastError=true)]
private static extern uint SndSetSound(SoundEvent seSoundEvent,
SoundFileInfo pSoundFileInfo, bool fSuppressUI);
--
Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com
Roger Odermatt said:
Thank you very much!
Can i use this function only with C++ or is it also possible with the CF
2.0?
I hope it's possible with CF 2.0 then i don't write code with C++.
Thank you
Roger