在一个程序中使用settimer,在另外一个程序中可以利用ontimer来检测这个定时器是否到时吗?

解决方案 »

  1.   

    你要实现什么功能呢??这个貌似用ontimer是做不到的。除非两个之间进行进程间通信就可以了。
      

  2.   

    当然不行,所谓SetTimer其实只是定时发送WM_TIMER消息,这个消息当然只能在本进程内的窗口能接收到。
      

  3.   

    看MSDN:SetTimer的第一个参数:
    hWnd
    [in] Handle to the window to be associated with the timer. This window must be owned by the calling thread. If a NULL value for hWnd is passed in along with an nIDEvent of an existing timer, that timer will be replaced in the same way that an existing non-NULL hWnd timer will be.