Thread: Beep

Results 1 to 7 of 7
  1. #1
    KissU's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    107
    Reputation
    10
    Thanks
    14
    My Mood
    Blah

    Beep

    I'm making a windows form(c++/cli) and I need when user press start button its beep on a frquency and stop with a pause button so used a timer but dont ended right some suggestion?
    "More suicides in world make there are less suicides in the world"


  2. #2
    kJNR's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    Australia
    Posts
    58
    Reputation
    10
    Thanks
    23
    My Mood
    Yeehaw
    Hello @KissU

    Making a Hardware Beep would have a Good Effect, if you Use this Method

    Code:
    BOOL WINAPI Beep(
      _In_  DWORD dwFreq,
      _In_  DWORD dwDuration
    );
    So to use this Function, You'll need to use them Parameters.

    Code:
    Beep(200,450); //Will Produce a Hardware Beep with the Frequency of 200, and a Duration of 450ms
    I'd also Suggest to Read up on the Basic's, it Really does Help alot.

    Cheers
    kJNR

  3. #3
    KissU's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    107
    Reputation
    10
    Thanks
    14
    My Mood
    Blah
    I know the basics, but I need a function to beep async if I do Beep(100,10000); the world can explode and its only stops if app is killed or time is over.I need Beep until user press pause, so i tried a thread and doesn't worked.
    "More suicides in world make there are less suicides in the world"


  4. #4
    kJNR's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    Australia
    Posts
    58
    Reputation
    10
    Thanks
    23
    My Mood
    Yeehaw
    Write a Simple Function, and play a Beep?
    Thats Less than Basic Knowledge i'm Afraid.

    :/ - Sorry, but i Dont really Spoonfeed, Dont it in the Past - therefor People learn't Nothing.
    :/


    Cheers,
    kJNR

  5. #5
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,735
    Reputation
    191
    Thanks
    15,692
    My Mood
    Relaxed
    Quote Originally Posted by KissU View Post
    I know the basics, but I need a function to beep async if I do Beep(100,10000); the world can explode and its only stops if app is killed or time is over.I need Beep until user press pause, so i tried a thread and doesn't worked.
    Make a new thread and within it use a simple loop that keeps going untill the user pressed something. The beep duration can be 30ms as this is the average time the user press a key.
    Even familiar landscapes will
    reveal a different kind of beauty
    if you change your viewpoint.
    Where these new encounters
    and new bonds will lead you...
    Such dazzling golden days.
    I, too, look forward to
    what I might behold.

  6. #6
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    do something like that:

    Code:
    DWORD WINAPI beep(LPVOID)
    {
        for(;;)
            Beep(100, 50);
    }
    
    INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, INT nShow)
    {
        HANDLE hThread = CreateThread(NULL, 0, beep, NULL, 0, NULL);
        while (!GetAsyncKeyState(VK_F5)) Sleep(50);
        TerminateThread(hThread, 0);
        CloseHandle(hThread);
        return 0;
    }


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  7. #7
    KissU's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    107
    Reputation
    10
    Thanks
    14
    My Mood
    Blah
    I give up can close thread.
    "More suicides in world make there are less suicides in the world"


Similar Threads

  1. [Release] Reigz - Beep
    By reiginald in forum Visual Basic Programming
    Replies: 11
    Last Post: 10-23-2010, 06:02 PM
  2. [Tutorial]Beep in system
    By DarkBright in forum Programming Tutorials
    Replies: 18
    Last Post: 07-30-2010, 01:12 PM
  3. Make Computer Beep
    By Dev_Pump in forum C# Programming
    Replies: 9
    Last Post: 06-12-2010, 11:21 AM
  4. BEEP BEEP! MOTHER FUCKERS!
    By CyberGenius in forum Flaming & Rage
    Replies: 12
    Last Post: 03-03-2010, 07:14 AM
  5. the beeping hack
    By DylanOwnsYou in forum General Hacking
    Replies: 14
    Last Post: 09-13-2009, 07:11 PM