模拟动画图标

框架类OnCreate函数体中添加(HICON m_hIcon[3])

{

 

        m_hIcon[0]=LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_ICON1));

m_hIcon[1]=LoadIcon(theApp.m_hInstance,MAKEINTRESOURCE(IDI_ICON2));

m_hIcon[2]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON3));

SetClassLong(m_hWnd,GCL_HICON,(LONG)m_hIcon[0]);//设置图标为第一个,而不是默认的

SetTimer(1,1000,NULL);  //定时器

 

}

然后添加框架类OnTimer函数

{

 

       static int index=0;

SetClassLong(m_hWnd,GCL_HICON,(LONG)m_hIcon[index]);

index=++index%3;

 

}

你可能感兴趣的:(职场,图标,休闲,定时刷新)