⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webfileopendlg.cpp

📁 myie的源程序是用VC++写自已可以扩搌使用
💻 CPP
字号:
// WebFileOpenDlg.cpp : implementation file
//

#include "stdafx.h"
#include "myie.h"
#include "WebFileOpenDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CWebFileOpenDlg dialog


CWebFileOpenDlg::CWebFileOpenDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CWebFileOpenDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CWebFileOpenDlg)
	m_strAddress = _T("");
	//}}AFX_DATA_INIT
}


void CWebFileOpenDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CWebFileOpenDlg)
	DDX_Control(pDX, IDC_ADDRESS, m_conAddress);
	DDX_CBString(pDX, IDC_ADDRESS, m_strAddress);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CWebFileOpenDlg, CDialog)
	//{{AFX_MSG_MAP(CWebFileOpenDlg)
	ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWebFileOpenDlg message handlers
typedef HRESULT (CALLBACK* LPFNDLLFUNC1)(HWND ,DWORD);

BOOL CWebFileOpenDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	//auto complete
/*	HINSTANCE hIns = LoadLibrary("shlwapi.dll");
//		AfxMessageBox(IDS_SHLWAPI_FAIL);
//	else
	if(hIns != NULL)
	{
		LPFNDLLFUNC1 lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hIns, "SHAutoComplete");
		if(lpfnDllFunc1!=NULL)
			lpfnDllFunc1(m_conAddress.GetSafeHwnd(), 0xe);
		FreeLibrary(hIns);
	}
*/
	//typed urls
	TCHAR           sz[MAX_PATH];
	//TCHAR           szPath[MAX_PATH];
	HKEY            hKey;
	DWORD           dwSize;
	TCHAR			id[9] = "url";
	int				i = 1;

	if(RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Internet Explorer\\TypedUrls"), &hKey) != ERROR_SUCCESS)
	{
		TRACE0("Typed URLs not found\n");
		return TRUE;
	}
	dwSize = MAX_PATH-1;

	itoa(i, id+3, 10);

	while(RegQueryValueEx(hKey, _T(id), NULL, NULL, (LPBYTE)sz, &dwSize) == ERROR_SUCCESS)
	{
		m_conAddress.AddString(sz);
		i++;
		itoa(i, id+3, 10);
		dwSize = MAX_PATH - 1;
	}
	RegCloseKey(hKey);


	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CWebFileOpenDlg::OnBrowse() 
{
	// TODO: Add your control notification handler code here
	CString str;

	str.LoadString(IDS_FILETYPES);

	CFileDialog fileDlg(TRUE, NULL, NULL, OFN_HIDEREADONLY, str);
	if(fileDlg.DoModal() == IDOK)
	{
		m_conAddress.InsertString(0, fileDlg.GetPathName());
		m_conAddress.SetCurSel(0);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -