QQ and MSN Chat tools are known, as long as friends on the line, will be in the location of the tray to display a prompt window, you can pull the curtain type, or in the form of fading out; Think about why not add a nice hint window for your program too:
Do what you say.
One, MSN pull the curtain-type window making
Divided into three parts: 1, the window Display 2, the window to stay 3, the window disappeared;
If this is achieved, the system should have three timers, separate control. The timer defined is as follows:
#define ID_TIMER_POP_WINDOW 1
#define ID_TIMER_DISPALY_DELAY 2
#define ID_TIMER_CLOSE_WINDOW 3
Inheriting a window from CWnd, of course, can also derive from CFrameWnd, which is not a major problem, and the key is to see how you handle Wm_paint,wm_mousemove,wm_timer messages. In general, I display a picture from OnPaint () and process the timer message in Wm_timer, following the code used in the Virgin timer:
Cmsgwnd::cmsgwnd ()
{
...
SetTimer (id_tiemr_pop_window,20,null);
...
}
void Cmsgwnd::ontimer (UINT nidevent)
{
static int nheight=0;
int Cy=getsystemmetrics (sm_cyscreen);
int cx=getsystemmetrics (sm_cxscreen);
RECT RECT;
SystemParametersInfo (spi_getworkarea,0,&rect,0);
int y=rect.bottom-rect.top;
int x=rect.right-rect.left;
X=x-win_width;
Switch (nidevent)
{
Case Id_timer_pop_window:
if (nheight<=win_height)
{
++nheight;
MoveWindow (x,
Y-nheight,
Win_width,
Win_height);
Invalidate (FALSE);
}
Else
{
KillTimer (Id_timer_pop_window);
SetTimer (Id_timer_display_delay,5000,null);
}
Break;
Case Id_timer_close_window:
if (nheight>=0)
{
nheight--;
MoveWindow (x,
Y-nheight,
Win_width,
Nheight);
}
Else
{
KillTimer (Id_timer_close_window);
SendMessage (WM_CLOSE);
}
Break;
Case Id_timer_display_delay:
KillTimer (id_timer_display_delay);
SetTimer (Id_timer_close_window,20,null);
break;
}
Cwnd::ontimer (nidevent);
}
Control the display process of the window according to the length of the timer you set;