|
|
|||||||
| E-Learning Center « E-Learning tutorials and competitions. » |
![]() |
|
|
Share | Thread Tools | Search this Thread |
|
|
#1 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
In my free time, I coded this small program that generates the FPM tone using the beep() function. This is the code:
Code:
//Free Patriotic Movement Tone By Edgard Chammas
#include <windows.h>
#include <time.h>
void sleep(unsigned int mseconds);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
Beep( 750, 200);
Beep( 750, 200);
Beep( 750, 200);
sleep(100);
Beep( 750, 400);
sleep(50);
Beep( 750, 500);
sleep(200);
Beep( 750, 300);
Beep( 750, 300);
Beep( 750, 300);
return 0;
}
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal > clock());
}
![]() Note: The compiled executable file is here <> in case you don't have a compiler... |
|
|
|
| The Following User Says Thank You to Google For This Useful Post: | Kingroudy (01-11-2009) |
|
|
#2 |
|
Registered Member
Last Online: 04-06-2014
Join Date: Apr 2006
Posts: 314
Thanks: 72
Thanked 84 Times in 55 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
|
sorry because I dont know in the computer stuff, so what do we do in order to get the tone for that?
|
|
|
|
|
|
#3 | |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
Quote:
This is the link: http://www.4shared.com/file/80106952/f080bb5f/FPM.html Edit: You can put the FPM.exe in a static place and make it run every time you logon to your user by this batch file: Code:
@ECHO OFF REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /V "FPM" /D "C:\LOCATION_ON_THE_HARD_DISK\FPM.exe" /F Last edited by Google; 01-11-2009 at 11:21 PM. |
|
|
|
|
|
|
#4 |
|
Last Online: 12-20-2021
Join Date: Mar 2006
Posts: 6,245
Thanks: 2,121
Thanked 3,365 Times in 1,740 Posts
Groans: 29
Groaned at 44 Times in 35 Posts
|
It Didn't Work For Me, I Downloaded The Compiled File You Uploaded, And I Hear Nothing
![]() I Am Using Visual C++ 2008, You Have To Add #include <stdafx.h> As A PreCompiler Library, I Don't Know Why Though. And The: int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) Didn't Work For Me, I Get This: Code:
1>Linking... 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 1>C:\Studies\C++ Projects\Test\Debug\Test.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Studies\C++ Projects\Test\Test\Debug\BuildLog.htm" 1>Test - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I Tried The int main(void), It Worked. Any Idea?
__________________
What we do in life, echoes in eternity.
|
|
|
|
|
|
#5 |
|
Registered Member
Last Online: 06-22-2023
Join Date: Sep 2006
Posts: 1,304
Thanks: 102
Thanked 1,147 Times in 619 Posts
Groans: 8
Groaned at 1 Time in 1 Post
|
I'm using Visual C++ 2005, and i got this :
Code:
1>Compiling... 1>Test.cpp 1>.\Test.cpp(2) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory 1>Build log was saved at "file://e:\Documents\Visual Studio 2005\Projects\Test\Test\Debug\BuildLog.htm" 1>Test - 1 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
|
|
|
|
|
#6 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
@Tawa
This is a windows 32-bit application and not a console application To solve your problem, you either have to make a win32 project and put the code in, OR JUST create the cpp file and then in microsoft visual c++ go: Project > Settings In the C/C++ tab change the preprocessor definitions from WIN32,_DEBUG,_CONSOLE,_MBCS to WIN32, _DEBUG,_WINDOWS In the Link tab change /subsystem:console in the project options to /subsystem:windows And this will solve the problem. @Malek You have to download and install the SDK platform. It is not included by default in VC2005. That's why the compiler cannot find that header file. Edit: If you want, download windows.h from the internet and put it in the libraries directory. By the way, I'm using visual c++ 6.0
Last edited by Google; 01-11-2009 at 11:41 PM. |
|
|
|
|
|
#7 |
|
Last Online: 12-20-2021
Join Date: Mar 2006
Posts: 6,245
Thanks: 2,121
Thanked 3,365 Times in 1,740 Posts
Groans: 29
Groaned at 44 Times in 35 Posts
|
Lol, I Did Man, Nothing Shows Up, And I Hear Nothing
__________________
What we do in life, echoes in eternity.
|
|
|
|
|
|
#8 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
1- I'm glad to hear that the code is compiled with you!
![]() 2- nothing is supposed to show up unless you do it like you did it before (console mode, with int main() instead of int WINAPI WinMain... ) 3- Now we come to the more interesting part that your PC "hane" and does not beep / well it is either your PC's internal speaker is damaged or simply your ears are damaged ![]() The beep sound volume depends on each PC... |
|
|
|
|
|
#9 |
|
Last Online: 12-20-2021
Join Date: Mar 2006
Posts: 6,245
Thanks: 2,121
Thanked 3,365 Times in 1,740 Posts
Groans: 29
Groaned at 44 Times in 35 Posts
|
I Think My Laptop Doesn't Have An Internal Speaker.
And I Don't Think It's Damaged Cause I Never Heard A Beep From An Internal Speaker. And The Laptop Is Still Pretty New.
__________________
What we do in life, echoes in eternity.
|
|
|
|
![]() |
|
| Tags |
| free, movement, patriotic, tone |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|