Solved

How can I use ActiveX in WIN32 SDK programming?

Posted on 2002-03-03
4
629 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need example 5 107
Issue when running a SSIS package (.dts) from an SQL job 21 82
SignTool Error with Windows 10 5 117
Dialogbox API leak? 18 80
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

939 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

4 Experts available now in Live!

Get 1:1 Help Now