Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Pocket PC programming in C#

Pocket PC programming in C#

Scheduled Pinned Locked Moved C#
csharpgame-devtutorialquestiondiscussion
4 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Strat613
    wrote on last edited by
    #1

    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 B 2 Replies Last reply
    0
    • S Strat613

      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 Offline
      I Offline
      Ista
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S Strat613

        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."

        B Offline
        B Offline
        Burt Harris
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • B 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

          S Offline
          S Offline
          Strat613
          wrote on last edited by
          #4

          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."

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups