|
|
|
Активация события программы при включении ScreenSaver
|
|||
|---|---|---|---|
|
#18+
Доброго всем времени суточек, Может кто сталкивался или делал по необходимости, Необходимо чтобы программа при включении ScreenSaver Windows отсчитала какоето время и подала звуковой сигнал. вопрос следующий, как поймать событие Windows, что запущен ScreenSaver? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2008, 14:46 |
|
||
|
Активация события программы при включении ScreenSaver
|
|||
|---|---|---|---|
|
#18+
По таймеру перебирать процессы пока среди них не найдется процесс с расширением scr. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2008, 15:52 |
|
||
|
Активация события программы при включении ScreenSaver
|
|||
|---|---|---|---|
|
#18+
Это несколько не то, ине точно надо знать что сработал Screen Saver ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.04.2008, 00:38 |
|
||
|
Активация события программы при включении ScreenSaver
|
|||
|---|---|---|---|
|
#18+
A screen saver will start, pending your choices, whenever there is no mouse or keyboard activity for the current screen saver timeout period. Some applications need to know when the screen saver has started in order to do some background processing, for example, writing or updating the data to disk. MORE INFORMATION When a screen saver starts, it posts a WM_SYSCOMMAND message to the foreground window with WPARAM as SC_SCREENSAVE. To detect and notify other applications of this event, use the following steps: Install WH_GETMESSAGE Global hook. hHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)HookProc, (HINSTANCE) hMod, 0); Define a user-defined registered message for example, "ScreenSaverStarted". UINT WM_SCRNSVSTART = RegisterWindowMessage("ScreenSaverStarted"); Broadcast this message to all top-level windows in the system. LRESULT CALLBACK HookProc(UINT code , WPARAM wParam, LPARAM lParam) { MSG *msg = (MSG *)lParam; if ( msg->message == WM_SYSCOMMAND && msg->wParam == SC_SCREENSAVE) { // broadcast message to all top-level windows // Or execute some other code here PostMessage(HWND_BROADCAST, WM_SCRNSVSTART, 0, 0); } // Always call next hook in chain return CallNextHookEx(hHook, code, wParam, lParam); } Uninstall the hook. UnhookWindowsHookEx(hHook); ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.04.2008, 10:08 |
|
||
|
Активация события программы при включении ScreenSaver
|
|||
|---|---|---|---|
|
#18+
A screen saver will start, pending your choices, whenever there is no mouse or keyboard activity for the current screen saver timeout period. Some applications need to know when the screen saver has started in order to do some background processing, for example, writing or updating the data to disk. MORE INFORMATION When a screen saver starts, it posts a WM_SYSCOMMAND message to the foreground window with WPARAM as SC_SCREENSAVE. To detect and notify other applications of this event, use the following steps: Install WH_GETMESSAGE Global hook. hHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)HookProc, (HINSTANCE) hMod, 0); Define a user-defined registered message for example, "ScreenSaverStarted". UINT WM_SCRNSVSTART = RegisterWindowMessage("ScreenSaverStarted"); Broadcast this message to all top-level windows in the system. LRESULT CALLBACK HookProc(UINT code , WPARAM wParam, LPARAM lParam) { MSG *msg = (MSG *)lParam; if ( msg->message == WM_SYSCOMMAND && msg->wParam == SC_SCREENSAVE) { // broadcast message to all top-level windows // Or execute some other code here PostMessage(HWND_BROADCAST, WM_SCRNSVSTART, 0, 0); } // Always call next hook in chain return CallNextHookEx(hHook, code, wParam, lParam); } Uninstall the hook. UnhookWindowsHookEx(hHook); ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.04.2008, 10:10 |
|
||
|
|

start [/forum/topic.php?fid=60&fpage=195&tid=2162438]: |
0ms |
get settings: |
10ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
56ms |
get topic data: |
12ms |
get forum data: |
2ms |
get page messages: |
44ms |
get tp. blocked users: |
1ms |
| others: | 203ms |
| total: | 343ms |

| 0 / 0 |
