Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

COMµÄHTML¿Ø¼þ

http://www.experts-exchange.com/Programming/Languages/C/Q_24038236.html
/* CWebPage.c

This is a Win32 C application (ie, no MFC, WTL, nor even any C++ -- just plain C) that demonstrates
how to embed a browser "control" (actually, an OLE object) in your own window (in order to display a
web page, or an HTML file on disk).

This is very loosely based upon a C++ example written by Chris Becke. I used that to learn the minimum
of what I needed to know about hosting the browser object. Then I wrote this example from the ground up
in C.
*/


//begin code for systray

#define _WIN32_WINNT 0x0501 // clarity
#define _WIN32_IE 0x0601
#define assert(_Expression) (void)( (!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression), _CRT_WIDE(__FILE__), __LINE__), 0) )


#include <windows.h>
#include <stdlib.h> //for atoi() and _itoa()
#include <string.h>
// end code for systray
#include <exdisp.h> // Defines of stuff like IWebBrowser2. This is an include file with Visual C 6 and above
#include <mshtml.h> // Defines of stuff like IHTMLDocument2. This is an include file with Visual C 6 and above
#include <crtdbg.h> // for _ASSERT()
#include <shellapi.h> //for system tray and balloon tool-tips
#include <urlmon.h> //urlmon.lib must be added in Projects->setting->link->projects
#include <stdio.h>
#include <winsock2.h>
//#include <curl.h>
//#include "Auditor.h"
#include <Wininet.h>
#pragma comment(lib,"wininet.lib")


// net checing2 begin


//#include "afxsock.h"
#include <iostream.h>
//#include <stdafx.h>




//void main()
//{
// Generate an error

// if(!GetProcessId(NULL))
// ErrorExit(TEXT("GetProcessId"));
//}





// netchecking2 end



#define MAX_LINE_LENGTH 1024
// A running count of how many windows we have open that contain a browser object
unsigned char WindowCount =


Ïà¹ØÎĵµ£º

Struts html:link ±êÇ©µÄʹÓÃ

Struts -- html:link ±êÇ©µÄʹÓÃ
 
<html:link> ±êÇ©ÓÃÓÚÉú³ÉHTML <a> ÔªËØ¡£<html:link> ÔÚ´´½¨³¬Á´½Óʱ£¬ÓÐÁ½¸öÓŵ㣺
(1) ÔÊÐíÔÚURL ÖÐÒÔ¶àÖÖ·½Ê½°üº¬ÇëÇó²ÎÊý¡£
(2) µ±Óû§ä¯ÀÀÆ÷¹Ø±ÕCookie ʱ£¬»á×Ô¶¯ÖØдURL£¬°ÑSessionID ×÷ΪÇëÇó²ÎÊý°üº¬ÔÚURL ÖУ¬ÓÃÓÚ¸ú×ÙÓû§µÄSession ״̬¡£
< ......

HTML¶ÁÊé±Ê¼Ç

1.·ÀֹͼƬ±»ÏÂÔغ͵ÁÓõķ½·¨£º
  £¨1£©<div>ǶÌ×<img>ÉèÖÃ<div>µÄ±³¾°Í¼Æ¬ÎªÊµ¼ÊͼƬ£¬<img>°üº¬µÄͼƬÊÇÒ»ÕÅ͸Ã÷ͼƬ£¬Á½ÕÅͼƬµÄ³ß´çÏàͬ¡£¼´Ï൱ÓÚÔÚÕæʵͼƬÉÏÌí¼ÓÁËÒ»²ã±£»¤Ä¤£¬ÕâÕű£»¤Ä¤¾ÍÊÇ͸Ã÷ͼƬ¡£ÕâÑùµ±Óû§Ñ¡Ôñ“ͼƬÁí´æΪ”ʱ£¬½«±£´æµÄÊÇ͸Ã÷ͼƬ£¬¶ø²»ÊÇʵ¼Êͼ ......

html±êÇ©¼°ÊôÐÔ´óÈ«

»ù±¾½á¹¹±êÇ©:
<HTML>,±íʾ¸ÃÎļþΪHTMLÎļþ
<HEAD>,°üº¬ÎļþµÄ±êÌâ,ʹÓõĽű¾,Ñùʽ¶¨ÒåµÈ
<TITLE>---</TITLE>,°üº¬ÎļþµÄ±êÌâ,±êÌâ³öÏÖÔÚä¯ÀÀÆ÷±êÌâÀ¸ÖÐ
</HEAD>,<HEAD>µÄ½áÊø±êÖ¾
<BODY>,·ÅÖÃä¯ÀÀÆ÷ÖÐÏÔʾÐÅÏ¢µÄËùÓбêÖ¾ºÍÊôÐÔ,ÆäÖÐÄÚÈÝÔÚä¯ÀÀÆ÷ÖÐÏÔʾ.
</BOD ......

HtmlʼþÁбí


 
Ò»°ãʼþ:
onClick HTML: Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷
onDblClick HTML: Êó±êË«»÷ʼþ
onMouseDown HTML: Êó±êÉϵİ´Å¥±»°´ÏÂÁË
onMouseUp HTML: Êó±ê°´Ïºó£¬ËÉ¿ªÊ±¼¤·¢µÄʼþ
onMouseOver HTML: µ±Êó±êÒƶ¯µ½Ä³¶ÔÏó·¶Î§µÄÉÏ·½Ê±´¥·¢µÄʼþ
onMouseMove HTML: Êó±êÒƶ¯Ê±´¥·¢µ ......

HTML ÖÐ META ½²½â

         METAÊÇÓÃÀ´ÔÚHTMLÎĵµÖÐÄ£ÄâHTTPЭÒéµÄÏìӦͷ±¨ÎÄ¡£META±êÇ©ÓÃÓÚÍøÒ³µÄÓëÖУ¬META±êÇ©µÄÓô¦ºÜ¶à¡£METAµÄÊôÐÔÓÐÁ½ÖÖ£ºnameºÍhttp-equiv¡£nameÊôÐÔÖ÷ÒªÓÃÓÚÃèÊöÍøÒ³£¬¶ÔÓ¦ÓÚcontent£¨ÍøÒ³ÄÚÈÝ£©£¬ÒÔ±ãÓÚËÑË÷ÒýÇæ»úÆ÷È˲éÕÒ¡¢·ÖÀࣨĿǰ¼¸ºõËùÓеÄËÑË÷ÒýÇ涼ʹÓÃÍøÉÏ»úÆ÷ÈË ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