Solved

How can I use ActiveX in WIN32 SDK programming?

Posted on 2002-03-03
4
619 Views
Last Modified: 2013-12-03
How can I use ActiveX in WIN32 SDK programming?
0
Comment
Question by:luxee
4 Comments
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 100 total points
ID: 6838394
MSDN Says in
       HOWTO: Adding ATL Control Containment Support to Any Window

You can now start creating ActiveX controls using the WIN32 CreateWindow() API, specifying "AtlAxWin" as the class name and either a GUID, ProgID, or URL as the title. For example:



      // Create the Calendar control specifying the ProgID.
      // Make sure the module handle you pass to CreateWindow is the same
      // module handle where AtlAxWinInit() was called from.
      HWND hWnd = ::CreateWindow("AtlAxWin", "MSCAL.Calendar",
         WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
         ::GetModuleHandle(NULL), NULL);

      // Same as above except CLSID is specified instead of ProgID
      // corresponds to ProgID "MSCAL.Calendar.7"
      HWND hWnd = ::CreateWindow("AtlAxWin",
         "{8E27C92B-1264-101C-8A2F-040224009C02}",
         WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
         ::GetModuleHandle(NULL), NULL);

      // Creates the Web Browser control & navigates to specified web page.
      HWND hWnd = ::CreateWindow("AtlAxWin", "<LINK TYPE="GENERIC"          VALUE="http://www.microsoft.com",">
         http://www.microsoft.com",</LINK>
         WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
         ::GetModuleHandle(NULL), NULL);

      // Creates an instance of an dynamic HTML document.
      HWND hWnd = ::CreateWindow("AtlAxWin", "mshtml:<H1>Hello World</H1>",
         WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
         ::GetModuleHandle(NULL), NULL);

GOOD LUCK
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now