|
I am creating an install program for my screensaver that I made. The problem I am having, is I want the windows screensaver dialog pop up, with MY screensaver set as the active one, displayed in front of me, like what happens when you right click on a screensaver to install. What do I do?
I looked for examples of screensavers on Code Project here, and I find screensaver source codes, but no install program source code.
I hope you know what I'm referring to, and I would appreciate any help.
|
|
|
|
|
Write to the registry: "HKEY_CURRENT_USER\Control Panel\Desktop" with the "SCRNSAVE.EXE" value name. This holds the path of your screensaver executable file.
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"
|
|
|
|
|
Does that cause the screensaver dialog box to pop up automatically?
|
|
|
|
|
No. To do that you need to use Rundll32.exe to run the "display.cpl" control panel application opened to the screensaver page (page 3, 0-indexed) Use this command line:
rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2
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"
|
|
|
|
|
Awesome! Thank you so much.
|
|
|
|
|
You're welcome.
I will mention that that command line string has worked since Win95, but might show the wrong page. Just change the number at the end of the string to get the correct page
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"
|
|
|
|
|
I'm very interested to know where you learned something like that ... That's not something one can discover by himself, is it ?
~RaGE();
|
|
|
|
|
MSDN has a heck of a lot of useful information You just gotta know where to look
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"
|
|
|
|
|
And some words are not indexed. I've looked for things before that I knew should exist but couldn't find. Later on I'd be searching for something different and accidently stumble across what I was looking for earlier, and the word I was searching for would be right there staring at me. The MSDN search engine is very elusive at times.
|
|
|
|
|
DavidCrow wrote:
The MSDN search engine is very elusive at times.
Aah yes, but I use the CD version. HtmlHelp creates its own index
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"
|
|
|
|
|
The first thing you'll need to do is update HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE.EXE with the name of your .SCR file. Then you can run RunDLL32.EXE shell32.dll,Control_RunDLL desk.cpl,,1 using ShellExecute() or CreateProcess().
Edit: it took over five minutes for this post to actually go through. By that time, the answer had already been submitted. I hate slow posts!
|
|
|
|
|
DavidCrow wrote:
I hate slow posts!
Me too
I'm glad we had the same answer, though
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"
|
|
|
|
|
Thanks anyway though man, if Ryan wasn't here, you would have still answered
I really appreciate it.
|
|
|
|
|
I want to use the hook function _pexit() in my codes,
and it must be used with the compiler option /GH (See MSDN),
but VC6.0 can't recognize it. it's why? thx.
|
|
|
|
|
Options to the compiler are case sensitive. This particular option is /Gh.
--
Mike Dimmick
|
|
|
|
|
thanks, first.
but it's not same with you.
/Gh is with _penter() and /GH is with _pexit(), isn't it?
I know /Gh is ok , but /GH can't be used.
|
|
|
|
|
Sorry, the option was added in VS.NET 7.0 (i.e. compiler version 13.x). VC 6.0 doesn't have this option.
[edit]
I just found an article on simulating a _pexit()[^] that might help you. The basic trick is to modify the return address of the function on the stack within the _penter() function to point to your _pexit() , then store the true return address elsewhere. When the function returns, it returns to _pexit() , which should then jump to the true return address when done.
[/edit]
--
Mike Dimmick
|
|
|
|
|
Oh, thanks a lot.
and now , I want to call a hook function when a fuction return,
but i will not add some codes in it, what shall i do?
which function is similar with _pexit()?
|
|
|
|
|
Hi
I have installed MSDN 2003 which was recently released free by microsoft however I cannot link it into my visual studio (like when I press F1 on a class e.g CString it does not search the MSDN) ; It pops up a message about MSDN not being installed properly.
Does anyone know of a tweak to get this back working .. cheers
LK--<
|
|
|
|
|
The new 'document viewer' isn't compatible with the old one. VC 6.0 doesn't know how to launch the new one.
If you have an MSDN subscription, you should have received a separate disc marked 'Installs with Visual Studio 6 only' - at least, our MSDN Universal does.
If you don't have this disc, for context-sensitive help in VS 6 you'll need to keep a previous version of the documentation around, i.e. either that which came with Visual Studio 6, or a release before April 2002 (I believe).
I wasn't aware that MS had ever officially released a free version.
--
Mike Dimmick
|
|
|
|
|
Thanks for the reply
Its listed on the microsoft site for download
heres the links
http://download.microsoft.com/download/b/d/c/bdccea1b-96d9-4ad9-8045-56619af95835/qtr40enud1.img
http://download.microsoft.com/download/b/d/c/bdccea1b-96d9-4ad9-8045-56619af95835/qtr40enud2.img
http://download.microsoft.com/download/b/d/c/bdccea1b-96d9-4ad9-8045-56619af95835/qtr40enud3.img
LK--<
|
|
|
|
|
Mike Dimmick wrote:
...or a release before April 2002 (I believe).
October 2001, to be exact.
|
|
|
|
|
I have trouble with break pointers.
Sometime one dont wont work and my VC++ 6.0 notice mee
what "Break points cannot be set and will be
disabled." Why this occur .This became really nasty
problem for me, because sometime this work fine and
suddenly this fail by another reason.I dont change
settings of my project (suppose enable to set break
pointer spend on only from settings).My project its
console application, which run in debug mode.And any time
again same trouble arised, but i continued work with one,
but after any changest in source code break pointers work
fine once again.
Thanks
|
|
|
|
|
When a breakpoint is on an illegal line, VC will try to move the breakpoint to the next legal line. If there's no legal next line, the breakpoint is disabled.
A line can be considered illegal if it doesn't contain a complete statement, for example, you have a multi-line if condition, or an assignment that is formatted into multiple lines, and you try to set the breakpoint on anything other than the first line. It will also be considered illegal if the source file isn't included in any of the modules loaded on startup.
To add modules to debug on startup, you can go to Project > Settings > Debug tab > Additional DLLs category, and add the modules you want loaded at startup.
VC 7.x is better in this respect, IIRC; if there's a breakpoint set in a module that isn't listed to be loaded at startup, the debugger simply marks the breakpoint with a '?' symbol in the source, then tries to set it when the module loads. I can't remember what happens if this fails.
Another reason this can fail is if the debugger crashes before the workspace is saved. Breakpoint locations are saved in the workspace options file (Workspace.opt in VC6, or .vco in eMbedded Visual C++), which is saved when you save the workspace. If the debugger crashes between saving the workspace and making changes to the source, or you change the source outside the IDE, the breakpoints remain on the line number that they were set on, even if the code's moved, when you next open the workspace. Breakpoints set in the Disassembly window are saved relative to the module base address, IIRC.
For more information on debugging with VC 6.0, read John Robbins' Debugging Applications[^]. This is the first edition; the new book only covers VS.NET. Unfortunately it's out of print.
--
Mike Dimmick
|
|
|
|
|
Break points must be set on lines that "will produce" some assembly code. For example, you can't set a breakpoint on a variable declaration:
int Value; //You cannot set a break point here
But if you assign some value to this variable, it will work (in assembly code, you will have an instruction that loads some registers)
int Value = 0; //You can set a breakpoint here
So, look if you breakpoint is set on a valid line !
Hope this helps
|
|
|
|