Hi, anybody knows how to refresh a window?
I try to refresh a window of another app by send it a message,
for example refresh a window of Internet Explorer (not simplely update it!).

I'd tried send WM_COMMAND message with high word wparam 1 (for accelerator),
low word VK_F5 and lparam - 0, but didn't work.
And WM_NOTIFY didn't work too. And WM_KEYDOWN, WM_SYSKEYDOW...failure.
Posted on 2002-12-27 17:12:21 by Iceberg
Just because Internet explorer has a button called refresh doesn't mean that there is a special windows message that refreshes internet explorer windows. And its not really "refreshing" its downloading info from a website, erasing the window, then redrawing the graphics and text. So that means that to do what you are asking you will have to simulate user input, and let the internet explorer window do all the work. On my computer I am running IE6.0 and if I send a wm_command message to internet explorer's main window with a wparam A220 then I get the desired effect...

invoke SendMessage, hwndIE, WM_COMMAND, 0A220h, 0

I got this information by using a message spy on internet explorer and seeing what messages were sent when I clicked refresh on the menu. Now the downside to all of this is that the message you have to send to get this effect can be different on each version of internet explorer (it probably WILL be different). Also everytime microsoft comes out with a new version of IE the chances of your program not being able to refresh the window anymore is pretty high.
Posted on 2002-12-27 18:15:17 by BubbaFate
message spy ,

Hello BubbaFate ,

I did not know there was a tool that could do that. Where can i find this tool and other tools like it.

Thanks in advance
Posted on 2002-12-28 08:29:45 by cmax
I'd tried to send a WM_COMMAND or WM_NOTIFY(as a toolbar button),
but didn't work. I got the message by using Spy++ utility from VC tool set.
Would you tell me another useful or powerful message spy utilities?

Anyway, thank you for answer, if you get any other approach, tell me please.
Posted on 2002-12-28 08:43:15 by Iceberg
I use Spy++ from microsoft, but i dont believe that it is freeware. I'm to lazy to try any others because I like Spy++ so much. I did search the net however and found a program called winspector at


it claims to be better than spy++ though I haven't tried it... again because im lazy. It is pretty simple to make your own spy program though, just use setwindowshookex to set a WH_GETMESSAGE hook on the window you wish to view the messages for, and output the messages to a listbox or something. You will have to put the hook function in a dll to hook other processes however.
Posted on 2002-12-28 08:45:44 by BubbaFate
well, if you saw the message in spy++ then when you send it, it should work... curious... what windows ver and what ver of ie are u running now?
Posted on 2002-12-28 08:48:27 by BubbaFate
Posted on 2002-12-28 09:07:50 by f0dder
Hi, BubbaFate.
I've known what's the problem!
I sended a wParam value 1A220h to the target window,
because Spy++ reported this value 1A220h - not 0A220h.
As I know, value 1 in high word means the accelerator message.
But why I must send 0A220h?
Posted on 2002-12-28 15:50:59 by Iceberg
the only time i ever saw a wm_command message was when I clicked View->Refresh from the menu, when I hit "f5" no wm_command message appeared... I do not know how you got a different message than me, maybe your version of IE is different than mine... and of course the 0 in "0A220h" implies that its from a menu
Posted on 2002-12-28 19:53:32 by BubbaFate
My IE is 6.0 ver.
I tried Spy++ again, and I got "0A220h" by click menu, and "1A220h" by hit "F5".
But invoke SendMessage, hwndIE, WM_COMMAND, 0A220h, 0 worked,
invoke SendMessage, hwndIE, WM_COMMAND, 1A220h, 0 - not.
Posted on 2002-12-29 16:12:46 by Iceberg