Hi,
I get it to kind of work but everytime I call the function, no mater what
enum value I pass it always sets the sound to on???
[DllImport("aygs hell.dll", CharSet = CharSet.Unicode )]
public static extern Int32 SndSetSound
(SND_EVENT seSoundEvent,re f SNDFILEINFO pSoundFileInfo, bool fSuppressUI);
[StructLayout(La youtKind.Sequen tial)]
public struct SNDFILEINFO
{
[MarshalAs(Unman agedType.LPTStr , SizeConst = 260)]
public string szPathName;
[MarshalAs(Unman agedType.LPTStr , SizeConst = 260)]
public string szDisplayName;
public SND_SOUNDTYPE sstType;
}
public enum SND_SOUNDTYPE
{
SND_SOUNDTYPE_O N = 0x0001,
SND_SOUNDTYPE_F ILE = 0x0002,
SND_SOUNDTYPE_V IBRATE = 0x0004,
SND_SOUNDTYPE_N ONE = 0x0008,
SND_SOUNDTYPE_L AST = SND_SOUNDTYPE_N ONE
}
public enum SND_EVENT
{
SND_EVENT_ALL,
SND_EVENT_RINGT ONELINE1,
SND_EVENT_RINGT ONELINE2,
SND_EVENT_LAST = SND_EVENT_RINGT ONELINE2
}
Paul
"Paul Sneddon" <ma**@paulsnedd on.co.uk> wrote in message
news:xm******** *******@text.ne ws.blueyonder.c o.uk...
Hi,
I'm using VS.NET 2005 RC to create Windows Mobile apps. I'm trying to
call the following shell function which is new on Windows Mobile 5.
SNDGETSND
http://msdn.microsoft.com/library/de...ndSetSound.asp
I basically just need to be able to get the device ringer mode (e.g. On
Off Vibrate) this seems the way to do it in WM5.
I can set up the declaration (dll import, structs, pointers etc) but when
I call it I get a "Not Supported" exception. I tried setting various
unmanged directives on the structs and parameters which stops the
exception but the call doesnt have a return value and does not seem to
work, but I dont really know what I'm doing when it comes to calling
unmanged code.
Could someone proide we will a basic working example for declaring and
calling this function and I should be able to work out everything else
from there. I got that frustrated that I deleted my example code..
Paul