home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 October / Chip_2002-10_cd1.bin / zkuste / vbasic / Data / Utils / WMP71SDK.exe / wmphost.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-31  |  1.2 KB  |  49 lines

  1. // wmphost.cpp : Main window procedure
  2. //
  3. // Copyright (C) 1996-2001 Microsoft Corporation
  4. // All rights reserved.
  5. //
  6.  
  7. #include "stdafx.h"
  8. #include "resource.h"
  9. #include "initguid.h"
  10. #include "CWMPHost.h"
  11. #include <commctrl.h>
  12.  
  13. CComModule _Module;
  14.  
  15. BEGIN_OBJECT_MAP(ObjectMap)
  16. END_OBJECT_MAP()
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. //
  20. extern "C" int WINAPI _tWinMain(HINSTANCE hInstance,
  21.     HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int /*nShowCmd*/)
  22. {
  23.     lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
  24.  
  25.     CoInitialize(0);
  26.     _Module.Init(ObjectMap, hInstance);
  27.  
  28.     ::InitCommonControls();
  29.  
  30.     RECT rcPos = { CW_USEDEFAULT, 0, 0, 0 };
  31.     HMENU hMenu = LoadMenu(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MENU1));
  32.     HICON hIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON1));
  33.  
  34.     CWMPHost frame;
  35.     frame.GetWndClassInfo().m_wc.hIcon = hIcon;
  36.     frame.Create(GetDesktopWindow(), rcPos, _T("WMP Host Container"), 0, 0, (UINT)hMenu);
  37.     frame.ShowWindow(SW_SHOWNORMAL);
  38.  
  39.     MSG msg;
  40.     while (GetMessage(&msg, 0, 0, 0))
  41.     {
  42.         TranslateMessage(&msg);
  43.         DispatchMessage(&msg);
  44.     }
  45.     _Module.Term();
  46.     CoUninitialize();
  47.     return 0;
  48. }
  49.