Pocket PC programming in C#
-
I recently wrote a pocket PC version of the game Simon. so far it is coming along nicely, but i still havent incorporated sound into the game! it would be nice to have 4 distinct tones that will play when each of the four colored buttons lights up. i am not sure how to do messagebeeps or any other sounds in C#. also, i dont even know if they will port to the pocket PC properly... any thoughts?! -613 "Code Poet" "Real programmers don't work from 9 to 5. If any real programmers are around at 9am it's because they were up all night."
-
I recently wrote a pocket PC version of the game Simon. so far it is coming along nicely, but i still havent incorporated sound into the game! it would be nice to have 4 distinct tones that will play when each of the four colored buttons lights up. i am not sure how to do messagebeeps or any other sounds in C#. also, i dont even know if they will port to the pocket PC properly... any thoughts?! -613 "Code Poet" "Real programmers don't work from 9 to 5. If any real programmers are around at 9am it's because they were up all night."
Strat613 wrote: "Real programmers don't work from 9 to 5. If any real programmers are around at 9am it's because they were up all night." Uhh yeah unless they have a family then they get 2 hours sleep I'm not an expert yet, but I play one at work. Yeah and here too.
-
I recently wrote a pocket PC version of the game Simon. so far it is coming along nicely, but i still havent incorporated sound into the game! it would be nice to have 4 distinct tones that will play when each of the four colored buttons lights up. i am not sure how to do messagebeeps or any other sounds in C#. also, i dont even know if they will port to the pocket PC properly... any thoughts?! -613 "Code Poet" "Real programmers don't work from 9 to 5. If any real programmers are around at 9am it's because they were up all night."
I think you'll have to use P-invoke for sounds. The following code should get you started. I think it will port to PocketPC, but it may take a little work:
using System;
using System.Runtime.InteropServices;namespace ConsoleApplication1
{
class Class1
{
[ DllImport( "WinMM.dll" ) ]
private extern static void PlaySound(
string soundName,
int hModule,
int dwFlags );private const int SND\_FILENAME = 0x20000; /\* name is file name \*/ \[STAThread\] static void Main(string\[\] args) { PlaySound( "C:\\\\Windows\\\\Media\\\\ChatKick.wav", 0, SND\_FILENAME ); } }
}
Burt Harris
-
I think you'll have to use P-invoke for sounds. The following code should get you started. I think it will port to PocketPC, but it may take a little work:
using System;
using System.Runtime.InteropServices;namespace ConsoleApplication1
{
class Class1
{
[ DllImport( "WinMM.dll" ) ]
private extern static void PlaySound(
string soundName,
int hModule,
int dwFlags );private const int SND\_FILENAME = 0x20000; /\* name is file name \*/ \[STAThread\] static void Main(string\[\] args) { PlaySound( "C:\\\\Windows\\\\Media\\\\ChatKick.wav", 0, SND\_FILENAME ); } }
}
Burt Harris
Thanks! i will definitely play around with that and see what i can do... unfortunately it may be awhile now, "real actual work" just became top priority again :oP i will post it if i make progess! thanks again, Rob -613 "Real programmers don't work from 9 to 5. If any real programmers are around at 9am it's because they were up all night."