Windows Message for F5

What message is windows sending when the user hits F5 to update the desktop in WIN95?
LVL 2
SGCAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mrmickCommented:
The WM_KeyDown message indicating that the F5 Key was pressed.

0
MikeP090797Commented:
I think he mean what message Windows95 sends IN ORDER to update the desktop
0
mrmickCommented:
MikeP, the desktop window procedure performs the update when the WM_KEYDOWN key specifying that the F5 key was pressed is received.  There are no special "messages" by design to cause this to happen.

0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

SGCAuthor Commented:
I understand that much, but Windows certainly must use some sort of function or message to inform the desktop to update itself, otherwise just pressing F5 would do nothing.
The reason I asked the question is because I can't seem to get the desktop to update itself by...
1) Obtaining the desktop handle using GetDesktopWindow
2) Giving the Desktop focus with SetFocusAPI
3) Setting the Desktop as the active Window with SetActiveWindow
4) Sending the WM_KEYDOWN with KEY_F5 with SendMessage(xx,WM_KEYDOWN,KEY_F5,&H18) to the Desktop (xx being the desktop handle)

This does not work, which is why I wanted to know what the message is. I've tried everything I can think of...including simulating mouse clicks on the desktop and telling the desktop with WM_ACTIVATE and WA_ACTIVE that it is in fact the active window.

Let me know if I'm doing something wrong, or rather, what I'm doing wrong.
0
mrmickCommented:
Well, I am a bit frustrated at this point because I did provide the correct answer to your question.  Apps written in C under the Windows OS respond to different messages (known as events in VB).  I used Microsoft Spy++ to learn the message that caused the desktop to update... so I'm certain that the WM_KeyDown message with Key_F5 is the message that initiates the refresh.

I now understand that it doesn't solve you're problem and I certainly don't wish to see anyone through away points; however, I'm bothered that you didn't spell out the problem the first time.  How do I know that if I take the time to play with this and find your answer that there are other details I don't know about that would make you reject a solution to the "current" problem.

0
chris_aCommented:
I guess you want to get the desktop to redraw, look at sending an InvalidateRect (Win32 API) to NULL, to tell windows that all the windows need refreshing.
0
mrmickCommented:
Good answer chris_a, I would expect that to satisfy SGC's newly described problem.
0
SGCAuthor Commented:
mrmick...you did not provide the correct answer to the question, you merely provided me with something extremely obvious in the hopes that I would give you 100 points!
Of course Windows is going to recieve a WM_KEYDOWN when the users hits F5, as they would if they hit F1 or F2, which, as I'm sure you're aware achieve very different results. My question was phrased quite logically...MikeP seemed to understand what I was talking about, as did chris_a.
I came to this board to ask a simple question and instead, you treat me as a newbie who asked how to play a sound. I do not appreciate the attitude you take with your responses, and I'm sure there are others who feel the same way. Just because you rank number one in the experts list does not mean that you know all. Get used to it.
0
SGCAuthor Commented:
By the way, thanks Chris_a
0
chris_aCommented:
Do I get some points then (my first) !

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrmickCommented:
That's fine SGC but I don’t claim to be an expert at reading minds and FYI - there isn't a "special message" just for updating the desktop as you and perhaps MikeP seem to think.  I though your question was quite clear and I find it rather funny that you would accuse me of treating you like a "newbie" for not seeing that when you ask: "What message is windows sending when the user hits F5 to update the desktop in WIN95?"...  I should have guessed right off that the correct response would be: "InvalidateRect (Win32 API)".  Do you suppose the "F5" Key automatically invokes the InvalidRect Function?

I stated that I didn't expect you to through away points and I do not want these points.  The answer I posted may have seemed "extremely obvious" to you in hindsight, but if that’s the way you feel, I think you might consider how "extremely obvious" it is that the answer was the correct and only answer to the question you posed - before you changed the question that is.  My beef is that you chose how and what you were asking and after getting the answer... you changed the question.

If you wish to continue this discussion, you may email me at mick@owen.wa.com

0
mrmickCommented:
I don't know... that was a little harsh.  Sorry.  I don't have a problem with you.  I don't wish to cause you undue grief over a pet peeve of mine.

By the way, I can't return to review comments after you've accepted chris_a's answer so if you wish to communicate with me after grading chris_a's answer - it will have to be through email.



0
LMSuporteCommented:
well, I have some source code that changes the desktop color and/or wallpaper and then refreshs itself. If you only change the registry to do such things the desktop will not refresh itself, but with the functions from these project it will do it. If you want to, I will send you the source code , or post it here ( no points needed)

0
chris_aCommented:
LMSuporte, do you mean using the SystemParametersInfo API call?
0
SGCAuthor Commented:
Thanks guys.

.
0
SaimonCommented:
How do you declare the InvalidRect function? I mean, in what library is it? I can't find it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.