Win32 the simplest Htmlayout graphical interface demo

Source: Internet
Author: User

1, download htmlayoutsdk, put in workspace.

Sdk:http://www.terrainformatica.com/htmlayout/htmlayoutsdk.zip

2,VS Create the Win32 project.

3, introduce HTMLAYOUTSDK's include and Lib.

Include: Project Right-click, select Properties, select C + +, select General, append include directory to introduce HTMLAYOUTSDK.

LIB: Project right-click, select Properties, select Connector, select General, additional library directory to introduce htmlayoutsdk Lib directory.

4, place the Htmlayout.dll file in the Htmlayoutsdk\bin directory under the project directory: D:\c_workspace\Win32Html\Win32Html

5. Introduce the header file.

#include "behaviors/notifications.h"< htmlayout_behavior.hpp>#pragma comment (lib, "HTMLayout.lib")

6, Overwrite lresult CALLBACK WndProc (HWND hwnd, UINT message, WPARAM WPARAM, LPARAM LPARAM) function:

////functions: WndProc (HWND, UINT, WPARAM, LPARAM)////Purpose: Processes the message of the main window. ////wm_command-Processing Application Menu//WM_PAINT-Draw the main window//Wm_destroy-Sends an exit message and returns////LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM WPARAM, LPARAM LPARAM) {intWmid, wmevent;    Paintstruct PS;    HDC hdc;    LRESULT LRESULT;    BOOL bhandled; //Htmlayout +//Htmlayout could be created as separate window//using the CreateWindow API. //Attaching Htmlayout functionality//To the existing window delegating Windows message handling to//htmlayoutprocnd function.LResult = HTMLAYOUTPROCND (Hwnd,message,wparam,lparam, &bhandled); if(bhandled)returnLResult; Switch(message) {//htmlayout------------------------------Beg         CaseWm_create:htmlayoutloadfile (hwnd,_t ("hello.htm"));//hello.htm need to be placed in the same directory as EXE, remember to copy the DLL also past           Break; //htmlayout------------------------------End     CaseWm_command:wmid=LoWord (WParam); Wmevent=HiWord (WParam); //Analysis Menu Selection:        Switch(wmid) { CaseIdm_about:dialogbox (HInst, Makeintresource (Idd_aboutbox), hWnd, about);  Break;  CaseIdm_exit:destroywindow (HWND);  Break; default:            returnDefWindowProc (hWnd, message, WParam, LParam); }         Break;  CaseWM_PAINT:HDC= BeginPaint (HWnd, &PS); //TODO: Add any drawing code here ...EndPaint (HWnd, &PS);  Break;  CaseWm_destroy:postquitmessage (0);  Break; default:        returnDefWindowProc (hWnd, message, WParam, LParam); }    return 0;}

7, create a new HTML file, file name hello.htm

Feel free to write some content:

<body>  

8, run:

Win32 the simplest Htmlayout graphical interface demo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.