|
Read MSDN!!
MessageBeep
The MessageBeep function plays a waveform sound. The waveform sound for each sound type is identified by an entry in the [sounds] section of the registry.
<br />
BOOL MessageBeep(<br />
UINT uType
);<br />
Parameters
uType
Specifies the sound type, as identified by an entry in the [sounds] section of the registry. This parameter can be one of the following values: Value Sound
0xFFFFFFFF Standard beep using the computer speaker
MB_ICONASTERISK SystemAsterisk
MB_ICONEXCLAMATION SystemExclamation
MB_ICONHAND SystemHand
MB_ICONQUESTION SystemQuestion
MB_OK SystemDefault
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
After queuing the sound, the MessageBeep function returns control to the calling function and plays the sound asynchronously.
If it cannot play the specified alert sound, MessageBeep attempts to play the system default sound. If it cannot play the system default sound, the function produces a standard beep sound through the computer speaker.
The user can disable the warning beep by using the Sound Control Panel application.
Windows CE: Passing 0xFFFFFFFF will cause the SystemDefault waveform to be played.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Yes, I read the MSDN and I also wrote a test program, but even when I pass 0xFFFFFFFF or ( (UNIT)-1 ) it just plays the system default sound using the sound card and not the PC Speaker.
Nevertheless, thanks for the help,
Michael
|
|
|
|
|
How about sndPlaySound(..., SND_ASYNC) ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks David, though I took a look at the functions and it's just playing .wav files and I need the PC-Speaker ( that old horrible thing ) playing the sound.
I guess I will start a extra thread just for the beeping
|
|
|
|
|
printf("\007");
TOXCCT >>> GEII power
|
|
|
|
|
Basically you'd use it to store persistent state information... user preferences, window size/position, etc. However these can also be stored in a private file (INI or any other type of file) as you see fit and ignore the registry completely.
Just one tip, there are a few different root-level registry hives. Application data should probably go in the HKEY_CURRENT_USER hive - this is meant for user-specific data (for instance, user A can have preferences one way, and user B can have preferences another way.)
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Would you recommend using the windows registry rather than an INI file or would you use them both? Is there any other hive that I would use other than HKEY_CURRENT_USER? Also is there any documentation on that I can read about store data in the windows regestry? Whether it is on codeproject or another site??
Thanks Navin!
There are 10 kinds of people in this world. Those who understand binary and those who don't.
|
|
|
|
|
I sometimes put registry settings under HKEY_LOCAL_MACHINE for necessary things for the app, and under HKEY_CURRENT_USER for personal settings.
If it's broken, I probably did it
bdiamond
|
|
|
|
|
A user requires special privilege to write to the HKEY_LOCAL_MACHINE
If you store user-secific settings in a file, make sure to put them in a 'company specific' subfolder of the user's douments and settings folder, so if they 'roam' it should be available on the network.
If you use the MSDN and read about terminal services, you can be made very aware of ths issues of supporting multiple users from the same computer. Also, there are the windows logo guidelines that detail where your program should write certain classes of files to certain subdirectories on the computer.
|
|
|
|
|
Ahoy..
I guess you all probably know the folder dialog in Visual Studio whenever you're creating a new project. You can choose to browse for the desired folder to put your project in, like this:
http://www.blacksmith-studios.dk/ChooseFolder.JPG[^]
Anyways, I'm wondering how one can do this in MFC? It seems the CFileDialog class doesn't support the selecting of folders :S
Thanks a bunch
|
|
|
|
|
Will SHBrowseForFolder() suffice?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Well, that's what I used the last time.
Was just curious if I could do it the way Visual Studio does.
|
|
|
|
|
I want that when an user click to download a file from internet explorer and possibly others browsers, my app receive the name of http link.
Kazaa does this function with association of file zip , etc..
I dont want create toolbar or dll, i am sure that kazzaa make same only with register or other that I don't know.
Can anyone help me?
Thanks!
|
|
|
|
|
I am familiar with using PropertySheets in a Dialog application . Basically , I create the PropertySheet in my main dialog and add PropertyPages to it . Now I was looking at CTabCtrl as a common control that I can drag and place on my main Dialog . How do I manage whats shown ?
As for eg :
Say If I had a PropertyPage with the following :
Page 1 : 1 radio Button(A) , 1 editBoxe(B)
Page 2 : 1 Combo Box (C)
Now If i dont use a PropertyPage , but want to use a CTabCtrl ?
Do I need to create A , B and C all at once and keep hiding the appropriate based on the Tab selection ?
How does it work ?
Engineering is the effort !
|
|
|
|
|
Yes, since TabControl does nothing except of drawing pages tabs, you will have to do everything yourself. You don't have to create all controls at once, only those which are curently shown. I prefer creating/hiding full dialogs - you create dialogs in resource editor, make it no-border, control-style, and than switch it by TabControl notification.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
I use the shell's supplied IExtractImage interface to extract thumbnail-images of files...
When the shell tries to get the thumbnail image for a .url file, it sometimes fails, which is cool, but it also decides to popup an annoying message box saying 'The Page !@#!@# could not be loaded and rendered within the timeout period' or something slightly different on other OSs.
Explorer obviously doesn't show these messageboxes, but how ? There doesn't seem to be a way to influence this through the interface, has anybody hit this problem ?
thanks
|
|
|
|
|
Hello everyone,
I am in the middle of designing my first MFC application and I was wondering what I would use the windows registry for. Why would I use the windows registry? I see alot of applications enter infromation into the windows registry but I never understood why they would put it there or what they would put it there for. Can anyone help explain this to me??
Thanks in advance!
There are 10 kinds of people in this world. Those who understand binary and those who don't.
|
|
|
|
|
if you have some settings or data, that you want to store between two starts of your app, you can save it to the registry.
if you have a ListControl, you can save the size and the sort-order of the Control in the registry, so the App is more customizable for the user.
|
|
|
|
|
You could use the registry to store the last-size/position of your application and other information about it's state when it was closed.
You can save application-settings in the registry.
|
|
|
|
|
I have a tree control whose node text need to chaneg colour on selection.
|
|
|
|
|
Hello:
Anybody who can point me to a good free C++ code beautifier??
I have tried Artistic Style (astyle), but it seems to be little old and have few bugs in it.
Thanks.
|
|
|
|
|
don't understand the reason...
you don't know writing pure beautiful code??? ;P
TOXCCT >>> GEII power
|
|
|
|
|
Oh no, we are translating VB to C++, but the generated C++ code is left aligned, not indented, for loops being on 1 line...so its dirty...thats the reason we need the beautifier.
Any clue on which is a good one out on web?
|
|
|
|
|
oh, sorry now i understand... lol
hem, tell me, why don't you write a little console program that get your source, and that return you a "beautiful" code ?
it might take few lines i think...
otherwise, nop, i don't have any idea about what you're looking for.
TOXCCT >>> GEII power
|
|
|
|
|
I have used indent++ several years ago, and it was nice, although requiring some tuning. But I could not find it's home page now. But quick google bought me these links, I will appreciate, if you post results of your testing here
http://www.ochresoftware.com/sourcestyler-overview.html (not-free)
http://www.geocities.com/~starkville/main.html
http://perso.club-internet.fr/cbeaudet/
http://users.erols.com/astronaut/vim/tarfiles/ccb-1.07.tar.gz
http://www.uvm.edu/~ashawley/c/indent/
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|