generic.cpp

本文介绍了一个基于Windows的应用程序框架实现过程,包括窗口类注册、主窗口创建及消息循环处理等核心步骤,并展示了如何通过不同消息响应来控制应用的行为。

  name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-5572165936844014&dt=1194442938015&lmt=1194190197&format=336x280_as&output=html&correlator=1194442937843&url=file%3A%2F%2F%2FC%3A%2FDocuments%2520and%2520Settings%2Flhh1%2F%E6%A1%8C%E9%9D%A2%2FCLanguage.htm&color_bg=FFFFFF&color_text=000000&color_link=000000&color_url=FFFFFF&color_border=FFFFFF&ad_type=text&ga_vid=583001034.1194442938&ga_sid=1194442938&ga_hid=1942779085&flash=9&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="336" scrolling="no" height="280" allowtransparency="allowtransparency"> #include <windows.h>
#include "generic.h"
#if defined (win32)
   #define IS_WIN32 TRUE
#else
   #define IS_WIN32 FALSE
#endif

HINSTANCE hInst;        // current instance
LPCTSTR lpszAppName = "Generic";
LPCTSTR lpszTitle =   "Generic Application";
BOOL RegisterWin95(CONST WNDCLASS* lpwc);

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 {
   MSG msg;
   HWND hWnd;
   WNDCLASS wc;

   wc.style          = CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc    = (WNDPROC)WndProc;
   wc.cbClsExtra     = 0;
   wc.cbWndExtra     = 0;
   wc.hInstance      = 0;
   wc.hIcon          = LoadIcon(hInstance, lpszAppName);
   wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
   wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
   wc.lpszMenuName   = lpszAppName;
   wc.lpszClassName  = lpszAppName;

   if(!RegisterWin95(&wc))
      return false;
   hInst = hInstance;
   hWnd = CreateWindow (lpszAppName,
                        lpszTitle,
                        WS_OVERLAPPEDWINDOW,
                        CW_USEDEFAULT, 0,
                        CW_USEDEFAULT, 0,
                        NULL,
                        NULL,
                        hInstance,
                        NULL
                       );
   if(!hWnd)
      return false;
   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);
   while(GetMessage(&msg, NULL, 0,0))
    {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
    }
   return(msg.wParam);
 }

BOOL RegisterWin95(CONST WNDCLASS* lpwc)
 {
   WNDCLASSEX wcex;

   wcex.style           = lpwc->style;
   wcex.lpfnWndProc     = lpwc->lpfnWndProc;
   wcex.cbClsExtra      = lpwc->cbClsExtra;
   wcex.cbWndExtra      = lpwc->cbWndExtra;
   wcex.hInstance       = lpwc->hInstance;
   wcex.hIcon           = lpwc->hIcon;
   wcex.hCursor         = lpwc->hCursor;
   wcex.hbrBackground   = lpwc->hbrBackground;
   wcex.lpszMenuName    = lpwc->lpszMenuName;
   wcex.lpszClassName   = lpwc->lpszClassName;
   wcex.cbSize          = sizeof(WNDCLASSEX);
   wcex.hIconSm         = LoadIcon(wcex.hInstance, "SMALL");
   return RegisterClassEx(&wcex);
 }

LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   switch(uMsg)
    {
      case WM_COMMAND:
         switch(LOWORD(wParam))
          {
            case IDM_TEST :
               break;
            case IDM_EXIT :
               DestroyWindow(hWnd);
               break;
          }
         break;
      case WM_DESTROY :
         PostQuitMessage(0);
         break;
      default:
         return (DefWindowProc(hWnd, uMsg, wParam, lParam));
    }
   return(0L);
 }

 

