資源簡介
基于IE內核的瀏覽器的源代碼,C++語言開發,WIN32 API,VS2013工具編譯。
對應的博客文章 http://blog.csdn.net/fanxiushu/article/details/21837859
有興趣可下載下去看看。

代碼片段和文件信息
////By?Fanxiushu?2014?-
#include?“browser.h“
#include?
#pragma?comment(lib“psapi.lib“)
/////
browser*?browser::s_web?=?NULL;
////
BOOL?AfxLoadPicfromResource(?CImage*?m_Image?LPCTSTR?sTR?UINT?nID?)
{
//UINT?nID?=?IDB_BITMAP1;
//LPCTSTR?sTR?=?RT_BITMAP;
HINSTANCE?hInst?=?GetModuleHandle(0);
////
HRSRC?hRsrc?=?::FindResource?(hInstMAKEINTRESOURCE(nID)sTR);?//?type
if?(!hRsrc)
return?FALSE;
//?load?resource?into?memory
DWORD?len?=?SizeofResource(hInst?hRsrc);
BYTE*?lpRsrc?=?(BYTE*)LoadResource(hInst?hRsrc);
if?(!lpRsrc)
return?FALSE;
//?Allocate?global?memory?on?which?to?create?stream
HGLOBAL?m_hMem?=?GlobalAlloc(GMEM_FIXED?len);
BYTE*?pmem?=?(BYTE*)GlobalLock(m_hMem);
memcpy(pmemlpRsrclen);
IStream*?pstm;
CreateStreamOnHGlobal(m_hMemFALSE&pstm);
//?load?from?stream
m_Image->Load(pstm);
//?free/release?stuff
GlobalUnlock(m_hMem);
pstm->Release();
FreeResource(lpRsrc);
return?true;
}
HRGN?ClipChildren(HWND?hwnd?RECT?clientRect?)
{
HRGN?parent?=?CreateRectRgnIndirect(&clientRect);
HWND?child?=?::GetWindow(hwnd?GW_CHILD);
while?(child)
{
RECT?rect;
GetWindowRect(child?&rect);
ScreenToClient(hwnd?(LPPOINT)&rect.left);
ScreenToClient(hwnd?(LPPOINT)&rect.right);
///
if?(rect.top? HRGN?rgn?=?CreateRectRgnIndirect(&rect);
CombineRgn(parent?parent?rgn?RGN_DIFF);
Deleteobject(rgn);
}
/////
child?=?GetWindow(child?GW_HWNDNEXT);
}
return?parent;
}
HRGN?ClipOneChildren(?HWND?hwnd?HWND?child?RECT?clientRect?)
{
HRGN?parent?=?CreateRectRgnIndirect(&clientRect);
RECT?rect;
GetWindowRect(child?&rect);
ScreenToClient(hwnd?(LPPOINT)&rect.left);
ScreenToClient(hwnd?(LPPOINT)&rect.right);
HRGN?rgn?=?CreateRectRgnIndirect(&rect);
CombineRgn(parent?parent?rgn?RGN_DIFF);
Deleteobject(rgn);
return?parent;?
}
browser::browser()
{
s_web?=?this;?
m_hHostWnd?=?NULL;?
m_pCurrPage?=?NULL;?
m_statusWnd?=?NULL;
m_hUrlEdit?=?NULL;
///
m_is_change_size?=?true?;?
m_Mouse_InChange?=?0;?
m_is_LButtonDown?=?false;?
m_ChangeMinX?=?m_ChangeMinY=640;m_ChangeMinY?=?400;
m_is_max_rc?=?false;?
////
m_bkcolor?=?RGB(255255254);//?RGB(252?247?243);//RGB(230226216);//RGB(211202226);//RGB(20020080);?
::InitializeCriticalSection(?&m_cs?);
///////
m_ScrollX=m_ScrollY?=?0;?
m_font11?=?::CreateFont(10?7?0?0
??FW_LIGHT?FALSE?FALSE?FALSE?ANSI_CHARSET
??OUT_DEFAULT_PRECIS?CLIP_DEFAULT_PRECIS?DEFAULT_QUALITY
??DEFAULT_PITCH?|?FF_ROMAN?“Times?New?Roman“);
m_font12?=?::CreateFont(14?6?0?0
FW_LIGHT?FALSE?FALSE?FALSE?ANSI_CHARSET
OUT_DEFAULT_PRECIS?CLIP_DEFAULT_PRECIS?DEFAULT_QUALITY
DEFAULT_PITCH??NULL);
// m_fontUrlEdit?=?::CreateFont(22?9?0?0
// FW_NORMAL?FALSE?FALSE?FALSE?ANSI_CHARSET
// OUT_DEFAULT_PRECIS?CLIP_DEFAULT_PRECIS?DEFAULT_QUALITY
// DEFAULT_PITCH??“System“);
m_fontUrlEdit?=?C
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5430??2014-03-22?13:20??xBrowser\app.ico
?????文件???????1902??2012-10-29?15:17??xBrowser\back.ico
?????文件??????21340??2014-03-13?16:09??xBrowser\detours.h
?????文件?????447174??2014-03-04?15:46??xBrowser\detours.lib
?????文件?????343264??2014-03-13?16:05??xBrowser\detoursd.lib
?????文件???????1326??2014-01-06?21:52??xBrowser\Dlgti
?????文件???????1902??2014-01-05?01:29??xBrowser\home.ico
?????文件???????1150??2014-03-22?13:33??xBrowser\info.ico
?????文件???????1902??2014-01-05?01:29??xBrowser\next.ico
?????文件???????1902??2014-01-05?01:29??xBrowser\refresh.ico
?????文件???????3212??2014-03-22?23:00??xBrowser\resource.h
?????文件???????4286??2014-03-24?22:59??xBrowser\set.ico
?????文件??????50489??2014-07-02?17:52??xBrowser\src\browser.cpp
?????文件???????4836??2014-07-02?17:50??xBrowser\src\browser.h
?????文件??????11466??2014-07-02?17:52??xBrowser\src\common.cpp
?????文件???????3029??2014-07-02?17:52??xBrowser\src\common.h
?????文件??????27335??2014-07-02?17:52??xBrowser\src\cookie.cpp
?????文件????????908??2014-07-02?17:52??xBrowser\src\cookie.h
?????文件???????6374??2014-01-25?11:49??xBrowser\src\log.cpp
?????文件??????20170??2014-07-02?17:52??xBrowser\src\mgrpage.cpp
?????文件???????1572??2014-07-02?17:52??xBrowser\src\mgrpage.h
?????文件??????16875??2014-07-02?17:53??xBrowser\src\TabBar.cpp
?????文件??????12807??2014-07-02?17:52??xBrowser\src\TabBar.h
?????文件??????16612??2014-07-02?17:52??xBrowser\src\webpage.cpp
?????文件???????2788??2014-07-02?17:52??xBrowser\src\webpage.h
?????文件??????10668??2014-03-01?21:14??xBrowser\src\web_ba
?????文件??????23908??2014-07-02?17:53??xBrowser\src\WINButton.cpp
?????文件???????3301??2014-07-02?17:51??xBrowser\src\WINButton.h
?????文件??????21224??2014-07-02?17:52??xBrowser\src\WndShadow.cpp
?????文件???????5546??2012-10-29?11:49??xBrowser\src\WndShadow.h
............此處省略17個文件信息
- 上一篇:基于IE內核的瀏覽器程序
- 下一篇:神經網絡實現異或
評論
共有 條評論