source: trunk/Utilities/RenderInterlacedVideo/RenderInterlacedVideo.cpp @ 297

Last change on this file since 297 was 295, checked in by roman, 10 years ago

Small code refactoring and simulation of EC_DISPLAY_CHANGED event due to activity at "wrong" monitor

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2014
3// Created by Roman Ryltsov roman@alax.info
4
5#include "stdafx.h"
6#include "resource.h"
7#include "RenderInterlacedVideo_i.h"
8#include "MainPropertySheet.h"
9
10////////////////////////////////////////////////////////////
11// CRenderInterlacedVideoModule
12
13class CRenderInterlacedVideoModule : 
14        public CAtlExeModuleT<CRenderInterlacedVideoModule>,
15        public CWtlExeModuleT<CRenderInterlacedVideoModule>
16{
17public:
18
19//DECLARE_LIBID(LIBID_AlaxInfoRenderInterlacedVideo)
20
21//DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MODULE, "{07B79191-7939-462E-8F28-4F02BC0AF1D4}")
22
23public:
24// CRenderInterlacedVideoModule
25        CRenderInterlacedVideoModule()
26        {
27                AtlTraceSetDefaultSettings();
28                _W(CExceptionFilter::Initialize());
29                _Z4_THIS();
30        }
31        ~CRenderInterlacedVideoModule()
32        {
33                _Z4_THIS();
34                CExceptionFilter::Terminate();
35        }
36        HRESULT PreMessageLoop(INT nShowCommand)
37        {
38                _ATLTRY
39                {
40                        TraceModuleVersion();
41                        __E(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_COOL_CLASSES));
42                        //__C(CWtlExeModule::Initialize());
43                        __C(__super::PreMessageLoop(nShowCommand));
44                }
45                _ATLCATCH(Exception)
46                {
47                        _C(Exception);
48                }
49                return S_OK;
50        }
51        VOID RunMessageLoop()
52        {
53                Lock();
54                {
55                        CMainPropertySheet MainPropertySheet;
56                        MainPropertySheet.DoModal();
57                }
58                if(GetLockCount() == 1)
59                {
60                        m_dwTimeOut = 0L;
61                        m_dwPause = 0L;
62                }
63                Unlock();
64        }
65        HRESULT PostMessageLoop()
66        {
67                _ATLTRY
68                {
69                        _V(__super::PostMessageLoop());
70                        //CWtlExeModule::Terminate();
71                }
72                _ATLCATCH(Exception)
73                {
74                        _C(Exception);
75                }
76                return S_OK;
77        }
78};
79
80CRenderInterlacedVideoModule _AtlModule;
81
82////////////////////////////////////////////////////////////
83// Main
84
85extern "C" int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, INT nShowCommand)
86{
87    return _AtlModule.WinMain(nShowCommand);
88}
89
Note: See TracBrowser for help on using the repository browser.