|
Do you want to disable it permanently or just while your program is running?
To disable it permanently, you might have to write to the registry or use SystemParametersInfo() , although unless your program is specifically to change the screensaver, then most users won't like you doing this.
To disable it temporarily, look at SetThreadExecutionState(ES_DISPLAYREQUIRED) . This function is supported on Win98 or later.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
Thanks..i tried using systemparametersinfo() but seems as if it is not enabling the screensaver..i want to enable screensaver like on event when I press OK button..but it is not happening...and disabling i dont require..sorry..I think it will automatically disable if we press any key or move mouse..Please help...
Thanks in advance..
Himanshu
|
|
|
|
|
Oh, you want to start the screensaver running whenever you like? A screensaver is just an exe file on your hard-drive. The name of the screensaver file the user has selected is in the registry, at "HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE.EXE" . Read this value and pass it to ShellExecute() and that will run the user's screensaver.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
A screensaver is just an exe file on your hard-drive
Almost, it is actually a .scr, which is, as you pointed it out, a .exe renamed in .scr.
~RaGE();
|
|
|
|
|
Rage wrote:
Almost, it is actually a .scr, which is, as you pointed it out, a .exe renamed in .scr.
Picky, picky, picky . I know that!
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
Picky, picky, picky
Hey, we are on CP here, the most *precise* web site about code stuff ...
~RaGE();
|
|
|
|
|
|
Ryan Binns wrote:
beat that!!
[ouch!] MMhhh ... well well well ... how is the weather in Australia today ?
~RaGE();
|
|
|
|
|
Rage wrote:
[ouch!]
I hope you saw the ";P". If not... ;P;P
Rage wrote:
how is the weather in Australia today
The temperature is about 10 degrees, it's raining, and I'm hungry. I have no idea what colour the sky is because I can't see it - all I see is more clouds than there are people in New York, and I'm hungry.
PS. Did I mention I was hungry?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
If you want to start the currently configured screensaver, try this:
PostMessage(GetForegroundWindow(), WM_SYSCOMMAND, SC_SCREENSAVE, 0);
--------
There are 10 types of people in this world. Those who know binary and those who don't.
|
|
|
|
|
hi all,
i need to check if a file is in use/locked.
(then i have to delete the file if i want.)
how can i do it using win32 api?
regards
Hari Krishnan
|
|
|
|
|
If the file exists but you can't open it for exclusive read access, you can safely assume it's locked by another process. Assuming you're using MFC, see CFile for more information.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
thanks, but i don't want to use CFile.
After checking i want to delete the file.
Is there any win32 way ? I've read now that CreateFile can check this. But is not sure about the arguments.
Hari Krishnan
|
|
|
|
|
HFILE hFile = OpenFile(..., OF_SHARE_EXCLUSIVE);
if (HFILE_ERROR != hFile)
{
DeleteFile(...);
}
|
|
|
|
|
I have followed the instructions for C. Lung's VERY helpful article from 1999 on calling a VB ActiveX Dll from c++. I have built my VB dll that I have (which has 24 classes and 1 .bas file), and I used the midl compiler to compile the .idl file that I made by copying the code crom OLE View, as the article instructs. Now that I have the .idl files and the .c files which correspond to my VB DLL loaded into my C++ project, I get the following error when I try to build (F7) my c++ project.
"fatal error C1010: unexpected end of file while looking for precompiled header directive". I cannot figure out the cause of this error.
The only thing I have done that was not mentioned in Lung's article is change some data type specifications in the idl file which were causing error messages from the midl compiler. I changed "Single" to "float" and, I replaced the name of a VB enum I had created with a "Long" data type.
Please advise, or ask more questions, if I have not provided enough info.
Thank you VERY much, in advance, for any help you can provide!
rajdawg - a.k.a. Roger
|
|
|
|
|
|
The product I'm working on is still in the stage where I'm releasing debug builds. I have asserts in place for things that I want to see, but aren't actual application failures. What I'd like to do is augment assert so that places where I want to see an assert, I'll get an assert, but not when a debug build leaves my desk. I could just add a define and have not only a debug build configuration, but also a private debug build configuration. But ideally, I'd like to detect at runtime whether the app is running in the debugger or not, and key this behavior (and a few others I won't go into) off of that information. Does anyone know a way to do this?
|
|
|
|
|
|
Brian Tietz wrote:
The product I'm working on is still in the stage where I'm releasing debug builds.
You should never do that
(and btw. I think it's not allowed to redistribute the debug runtime dll's...)
Here on CP you'll find some tools how to convert your _ASSERT's into release-build log file entries. It's better, really.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hi guys and girls,
Where can I find resources about OE plug-in (or add-in) development? I this feature only avaitable in Outlook 2000 or better?.
Thanks in advance.
"When I look into your eyes, there´s nothing there to see, nothing but my own mistakes staring back at me"
|
|
|
|
|
Hi there, now I have a problem with my buffer.
I have a buffer reading in data from the serial port data is passed into the buffer like this
m_serialbuffer += ch;
Now this works perfectly for the first string that is sent to the port and stores it. For subsequent strings though, no characters are added. Any ideas??
andy
|
|
|
|
|
Is there a chance for the NULL character '\0'? CStrings are NULL terminated.
John
|
|
|
|
|
|
If there is a zero (ASCII 0 not the number 0) in the input the CString will not add any more characters.
John
|
|
|
|
|
hmm yes I think there is a zero on the end of the first string. How can I get around this?
|
|
|
|