如题.
比如程序启动之后,控制显示时间,然后消失 怎么实现/
比如程序启动之后,控制显示时间,然后消失 怎么实现/
解决方案 »
- 如何让CToolTipCtrl显示的时候不闪烁,鼠标移开的时候消失?
- virtual BOOL IsVisible() const;在CControlBar类中是什么意思?
- 请问:如何动态显示bitmap(实时改变控件的bitmap)?
- List Control如何显示图片文件
- 如何判断connect成功?
- 程序出错,莫名,求高手指教,好像是关于函数指针的,内含错误代码
- 我国为什么没有完全自主开发的操作系统? 将来会有吗? 会普遍吗?
- sos,请教在CEDIT内如何实现在UPDATEDATA(FALSE)之后的光标在字符串之后,而不是开始.
- 如何等到一个线程结束后再启动另一个线程
- 求教sdk,窗口和listbox的关系?
- system函数疑问!有大侠可以解决么?
- 简单问题请高手指点:CList和CArray的区别是什么,使用中有什么不同?
在ONTIMER中,killtimer()
设置定时器倒是挺好,要想实现在对话框上显示倒计时 就更好了
#include <stdio.h>int main()
{
HANDLE hTimer = NULL;
LARGE_INTEGER liDueTime; liDueTime.QuadPart=-100000000; // Create a waitable timer.
hTimer = CreateWaitableTimer(NULL, TRUE, "WaitableTimer");
if (!hTimer)
{
printf("CreateWaitableTimer failed (%d)\n", GetLastError());
return 1;
} printf("Waiting for 10 seconds...\n"); // Set a timer to wait for 10 seconds.
if (!SetWaitableTimer(
hTimer, &liDueTime, 0, NULL, NULL, 0))
{
printf("SetWaitableTimer failed (%d)\n", GetLastError());
return 2;
} // Wait for the timer. if (WaitForSingleObject(hTimer, INFINITE) != WAIT_OBJECT_0)
printf("WaitForSingleObject failed (%d)\n", GetLastError());
else
printf("Timer was signaled.\n"); return 0;
}
#include <stdio.h>int main()
{
HANDLE hTimer = NULL;
LARGE_INTEGER liDueTime; liDueTime.QuadPart=-100000000; // Create a waitable timer.
hTimer = CreateWaitableTimer(NULL, TRUE, "WaitableTimer");
if (!hTimer)
{
printf("CreateWaitableTimer failed (%d)\n", GetLastError());
return 1;
} printf("Waiting for 10 seconds...\n"); // Set a timer to wait for 10 seconds.
if (!SetWaitableTimer(
hTimer, &liDueTime, 0, NULL, NULL, 0))
{
printf("SetWaitableTimer failed (%d)\n", GetLastError());
return 2;
} // Wait for the timer. if (WaitForSingleObject(hTimer, INFINITE) != WAIT_OBJECT_0)
printf("WaitForSingleObject failed (%d)\n", GetLastError());
else printf("Timer was signaled.\n"); return 0;
}
#include <stdio.h>int main()
{
HANDLE hTimer = NULL;
LARGE_INTEGER liDueTime; liDueTime.QuadPart=-100000000; // Create a waitable timer.
hTimer = CreateWaitableTimer(NULL, TRUE, "WaitableTimer");
if (!hTimer)
{
printf("CreateWaitableTimer failed (%d)\n", GetLastError());
return 1;
} printf("Waiting for 10 seconds...\n"); // Set a timer to wait for 10 seconds.
if (!SetWaitableTimer(
hTimer, &liDueTime, 0, NULL, NULL, 0))
{
printf("SetWaitableTimer failed (%d)\n", GetLastError());
return 2;
} // Wait for the timer. if (WaitForSingleObject(hTimer, INFINITE) != WAIT_OBJECT_0)
printf("WaitForSingleObject failed (%d)\n", GetLastError());
else printf("Timer was signaled.\n"); return 0;
}
SetTimer
OnTimer里计时,判断
splash = new CSplashScreen;
splash->Create(CSplashScreen::IDD);
splash->SetIcon(hIcon,FALSE);
splash->SetWindowText("整定系统");
splash->ShowWindow(SW_SHOW);
splash->UpdateWindow();
Sleep(3000);
splash->ShowWindow(SW_HIDE);
splash->DestroyWindow();
delete splash;