Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I want to show NotifyIconOverflowWindow in some program, and I tried to like this:

C++
pop = FindWindow((LPCWSTR)L"NotifyIconOverflowWindow", (LPCWSTR)"");
ShowWindow(pop, SW_SHOWNORMAL);


But if I do not click taskbar and popup NotifyIconOverflowWindow at first. There is nothing in my NotifyIconOverflowWindow created by my program.
Posted
Updated 20-Jan-11 3:58am
v2

Firstly, what the hell is all the casting for? In the first case it does nothing (why cast something to what it already is?) and in the second it's a bug (casting like this doesn't make a narrow string a wide one). In fact the second cast is probably the casue of the problem as wide strings need a two byte NULL. Try this:
pop = FindWindow(L"NotifyIconOverflowWindow", NULL);
ShowWindow(pop, SW_SHOWNORMAL);

Stop casting!
 
Share this answer
 
Comments
yiqixuxu 20-Jan-11 10:19am    
I think nothing about casting...
Sergey Alexandrovich Kryukov 20-Jan-11 11:12am    
Good point (my 5), looks like a big misconception about casting (and typing?)
Looks like the window contents are rendered the first time the window is popped up via the triangular button in the task bar. So if that has not happened, then obviously you will see a blank window when you show the window in this manner.

You could try sending a left mouse click to the button though, that way you will always be sure that the window will be properly rendered when it shows up.
 
Share this answer
 
Comments
yiqixuxu 20-Jan-11 19:41pm    
yes, but I donot want do this,maybe other way?
Nish Nishant 20-Jan-11 20:06pm    
That's the way Windows works. Every double click event is basically two really fast single clicks - and this generates one single click event followed by a double click event. There's no way around it really.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900