½â¾öCOMÏÔʾHTML£¬ÎÞ·¨copy¡¢pasteµÄÎÊÌâ
ÕâÁ½¸ö²Ù×÷ĬÈÏÊDZ»ÆÁ±ÎÁ˵ģ¬ÐèÒªÊÖ¶¯À¹½Ø°´¼üÏûϢȻºó´¦Àí¡£
Èç¹ûǶÈëHTMLµÄ´°¿ÚÄò»µ½WM_KEYDOWNÕâÑùµÄÏûÏ¢£¬¾ÍÖ»ºÃÖ±½ÓÔÚÏûϢѻ·ÀïÀ¹½ØÁË£º
{
while (0 != (r = GetMessage(&msg, NULL, 0, 0))) {
if (r == -1) {
break;
}
if (CheckIfDealCopyPaste(msg)) {
continue;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
È»ºó¼ì²é°´¼ü£º
bool CheckIfDealCopyPaste(const MSG &msg)
{
if (msg.message != WM_KEYDOWN) {
return false;
}
BOOL bCtrlDown = (0x80 & GetKeyState(VK_CONTROL));
if (msg.wParam == _T('X') && bCtrlDown) {
DoCommand(L"Cut");
return true;
} else if (msg.wParam == _T('C') && bCtrlDown) {
DoCommand(L"Copy");
return true;
} else if (msg.wParam == _T('V') && bCtrlDown) {
DoCommand(L"Paste");
return true;
} else if (msg.wParam == _T('A') && bCtrlDown) {
DoCommand(L"SelectAll");
return true;
}
return false;
}
void DoCommand(LPCWSTR szCommand)
{
BSTR bStr = SysAllocString(szCommand);
DoWebCommand(m_hWnd, bStr); // m_hWndΪǶÈëHTMLµÄ´°¿Ú¾ä±ú
SysFreeString(bStr);
}
// ÕâÊÇÒ»¸öCº¯Êý
void WINAPI DoWebCommand(HWND hWnd, BSTR idCmd)
{
IOleObject **browserHandle;
IOleObject *browserObject;
TRACE_FUNC;
if ((browserHandle = (IOleObject **)GetWindowLongPtr(hWnd, GWLP_USERDATA)))
{
browserObject = *browserHandle;
do
{
IWebBrowser2 *webBrowser2 = NULL;
IConnectionPointContainer *spCPC = NULL;
IConnectionPoint *spCP = NULL;
IDispatch *pDoc = NULL;
IHTMLDocument2 *htmlDoc = NULL;
VARIANT_BOOL bVal;
HRESULT hr;
hr = browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2);
Ïà¹ØÎĵµ£º
ÈçºÎÏòHTML 5¹ý¶É£¿
¡¡¡¡Web¿ª·¢ÉçÇøµÄ²»ÉÙÈËÈÏΪתÏòHTML 5Òª½÷É÷¡£±ÈÈ磬ËäȻ΢Èí¼Æ»®ÔÚIE9ÖÐÖ§³ÖHTML 5£¬µ«Õâ¼ÒÈí¼þÒµ¾Þ뢶ÔÓÚÔÚHTML 5»¹Ã»ÓÐÕýʽ³ÉΪ±ê׼֮ǰ֧³ÖËüÐÄ´æÒÉÂÇ¡£Î¢ÈíWindowsÊÂÒµ²¿×ܲÃSteven Sinofsky×î½ü½ÓÊܲɷÃʱ±íʾ£º“ÏÈ˵×Ô¼º»ùÓÚ±ê×¼£¬µ«ËæºóÓÖ˵ÄãÊÇ×î¼æÈÝHTML 5µÄä¯ÀÀÆ÷£¬ÕâÖÖ×ö·¨²»Ã÷ÖÇ£ ......
Struts -- html:link ±êÇ©µÄʹÓÃ
<html:link> ±êÇ©ÓÃÓÚÉú³ÉHTML <a> ÔªËØ¡£<html:link> ÔÚ´´½¨³¬Á´½Óʱ£¬ÓÐÁ½¸öÓŵ㣺
(1) ÔÊÐíÔÚURL ÖÐÒÔ¶àÖÖ·½Ê½°üº¬ÇëÇó²ÎÊý¡£
(2) µ±Óû§ä¯ÀÀÆ÷¹Ø±ÕCookie ʱ£¬»á×Ô¶¯ÖØдURL£¬°ÑSessionID ×÷ΪÇëÇó²ÎÊý°üº¬ÔÚURL ÖУ¬ÓÃÓÚ¸ú×ÙÓû§µÄSession ״̬¡£
< ......
ÍøÒ³Ô¤¶¨ÒåÑÕÉ«±àÂëÁбí
const unsigned int gl_color_value[] = {
0xF5F5DC,
0x000000,
0xFF0000,
0xD2B48C,
0xFFD700,
0x008080,
0xF0E68C,
0x00FF00,
0x00FFFF,
0x0000FF,
0x00FFFF,
0xFF7F50,
0x008000,
0xFDF5E6 ......
Ò»¡¢img+ÎÄ×Ö ÔÚÒ»¸ödiv ÀïÃæÈçºÎ¾ÓÖжÔÆ룿
imgºÍÎı¾ÊÇÁ½ÖÖ²»Í¬µÄ½Úµã ËùÒÔÓõķ½·¨Ò²²»Ò»Ñù
ÎÄ×ÖÖ÷ÒªÒÀ¿¿ ¸¸½ÚµãµÄÐиßÀ´¾ÓÖÐ
¶øimgÐèÒªµÄÊÇ×ÔÉíµÄ´¹Ö±ÖÐÆëÊôÐÔ
div {line-heiht£º25px;height:25px;}
div img {vertical-align:middle;}
ÀýÈ磺
<div id="buttons">
<img src= ......
±ê Ç© ÄÚ ÈÝ ±¸ ×¢
»ù ±¾ ±ê Ç© ËùÓÐHTMLÎļþ¶¼ÓеÄ
<html>……</html> ±íʾÎļþÀàÐÍΪHTMLÎĵµ
<head>……</head> ÉèÖÃÎĵµÃèÊö¼°ÆäËû²»ÔÚWEBÍøÒ³ÉÏÏÔʾµÄÐÅÏ¢ÍøÒ³µÄ±êÌ⣬Ñùʽ¶¨Ò壬Script
<body>……< ......