本文整理汇总了C++中OnTimer函数的典型用法代码示例。如果您正苦于以下问题:C++ OnTimer函数的具体用法?C++ OnTimer怎么用?C++ OnTimer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OnTimer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: UpdateData
void CIOCP_ClientDlg::OnBnClickedStopTest()
{
UpdateData(TRUE);
GetDlgItem(IDB_STOP_TEST)->EnableWindow(FALSE);
m_IOCPModel.EndTest();
ClientDB::GetInstance()->ExecuteSQL(TEXT("COMMIT;")); // 提交事务
KillTimer(ID_TIMER_FRESH_INTERVAL);
OnTimer(ID_TIMER_FRESH_INTERVAL);
KillTimer(ID_TIMER_PER_SEC);
OnTimer(ID_TIMER_PER_SEC);
MessageBox(_T("测试已完成!"),_T("提示"), MB_OK);
GetDlgItem(IDB_START_TEST)->EnableWindow(TRUE);
}
开发者ID:KingsleyYau,项目名称:PushServer,代码行数:14,代码来源:IOCP_ClientDlg.cpp
示例2: switch
LRESULT RootWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_CREATE:
return OnCreate();
case WM_MOUSEMOVE:
return OnMouseMove(wParam, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
case WM_NCDESTROY:
KillTimer(m_hwnd, ANIM_TIMER_ID);
// Death of the root window ends the thread
PostQuitMessage(0);
break;
case WM_SETFOCUS:
if (NULL != m_hwndChild)
SetFocus(m_hwndChild);
return 0;
case WM_TIMER:
OnTimer();
return 0;
case WM_KEYDOWN:
OnKeyDown(wParam, lParam);
return 0;
}
return super::HandleMessage(uMsg, wParam, lParam);
}
开发者ID:kjk,项目名称:kjkpub,代码行数:32,代码来源:LoadPict.cpp
示例3: return
bool CMixer::Exclusive(bool Enable, const DISPLAY_MODE_INFO *ModeInfo)
{
if (Enable == m_IsExclusive)
return(TRUE); // nothing to do
bool retc = FALSE; // assume failure
if (Enable) {
if (GetCurView() == NULL) // if no view
return(FALSE); // exclusive mode is useless
CString ErrMsg;
if (CreateBackBuf(ErrMsg, ModeInfo)) { // create back buffer
ApplySettings();
OnTimer(FRAME_TIMER_ID); // display first frame
retc = TRUE; // success
} else { // create back buffer failed
DestroyBackBuf();
if (ErrMsg.IsEmpty()) // if specific error message wasn't set
ErrMsg.LoadString(IDS_CANT_SET_EXCLUSIVE); // use generic message
AfxMessageBox(ErrMsg);
}
} else { // disable exclusive
DestroyBackBuf();
retc = TRUE; // success
}
theApp.UpdateAllViews(NULL, CFracticeView::UVH_EXCLUSIVE, NULL);
return(retc);
}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:26,代码来源:Mixer.cpp
示例4: QGridLayout
OpenGLOutput::OpenGLOutput()
:QDialog()
{
ui = new Ui::OpenGLOutputDialog();
ui->setupUi(this);
layout = new QGridLayout(ui->previewContainer);
layout->setMargin(0);
previewView = new CDeckLinkGLWidget(this);
previewView->resize(ui->previewContainer->size());
previewView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
layout->addWidget(previewView, 0, 0, 0, 0);
previewView->DrawFrame(NULL);
pOpenGLOutput = new BMDOpenGLOutput();
if (!pOpenGLOutput->InitDeckLink())
exit(0);
if (!pOpenGLOutput->InitGUI(previewView))
exit(0);
if (!pOpenGLOutput->InitOpenGL())
exit(0);
pTimer = new QTimer(this);
connect(pTimer, SIGNAL(timeout()), this, SLOT(OnTimer()));
setWindowTitle("OpenGLOutput");
show();
}
开发者ID:DishBird,项目名称:VideoSuiteUtilities,代码行数:30,代码来源:OpenGLOutput.cpp
示例5: WndProc
LRESULT WINAPI WndProc( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{
switch( nMsg )
{
case WM_PAINT:
OnPaint( hWnd );
break;
case WM_TIMER:
OnTimer( hWnd, wParam );
break;
case WM_CREATE:
{
SetTimer( hWnd, 1, 10, NULL );
// SetTimer( hWnd, 2, 2000, TimerProc );
//最后一个参数是否为NULL,将影响 这个定时器
//触发WM_TIMER消息,找谁处理。
}
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
}
return DefWindowProc( hWnd, nMsg, wParam, lParam );
}
开发者ID:dekai-wang,项目名称:TestCode,代码行数:25,代码来源:WinTimer.cpp
示例6: StopAnimation
void CFadeButtonUI::DoEvent(TEventUI& event)
{
if( event.Type == UIEVENT_MOUSEENTER && !IsAnimationRunning( FADE_IN_ID ) )
{
m_bFadeAlpha = 0;
m_bMouseHove = TRUE;
StopAnimation( FADE_OUT_ID );
StartAnimation( FADE_ELLAPSE, FADE_FRAME_COUNT, FADE_IN_ID );
Invalidate();
return;
}
if( event.Type == UIEVENT_MOUSELEAVE && !IsAnimationRunning( FADE_OUT_ID ) )
{
m_bFadeAlpha = 0;
m_bMouseLeave = TRUE;
StopAnimation(FADE_IN_ID);
StartAnimation(FADE_ELLAPSE, FADE_FRAME_COUNT, FADE_OUT_ID);
Invalidate();
return;
}
if( event.Type == UIEVENT_TIMER )
{
OnTimer( event.wParam );
}
CButtonUI::DoEvent( event );
}
开发者ID:CodeBees,项目名称:duilib-Ex-Debug,代码行数:26,代码来源:UIFadeButton.cpp
示例7: LogInfo
Cron::Cron() {
LogInfo("Cron Started...");
// Conmpute next slot
int now = QDateTime::currentDateTime().toTime_t();
QTimer::singleShot(1000 * (60 - (now%60)), this, SLOT(OnTimer()));
lastGivenID = 0;
}
开发者ID:staffitalia,项目名称:OpenJabNab,代码行数:7,代码来源:cron.cpp
示例8: Initialize
void CSnakeView::OnStart()
{
// TODO: 在此添加命令处理程序代码
gameStart = 1;
Initialize();
OnTimer(1);
}
开发者ID:zhenghaishu,项目名称:Snake-Game-on-VS2010,代码行数:7,代码来源:SnakeView.cpp
示例9: switch
int CMainFrame::MsgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
OnCommand(wParam, lParam);
break;
case WM_CREATE:
OnCreate(wParam, lParam);
break;
case WM_DESTROY:
OnDestroy(wParam, lParam);
break;
case WM_SIZE:
OnSize(wParam, lParam);
return 1;
case WM_TIMER:
OnTimer(wParam, lParam);
return 1;
case WM_ERASEBKGND:
return 0;
}
return DefFrameProc(m_hWnd, m_hClient, uMsg, wParam, lParam);
}
开发者ID:neuks,项目名称:Synaptics,代码行数:25,代码来源:CMainFrame.cpp
示例10: ASSERT
LRESULT CTrayIconHooker::WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam)
{
ASSERT(m_pTrayIcon);
LRESULT lResult = 0;
if (nMsg == wm_TaskbarCreated)
lResult = OnTaskbarCreated(wParam, lParam);
else
{
switch (nMsg)
{
case WM_TIMER:
{
if (wParam == m_pTrayIcon->m_NotifyIconData.uID) //It's our timer
OnTimer(wParam);
else
lResult = Default();
break;
}
default:
{
lResult = Default();
break;
}
}
}
return lResult;
}
开发者ID:jfburdet,项目名称:nwquota,代码行数:29,代码来源:Ntray.cpp
示例11: ScreenSaverProc
LRESULT WINAPI ScreenSaverProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE:
InitSaver(hWnd);
break;
case WM_TIMER:
OnTimer(hWnd, (UINT)wParam);
break;
case WM_DESTROY:
KillTimer(hWnd, IDT_TIMER);
PostQuitMessage(0);
return 0;
case WM_KEYDOWN:
#ifdef DEBUG_MODE // in debug mode, user can exit program by press "ESC"
if(VK_ESCAPE == wParam)
PostQuitMessage(0);
#endif
if(IsMagicKey((char)wParam))
return 0;
break;
}
#ifndef DEBUG_MODE
return DefScreenSaverProc(hWnd, message, wParam, lParam);
#else
return DefWindowProc(hWnd, message, wParam, lParam);
#endif
}
开发者ID:kaifengz,项目名称:candy,代码行数:33,代码来源:MySaver.cpp
示例12: dc
void CComboBoxExt::OnCbnSelendCandel()
{
CClientDC dc(this);
m_bPress=FALSE;
dc.DeleteDC();
OnTimer(1001);
}
开发者ID:weimingtom,项目名称:swc,代码行数:7,代码来源:CComboBoxExt.cpp
示例13: switch
void App::OnKeyboard(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
switch (message) {
case WM_KEYUP:
break;
case WM_KEYDOWN:
break;
case WM_CHAR: {
switch (wParam) {
case 'k':
KillHalf(hwnd);
break;
case 'x':
PostQuitMessage(0);
break;
// Temporary thing to fasten the program
case ' ':
OnTimer(hwnd);
break;
}
}
break;
default:
break;
}
}
开发者ID:Olster,项目名称:Bunnies,代码行数:33,代码来源:App.cpp
示例14: main
int main(int argc,char ** argv)
{
// start GL context and O/S window using the GLFW helper library
appDelegate.AppWillStart();
FPS_Helper fpsHelper;
fpsHelper.SetFixedFPS(30);
InitOpenGL();
appDelegate.AppDidStart();
while (!glfwWindowShouldClose (mainWnd.window))
{
// wipe the drawing surface clear
static double timer_last = 0;
double curr_time = glfwGetTime();
if(curr_time - timer_last > 0.2)
{
timer_last = timer_last + 0.02;
OnTimer();
}
if(fpsHelper.Tick())
{
OnRender();
// update other events like input handling
glfwPollEvents ();
// put the stuff we've been drawing onto the display
glfwSwapBuffers (mainWnd.window);
}
}
// close GL context and any other GLFW resources
appDelegate.AppWillTerminate();
glfwTerminate();
return 0;
}
开发者ID:bhlzlx,项目名称:graphics,代码行数:35,代码来源:main.cpp
示例15: GetHandle
void CEditLog::AddText(
LPCWSTR pwszAdd,
bool bLFtoCRLF // = false
)
{
if( pwszAdd ) {
::EnterCriticalSection( &m_csLock );
if( bLFtoCRLF ) {
// Add text to our buffer, but convert each LF to a CRLF pair
int cchAdd = ::wcslen( pwszAdd );
// Ensure no buffer enlargement operations are necessary
m_wsStore.reserve( m_wsStore.length() + cchAdd * 2 );
for( int i = 0; i < cchAdd; ++i ) {
if( pwszAdd[ i ] == L'\n' )
m_wsStore += L'\r';
m_wsStore += pwszAdd[ i ];
}
}
else
// Simly add text
m_wsStore += pwszAdd;
// If the log is filled really fast or the UI thread is doing something
// else, the WM_ADDTEXT messages may not get processed for a long period.
// To avoid floating the UI threads message queue, we post only one message.
if( !m_bMessagePending && GetHandle() != NULL ) {
::PostMessage( GetHandle(), WM_ADDTEXT, 0, 0 );
m_bMessagePending = true;
}
::LeaveCriticalSection( &m_csLock );
}
OnTimer(0);
}
开发者ID:open2cerp,项目名称:Open2C-ERP,代码行数:35,代码来源:EditLog.cpp
示例16: switch
BOOL CInputBox::ProcSubHandler(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
switch (iMsg) {
case WM_INITDIALOG:
if (m_hWnd == NULL)
m_hWnd = hDlg;
return OnInitDialog();
case WM_SIZE:
OnSize((UINT)wParam, LOWORD(lParam), HIWORD(lParam));
return TRUE;
case WM_GETMINMAXINFO:
OnGetMinMaxInfo((LPMINMAXINFO) lParam);
return TRUE;
case WM_TIMER:
OnTimer((UINT)wParam);
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
OnOK();
return TRUE;
case IDCANCEL:
OnCancel();
return TRUE;
default:
return FALSE;
}
default:
return FALSE;
}
}
开发者ID:dzzie,项目名称:au3src,代码行数:31,代码来源:inputbox.cpp
示例17: Keyboard
Keyboard(wxWindow *parent)
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(0, kWhiteKeyHeight))
{
img_white_ = LoadImage(L"pianokey_white.png");
img_white_pushed_ = LoadImage(L"pianokey_white_pushed.png");
img_white_pushed_contiguous_ = LoadImage(L"pianokey_white_pushed_contiguous.png");
img_black_ = LoadImage(L"pianokey_black.png");
img_black_pushed_ = LoadImage(L"pianokey_black_pushed.png");
img_white_.Rescale(kKeyWidth, kWhiteKeyHeight);
img_white_pushed_.Rescale(kKeyWidth, kWhiteKeyHeight);
img_white_pushed_contiguous_.Rescale(kKeyWidth, kWhiteKeyHeight);
img_black_.Rescale(kKeyWidth+1, kBlackKeyHeight);
img_black_pushed_.Rescale(kKeyWidth+1, kBlackKeyHeight);
Bind(wxEVT_PAINT, [this](auto &ev) { OnPaint(); });
timer_.Bind(wxEVT_TIMER, [this](auto &ev) { OnTimer(); });
timer_.Start(50);
Bind(wxEVT_LEFT_DOWN, [this](auto &ev) { OnLeftDown(ev); });
Bind(wxEVT_LEFT_DCLICK, [this](auto &ev) { OnLeftDown(ev); });
Bind(wxEVT_LEFT_UP, [this](auto &ev) { OnLeftUp(ev); });
Bind(wxEVT_MOTION, [this](auto &ev) { OnMotion(ev); });
Bind(wxEVT_KEY_DOWN, [this](auto &ev) { OnKeyDown(ev); });
Bind(wxEVT_KEY_UP, [this](auto &ev) { OnKeyUp(ev); });
key_code_for_sample_note_.fill(0);
}
开发者ID:hotwatermorning,项目名称:Vst3HostDemo,代码行数:28,代码来源:Keyboard.cpp
示例18: DlgProc
/**
* ダイアログメッセージをメッセージを各関数に振り分けるだけです。
* @return TRUE(1)のときメッセージを処理
*/
INT_PTR DlgProc(
HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message){
case WM_INITDIALOG:
return OnInitDialog(hWnd, (HWND)wParam, lParam);
case WM_DESTROY:
return OnDestroy(hWnd);
case WM_CLOSE:
return OnClose(hWnd);
case WM_COMMAND:
return OnCommand(
hWnd,
(int)(LOWORD(wParam)),
(HWND)(lParam),
(UINT)HIWORD(wParam));
case WM_NOTIFY_ICON:
OnNotifyIcon(hWnd, wParam, lParam);
return TRUE;
case WM_TIMER:
OnTimer(hWnd, wParam);
return 0;
}
return FALSE;
}
开发者ID:misohena,项目名称:usbrh_monitor,代码行数:29,代码来源:usbrh_monitor.cpp
示例19: StringFromResource
int CDuffDlg::Search()
{
m_Status.SetWindowText( StringFromResource(IDS_STATUS_BUSY) );
if (m_bAnimateControl)
{
m_AnimateControl.ShowWindow(SW_SHOW);
m_AnimateControl.Play(ALL);
}
g_DupeFileFind.StartSearch();
if (m_bAnimateControl)
{
m_AnimateControl.Stop();
}
m_Status.SetWindowText( StringFromResource(IDS_STATUS_IDLE) );
OnTimer(TIMER_PROGRESS);
KillTimer(TIMER_PROGRESS);
if ( theApp.m_DuffOptions.Sound.Enabled )
PlaySoundFile( theApp.m_DuffOptions.Sound.ProcessComplete );
return 0;
}
开发者ID:GerHobbelt,项目名称:duff,代码行数:27,代码来源:duffDlg.cpp
示例20: dc
void CclockDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作区矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
OnTimer(m_timer);
CDialog::OnPaint();
}
}
开发者ID:CrazyBigTree,项目名称:Clock,代码行数:26,代码来源:clockDlg.cpp
注:本文中的OnTimer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论