- CVI 정보나눔(www.cvi.kr)
- 스터디
- 개발메모
개발메모(형식에 매이지 않는 짤막한 개발 낙서)
글 수 174
윈도를 옮기거나 크기를 변경해도 타이머 호출 유지하려면
즉, "event-blocking conditions" 에서도 타이머 콜백함수가 호출될 수 있도록 하는 것
// "event-blocking conditions" 에서도 타이머 콜백함수가 호출될 수 있도록 하기 위해
SetSystemAttribute (ATTR_ALLOW_UNSAFE_TIMER_EVENTS, TRUE);
이라고 해주면 되네요....
-----------------------------------------------
ATTR_ALLOW_UNSAFE_TIMER_EVENTS
Type: System attribute
Description: By default, timer control callbacks do not occur while you are moving or sizing a window, while the system menu is pulled down, or while the Alt-Tab key is pressed. (These are called "event-blocking conditions.") You can use this attribute to enable timer events under some, but not all, of the event-blocking conditions. If you set this attribute to TRUE, timer events are blocked only under the following conditions: (1) You have clicked on a window title bar, you are holding the mouse button down, but you are not moving the mouse. (2) You are moving or resizing a window, and the Windows "Show Window Contents While Dragging" option is disabled.
There are several limitations to this feature. One limitation is that while an event-blocking condition is in effect, timer callbacks are called no faster than once per 55 milliseconds.
Another limitation is that if a timer callback is called during an event-blocking condition and the callback causes events to be processed, mouse and keyboard input can behave erratically. Your program can cause this to happen in the following ways. (1) The timer callback function calls ProcessSystemEvents in a loop. (2) The timer callback function calls RunUserInterface, GetUserEvent, or a popup panel function such as MessagePopup or FileSelectPopup. (3) Program execution is suspended in the timer callback function because of a breakpoint or run-time error.
In either case, the system functions normally once the timer callback returns.
This problem is inherent to Windows and occurs regardless of the development environment.
You should not enable this attribute until the code in your timer callbacks has been thoroughly debugged. The behavior of the system is undefined if you hit a breakpoint or run-time error when an event-blocking condition is in effect.
0 = Do not allow unsafe timer events.
1 = Allow unsafe timer events.
Data Type: integer
Default Value: 0
Values
0 False
1 True
-----------------------------------------------
2009.6.11
허창원
즉, "event-blocking conditions" 에서도 타이머 콜백함수가 호출될 수 있도록 하는 것
// "event-blocking conditions" 에서도 타이머 콜백함수가 호출될 수 있도록 하기 위해
SetSystemAttribute (ATTR_ALLOW_UNSAFE_TIMER_EVENTS, TRUE);
이라고 해주면 되네요....
-----------------------------------------------
ATTR_ALLOW_UNSAFE_TIMER_EVENTS
Type: System attribute
Description: By default, timer control callbacks do not occur while you are moving or sizing a window, while the system menu is pulled down, or while the Alt-Tab key is pressed. (These are called "event-blocking conditions.") You can use this attribute to enable timer events under some, but not all, of the event-blocking conditions. If you set this attribute to TRUE, timer events are blocked only under the following conditions: (1) You have clicked on a window title bar, you are holding the mouse button down, but you are not moving the mouse. (2) You are moving or resizing a window, and the Windows "Show Window Contents While Dragging" option is disabled.
There are several limitations to this feature. One limitation is that while an event-blocking condition is in effect, timer callbacks are called no faster than once per 55 milliseconds.
Another limitation is that if a timer callback is called during an event-blocking condition and the callback causes events to be processed, mouse and keyboard input can behave erratically. Your program can cause this to happen in the following ways. (1) The timer callback function calls ProcessSystemEvents in a loop. (2) The timer callback function calls RunUserInterface, GetUserEvent, or a popup panel function such as MessagePopup or FileSelectPopup. (3) Program execution is suspended in the timer callback function because of a breakpoint or run-time error.
In either case, the system functions normally once the timer callback returns.
This problem is inherent to Windows and occurs regardless of the development environment.
You should not enable this attribute until the code in your timer callbacks has been thoroughly debugged. The behavior of the system is undefined if you hit a breakpoint or run-time error when an event-blocking condition is in effect.
0 = Do not allow unsafe timer events.
1 = Allow unsafe timer events.
Data Type: integer
Default Value: 0
Values
0 False
1 True
-----------------------------------------------
2009.6.11
허창원