//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Module Name: mainwnd.cpp
Abstract: Implements the main window, the container for the webbrowser
Functions:
Notes: Most of the code resides here. The container and its interaction with the webbrowser control,
commandbar, statusbar etc.
--*/
#include "Precomp.h"
#include "commdlg.h"
#include "resource.h"
#include "MainWnd.h"
#include "animthrd.h"
#include "addfavoritesdlg.h"
#include "favlistfulldlg.h"
#include "organizefavoritesdlg.h"
#include "regkeys.h"
#include "debug.h"
#include "RegFavorites.h"
#include <urlmon.h>
#include "WebBrowser.h"
#include "sipapi.h"
DBGPARAM dpCurSettings;
#define INITGUID
#include "initguid.h"
DEFINE_GUID(CLSID_WebBrowser, 0x8856F961L, 0x340A, 0x11D0, 0xA9, 0x6B, 0x00, 0xC0, 0x4F, 0xD7, 0x05, 0xA2);
DEFINE_GUID(IID_IWebBrowser, 0xEAB22AC1L, 0x30C1, 0x11CF, 0xA7, 0xEB, 0x00, 0x00, 0xC0, 0x5B, 0xAE, 0x0B);
DEFINE_GUID(IID_IWebBrowser2, 0xD30C1661L, 0xCDAF, 0x11D0, 0x8A, 0x3E, 0x00, 0xC0, 0x4F, 0xC9, 0xE2, 0x6E);
DEFINE_GUID(DIID_DWebBrowserEvents, 0xEAB22AC2L, 0x30C1, 0x11CF, 0xA7, 0xEB, 0x00, 0x00, 0xC0, 0x5B, 0xAE, 0x0B);
DEFINE_GUID(DIID_DWebBrowserEvents2, 0x34A715A0L, 0x6587, 0x11D0, 0x92, 0x4A, 0x00, 0x20, 0xAF, 0xC7, 0xAC, 0x4D);
DEFINE_GUID(IID_IWebBrowserApp, 0x0002DF05L, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
const GUID SID_SDocHost = { 0xc6504990, 0xd43e, 0x11cf, { 0x89, 0x3b, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x1a}};
static TBBUTTON tbBtns[] = { {0, ID_GO_BACK, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
{1, ID_GO_FORWARD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
{2, ID_VIEW_STOP, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
{3, ID_VIEW_REFRESH, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
{4, ID_GO_HOME, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
{5, ID_GO_SEARCH, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
};
static TCHAR szTypedUrls[] = _T("Software\\Microsoft\\Internet Explorer\\TypedURLs");
#define PROGRESSPANEWIDTH 100 //width of the progressbar
#define MAX_STATUSMSGLEN 127 //the maximum length for the statusbar message
#define ID_COMBOEDIT 1001 //ID for the edit box of a combo box
#define MAXURLS 10 //maximum number of typed url's.
#define MAX(a,b) (a > b) ? a : b
#define MIN(a,b) (a > b) ? b : a
LONG glThreadCount = 0;
HWND ghWndAddressEdit= NULL;
HANDLE ghExitEvent = NULL;
HINSTANCE g_hInstance = NULL;
DWORD g_dwMainWindowStackSize = 0x20000;
void GetProxyOption();
static HRESULT FindString();
BOOL RegisterMainWnd();
#ifndef NO_GUIDFROMSTRING
#define InRange(id, idFirst, idLast) ((UINT)((id)-(idFirst)) <= (UINT)((idLast)-(idFirst)))
#define IsInRange InRange
#define ARRAYSIZE(a) (sizeof(a)/sizeof((a)[0]))
// scan psz for a number of hex digits (at most 8); update psz, return
// value in Value; check for chDelim; return TRUE for success.
BOOL HexStringToDword(LPCTSTR * ppsz, DWORD * lpValue, int cDigits, TCHAR chDelim)
{
int ich;
LPCTSTR psz = *ppsz;
DWORD Value = 0;
BOOL fRet = TRUE;
for (ich = 0; ich < cDigits; ich++)
{
TCHAR ch = psz[ich];
if (InRange(ch, TEXT('0'), TEXT('9')))
{
Value = (Value << 4) + ch - TEXT('0');
}
else if ( InRange( (ch |= (TEXT('a')-TEXT('A'))), TEXT('a'), TEXT('f')) )
{
Value = (Value << 4) + ch - TEXT('a') + 10;
}
else
return(FALSE);
}
if (chDelim)
{
fRet = (psz[ich++] == chDelim);
}
*lpValue = Value;
*ppsz = psz+ich;
return fRet;
}
// parse above format; return TRUE if succesful; always writes over *pguid.
STDAPI_(BOOL) GUIDFromString(LPCTSTR psz, GUID *pguid)
{
DWORD dw;
if (*psz++ != TEXT('{') /*}*/ )
return FALSE;
if (!HexStringToDword(&psz, &pguid->Data1, sizeof(DWORD)*2, TEXT('-')))
return FALSE;
if (!HexStringToDword(&psz, &dw, sizeof(WORD)*2, TEXT('-')))
return FALSE;
pguid->Data2 = (WORD)dw;
if (!HexStringToDword(&psz, &dw, sizeof(WORD)*2, TEXT('-')))
return FALSE;
pguid->Data3 = (WORD)dw;
if (!HexStringToDword(&psz, &dw, sizeof(BYTE)*2, 0))
return FALSE;
pguid->Data4[0] = (BYTE)dw;
if (!HexStringToDword(&psz, &dw, sizeof(BYTE)*2, TEXT('-')))
return FALSE;
pguid->Data4[1] = (BYTE)dw;
if (!HexStringToDword(&psz, &dw, sizeof(BYTE)*2, 0))
return FALSE;
pguid->Data4[2] = (BYTE)dw;
if (!HexStringToDword(&psz, &dw, sizeof(BYTE)*2, 0))
return FALSE;
pguid->Data4[3] = (BYTE)dw;
if (!HexStringToDword(&psz, &dw, sizeof(BYTE)*2, 0))
return FALSE;
pguid->Data4[4] = (BYTE)dw;
if (!HexStringToDword(&psz, &dw, sizeof(BYTE)*2, 0))
return FALSE;
pguid->Data4[5] = (BYTE)dw;
if (!HexStringToDword(&psz, &dw, sizeof(BYTE)*2, 0))
return FALSE;
pguid->Data4[6] = (BYTE)dw;
if (!HexStringToDword(&psz, &dw, sizeof(BYTE)*2, /*(*/ TEXT('}')))
return FALSE;
pguid->Data4[7] = (BYTE)dw;
return TRUE;
}
#endif
CMainWnd g_MainWnd;
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR lpCmdLine, int nCmdShow)
{
INITCOMMONCONTROLSEX iccsex;
DWORD dwSize = sizeof(DWORD);
// _Module.Init(NULL, reinterpret_cast<HINSTANCE>(hInst));
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr))
{
return FALSE;
}
// ENTER_APP_ZONE( PROC_ID );
if (!RegisterMainWnd())
return FALSE;
iccsex.dwSize = sizeof(INITCOMMONCONTROLSEX);
iccsex.dwICC = ICC_COOL_CLASSES | ICC_TREEVIEW_CLASSES;
InitCommonControlsEx(&iccsex);
g_hInstance = hInst;
g_MainWnd.Create();
MSG msg;
PeekMessage(&msg, NULL, 0,0,PM_NOREMOVE);
while (GetMessage( &msg, NULL, 0, 0 ) )
{
if(msg.message == WM_QUIT)
break;
if (!g_MainWnd.PreTranslateMessage(&msg) &&
!(msg.message == WM_CHAR && msg.wParam == VK_TAB))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
CoUninitialize();
// _Module.Term();
// SipHideIM();
//LEAVE_APP_ZONE( PROC_ID );
return TRUE;
}
#ifdef ZONEDISPLAY
BOOL GetZoneName(DWORD lZone, LPWSTR pwszName, DWORD cch)
{
DWORD nIndex;
if (!pwszName || !cch)
return FALSE;
if (!g_pZoneNameCache)
{
IInternetZoneManager * pizm = NULL;
// Create ZoneManager
CoCreateInstance(CLSID_InternetZoneManager, NULL, CLSCTX_INPROC_SERVER, IID_IInternetZoneManager, (void **)&pizm);
if (!pizm)
return FALSE;
DWORD dwZoneEnum, dwZoneCount;
if (FAILED(pizm->CreateZoneEnumerator(&dwZoneEnum, &dwZoneCount, 0)))
{
pizm->Release();
return FALSE;
}
g_pZoneNameCache = (PZONENAMECACHE)LocalAlloc(LPTR, dwZoneCount * sizeof(ZONENAMECACHE));
if (!g_pZoneNameCache)
{
pizm->Release();
return FALSE;
}
g_dwZoneCount = 0;
for (nIndex=0; nIndex < dwZoneCount; nIndex++)
{
DWORD dwZone;
ZONEATTRIBUTES za = {sizeof(ZONEATTRIBUTES)};
if (SUCCEEDED(piz
没有合适的资源?快使用搜索试试~ 我知道了~
WinCE5.0 IE浏览器 源码
共65个文件
h:18个
cpp:13个
bmp:5个
3星 · 超过75%的资源 需积分: 13 116 下载量 5 浏览量
2010-01-15
15:55:19
上传
评论
收藏 264KB RAR 举报
温馨提示
Wince5.0下的浏览器,编译过了。上网OK! Wince5.0下的浏览器,编译过了。上网OK! 环境是:EVC
资源推荐
资源详情
资源评论
收起资源包目录
IE.rar (65个子文件)
IE
IE_ENV1200_GPRS_RGB.vcp 7KB
sources 2KB
organizefavoritesdlg.cpp 9KB
regfavorites.h 1KB
ARMV4IRel
resrc1.h 504B
IE_ENV1200_GPRS.vcp 9KB
IE_E3265.vcl 1KB
options.cpp 13KB
html.ico 1KB
favinusedlg.h 1KB
resource.h 5KB
wceres.rc 0B
emulatorDbg
vc60.pdb 36KB
iesample.res 59KB
MIPSIIRel_E3265
iesample.res 59KB
addfavoritesdlg.cpp 5KB
IE.VCP 23KB
mainwnd.cpp 48KB
animthrd.h 2KB
favfolders.cpp 4KB
IE.VCW 532B
IE_ENV1200_GPRS_AV.vcp 7KB
favinusedlg.cpp 1KB
smbrand.bmp 30KB
favlistfulldlg.cpp 1KB
vssver.scc 864B
WebBrowser.cpp 16KB
Text.bmp 29KB
favoriteshelper.h 2KB
favfolders.h 2KB
IE_E3265.vcb 121KB
makefile 657B
stdafx.cpp 558B
IE.vcb 217KB
rc_frame.ico 10KB
IE_E3265.vcp 10KB
favlistfulldlg.h 1KB
micbrand.bmp 25KB
IE.VCL 2KB
precomp.h 2KB
emulatorRel
iesample.res 59KB
folder_c.ico 318B
favoriteshelper.cpp 14KB
IE.VCO 52KB
Release
E3265
IE.exe 84KB
regkeys.h 2KB
favstorageifc.h 3KB
defines.h 1KB
animthrd.cpp 4KB
regfavorites.cpp 8KB
organizefavoritesdlg.h 3KB
StringTable.cpp 1KB
WebBrowser.h 7KB
iesample.rc 9KB
tbhot16.bmp 12KB
IE_E3265.vcw 538B
StringTable.h 636B
url.ico 318B
addfavoritesdlg.h 2KB
cbarimg.bmp 2KB
debug.h 1KB
IE_E3265.vco 53KB
folder_o.ico 318B
mainwnd.h 4KB
iesample.aps 111KB
共 65 条
- 1
capsky
- 粉丝: 23
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页