기본 브라우저로 인터넷 창 열기
공부/프로그램 / 2016. 12. 22. 16:58
- CString GetDefaultBrowser()
- {
- TCHAR szPath[_MAX_PATH] = {0,};
- HFILE h = _lcreat("dummy.htm",0) ;
- _lclose(h) ;
- FindExecutable(_T("dummy.htm"), NULL, szPath);
- DeleteFile(_T("dummy.htm"));
- return CString(szPath);
- }
- ...
- ::ShellExecute (NULL, _T("open"), GetDefaultBrowser(), _T("http://www.google.com"), NULL, SW_SHOWNORMAL);
출처 http://hyacinth.byus.net/moniwiki/wiki.php/C%2B%2B/(Windows)%EA%B8%B0%EB%B3%B8%20%EB%B8%8C%EB%9D%BC%EC%9A%B0%EC%A0%80%20%EC%97%B4%EA%B8%B0