08-05 16:05:30.898587 26792 26795 I ChiX : [CORE_CFG][F2Core ] chifeature2featurepool.cpp:1433 FinalizeFeatureInstances() RealtimePostProcessor_1: Buffer Nego Backward walk, configure feature 08-05 16:05:30.898597 26792 26795 I ChiX : [CORE_CFG][F2Core ] chifeature2featurepool.cpp:2546 UpdateOutputRequirementsFromFwkSinkPorts() Config Stream {0xb4000078c1b10e00} influences [RealtimePostProcessor:1] Output Port {0, 0, 0} - (Fmt: 0x23 Intent: 1 Dimensions: [640 x 480] Usage: 0x0 Dataspace: 0 Colorspace: -1 Rotation: 0, HDRProfile:0) 08-05 16:05:30.898606 26792 26795 I ChiX : [CORE_CFG][F2Core ] chifeature2featurepool.cpp:2546 UpdateOutputRequirementsFromFwkSinkPorts() Config Stream {0xb4000078fefe1a28} influences [RealtimePostProcessor:1] Output Port {0, 0, 3} - (Fmt: 0x23 Intent: 1 Dimensions: [1280 x 960] Usage: 0x103 Dataspace: 146931712 Colorspace: -1 Rotation: 0, HDRProfile:1) 08-05 16:05:30.898626 26792 26795 I ChiX : [CORE_CFG][F2Core ] chifeature2base.cpp:4880 ConfigureFeature() Configure feature for RealtimePostProcessor:1 (status 1) 08-05 16:05:30.898815 26792 26795 I ChiX : [ INFO][UTILS ] chithreadmanager.cpp:214 RegisterJobFamily() Registered Fn. Async_RealtimePostProcessor_Create (0x79ad51ac38) RegJobHandle 8589934593, NumOfRegisteredJob 2 08-05 16:05:30.898829 26792 26795 I ChiX : [CORE_CFG][F2Core ] chifeature2base.cpp:6890 PrepareFeatureData() Feature2Mapping: FeatureName = RealtimePostProcessor, numSessions = 1, numPipelines = 4 numPorts = 32 08-05 16:05:30.898851 26792 26795 I ChiX : [ INFO][F2Feature] opluschifeature2generic.cpp:563 OplusPipelineSelect() featureName:RealtimePostProcessor, pipelineName:RealtimePostProcessor, isAIDLsession 0 pSessionSettings 0xb400007880c8e000 08-05 16:05:30.898859 26792 26795 I ChiX : [ INFO][F2Feature] chifeature2generic.cpp:4987 OnPipelineSelect() featureName:RealtimePostProcessor, pipelineName:RealtimePostProcessor, instanceFlags {nzsl:0, swremosaic:0, hwremosaic:0, bpscam:0 rotation: 0} 08-05 16:05:30.898866 26792 26795 I ChiX : [CORE_CFG][F2Core ] chifeature2base.cpp:7045 PrepareFeatureData() feature: RealtimePostProcessor, session: 0, name: RTPostProcessor, pipeline: 0, name: RealtimePostProcessor 08-05 16:05:30.898890 26792 26795 D ChiX : [ FULL][F2Core ] chifeature2base.cpp:6980 PrepareFeatureData() Skipping: Session has pipeline 08-05 16:05:30.898894 26792 26795 D ChiX : [ FULL][F2Core ] chifeature2base.cpp:6980 PrepareFeatureData() Skipping: Session has pipeline 08-05 16:05:30.898898 26792 26795 D ChiX : [ FULL][F2Core ] chifeature2base.cpp:6980 PrepareFeatureData() Skipping: Session has pipeline 08-05 16:05:30.898919 26792 26795 I ChiX : [ INFO][UTILS ] chifeature2utils.h:4159 GetPruneTypeByImageStabilizationMode() GetPruneTypeByImageStabilizationMode:4 08-05 16:05:30.898925 26792 26795 I ChiX : [ INFO][F2Feature] chifeature2generic.cpp:4120 OnPruneUsecaseDescriptor() ImageStabilizationMode:0 PruneType:4 08-05 16:05:30.898932 26792 26795 I ChiX : [ INFO][F2Feature] chifeature2generic.cpp:4173 OnPruneUsecaseDescriptor() RealtimePostProcessor AI set Disabled 08-05 16:05:30.898941 26792 26795 I ChiX : [ INFO][F2Feature] chifeature2generic.cpp:4189 OnPruneUsecaseDescriptor() LowResolutionSnapshot set FALSE 08-05 16:05:30.898949 26792 26795 I ChiX : [ INFO][CORE ] chxextensionmodule.cpp:11108 GetPruneVariantforAWBR() m_enableAWBR: 0, PruneType:4, isVideoStreamAvailable: 0, isPreviewStreamAvailable: 0 08-05 16:05:30.898955 26792 26795 I ChiX : [ INFO][F2Feature] chifeature2generic.cpp:4218 OnPruneUsecaseDescriptor() ViullMode:0 PruneType:4 08-05 16:05:30.898961 26792 26795 I ChiX : [ INFO][F2Feature] chifeature2generic.cpp:4232 OnPruneUsecaseDescriptor() IsDolbyVision:0 PruneType:4 日志解释
最新发布
08-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值