// DlgIE.cpp : ʵ���ļ�
//

#include "stdafx.h"
#include "DlgIE.h"
#include "afxdialogex.h"


// CDlgIE �Ի���

IMPLEMENT_DYNAMIC(CDlgIE, CDialogEx)

CDlgIE::CDlgIE(CWnd* pParent /*=NULL*/)
	: CDialogEx(CDlgIE::IDD, pParent)
{

}

CDlgIE::~CDlgIE()
{
}

void CDlgIE::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_EXPLORER1, m_web);
}


BEGIN_MESSAGE_MAP(CDlgIE, CDialogEx)
END_MESSAGE_MAP()


// CDlgIE ��Ϣ��������


void MyFullscreen( HWND hwnd, WORD mode=0 )
{
	HWND   hDesk;
	RECT   rc;   
	hDesk   =   ::GetDesktopWindow();   
	::GetWindowRect(   hDesk,   &rc   );   

	long ws = GetWindowLong(hwnd, GWL_STYLE);
	ws &= ~(WS_BORDER|/*WS_CAPTION|*/WS_THICKFRAME | WS_DLGFRAME);

	//::SetWindowLong(hwnd, GWL_STYLE, ws);	

	//::SetWindowLong(   hwnd,   GWL_STYLE,   WS_BORDER   );   

	//#ifdef dddddddd
#ifdef _DEBUG
	::SetWindowPos(   hwnd,   0,   0,   0,   rc.right,   rc.bottom,   SWP_SHOWWINDOW);
#else
	//::SetWindowPos(   hwnd,   0,   0,   0,   rc.right,   rc.bottom,   SWP_SHOWWINDOW);

	if (mode==0)
	{
		::SetWindowPos(   hwnd,   HWND_TOPMOST,   0,   0,   rc.right,   rc.bottom,   SWP_SHOWWINDOW);
	} 
	else
	{
		::SetWindowPos(   hwnd,   HWND_NOTOPMOST,   0,   0,   rc.right,   rc.bottom,   SWP_SHOWWINDOW);
		//::SetWindowPos(   hwnd,   HWND_TOP,   0,   0,   rc.right,   rc.bottom,   SWP_SHOWWINDOW);
	}

#endif

}

BOOL CDlgIE::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	MyFullscreen(GetSafeHwnd());

	CRect rt;
	GetClientRect(&rt);
	m_web.MoveWindow(&rt);

	m_web.Navigate2(COleVariant(m_url), NULL,NULL,NULL,NULL);

	return TRUE;  // return TRUE unless you set the focus to a control
	// �쳣: OCX ����ҳӦ���� FALSE
}