Solved

How can I use ActiveX in WIN32 SDK programming?

Posted on 2002-03-03
4
651 Views
Last Modified: 2013-12-03
How can I use ActiveX in WIN32 SDK programming?
0
Comment
Question by:luxee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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