From: qwerty2501 Date: Sat, 4 Feb 2012 07:40:49 +0000 (+0900) Subject: lvNoリンク機能追加 X-Git-Tag: v0.002~2^2~35 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=df1846e55636562e3b256793bd86c5af8436aa9a;p=nlite%2Fnlite.git lvNoリンク機能追加 --- diff --git a/nlite.suo b/nlite.suo index cc9e503..37a45d3 100644 Binary files a/nlite.suo and b/nlite.suo differ diff --git a/nlite/nlite.cpp b/nlite/nlite.cpp index b593a2d..847d433 100644 --- a/nlite/nlite.cpp +++ b/nlite/nlite.cpp @@ -8,13 +8,7 @@ CAppModule _Module; -namespace nlite{ -Property nliteProperty; - -const CApplicationInfo * appInfo = NULL; - -} static TCHAR localAppDataPath[_MAX_PATH]; static WSAData wsaData; //winsockdata @@ -186,16 +180,3 @@ static BOOL InitializeNlite(){ return; } - VOID nlite::UnexpectedErrorMessageShow(LPCTSTR headMessage,LPCTSTR summary,UINT line,LPCTSTR fileName,LPCTSTR function){ - tstring errMessage; - errMessage = headMessage; - errMessage += TEXT("‘z’肳‚ê‚Ä‚¢‚È‚¢ƒGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½BƒAƒvƒŠƒP[ƒVƒ‡ƒ“”z’uƒtƒHƒ‹ƒ_‚ɍ쐬‚³‚ꂽƒƒOƒtƒ@ƒCƒ‹‚ð“n‚µ‚Ä‚à‚炦‚é‚ÆŠJ”­ŽÒ‚ª”ñí‚ÉŠì‚Ñ‚Ü‚·"); - errMessage += TEXT("\r\nƒGƒ‰[ƒƒbƒZ[ƒW:"); - errMessage += summary; - DebugOutW(fileName,function,line,DUMPING__DEBUGER__ | LINEFEAD__DEBUGER__ ,ERRORMODE__DEBUGER__,TEXT("%s"),summary); - ::MessageBox(NULL,errMessage.c_str(),TEXT("‘z’肳‚ê‚Ä‚¢‚È‚¢ƒGƒ‰["),MB_ICONERROR | MB_OK); - - - - return; - } \ No newline at end of file diff --git a/nlite/nlite.h b/nlite/nlite.h index fd44598..c5f706f 100644 --- a/nlite/nlite.h +++ b/nlite/nlite.h @@ -8,12 +8,17 @@ namespace nlite{ class CApplicationInfo; class CListenerList; struct Property; + struct GeneralProperty; //ƒOƒ[ƒoƒ‹ extern const CApplicationInfo * appInfo; extern CListenerList listenerList; + + //ƒOƒ[ƒoƒ‹ŠÖ” extern VOID UnexpectedErrorMessageShow(LPCTSTR headMessage,LPCTSTR summary,UINT line,LPCTSTR fileName,LPCTSTR function); + extern HINSTANCE OpenURL(HWND hwnd,const GeneralProperty &gp,LPCTSTR url ,INT nShowCommand); + //ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ƒvƒƒpƒeƒB extern Property nliteProperty; const static UINT_PTR COMMENTVIEW_HEADERITEMSIZE = 5; diff --git a/nlite/nlite.vcxproj b/nlite/nlite.vcxproj index 9cc5f51..95fb94e 100644 --- a/nlite/nlite.vcxproj +++ b/nlite/nlite.vcxproj @@ -131,6 +131,7 @@ + diff --git a/nlite/nlite.vcxproj.filters b/nlite/nlite.vcxproj.filters index 0333885..0639688 100644 --- a/nlite/nlite.vcxproj.filters +++ b/nlite/nlite.vcxproj.filters @@ -113,6 +113,9 @@ ソース ファイル + + ソース ファイル + diff --git a/nlite/nlite_commentview.cpp b/nlite/nlite_commentview.cpp index 5cb9ce0..1f6778c 100644 --- a/nlite/nlite_commentview.cpp +++ b/nlite/nlite_commentview.cpp @@ -4,6 +4,7 @@ using namespace std::tr1; namespace nlite{ + static const LPCTSTR LIVEURL_PART = TEXT("http://live.nicovideo.jp/watch/"); static const UINT_PTR SELL_SPACE_LENGTH = 1; // @@ -1524,15 +1525,7 @@ end: chatReadEdit.GetSelText(selTextBuf); if(regex_match((LPCTSTR)selTextBuf,nliteregex::URL) == TRUE){ - if(self.generalProperty.browserPath.Length() == 0){ - - ShellExecute(*this, NULL, selTextBuf, NULL, NULL, SW_SHOWNORMAL); - - } else{ - - - } - + OpenURL(*this,self.generalProperty,selTextBuf,SW_SHOWNORMAL); } else if(regex_match((LPCTSTR)selTextBuf,nliteregex::VIDEOID) == TRUE){ @@ -1540,8 +1533,9 @@ end: dumpln(TEXT("videoId")); } else if( regex_match((LPCTSTR)selTextBuf,nliteregex::LIVEID) == TRUE){ - - dumpln(TEXT("liveId")); + + selTextBuf.Insert(0,LIVEURL_PART); + OpenURL(*this,self.generalProperty,selTextBuf,SW_SHOWNORMAL); } diff --git a/nlite/nlite_common.cpp b/nlite/nlite_common.cpp new file mode 100644 index 0000000..4beee1b --- /dev/null +++ b/nlite/nlite_common.cpp @@ -0,0 +1,46 @@ +#include "stdafx.h" +#include "nlite_include.h" + + + +namespace nlite{ + +Property nliteProperty; + + + VOID nlite::UnexpectedErrorMessageShow(LPCTSTR headMessage,LPCTSTR summary,UINT line,LPCTSTR fileName,LPCTSTR function){ + tstring errMessage; + errMessage = headMessage; + errMessage += TEXT("‘z’肳‚ê‚Ä‚¢‚È‚¢ƒGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½BƒAƒvƒŠƒP[ƒVƒ‡ƒ“”z’uƒtƒHƒ‹ƒ_‚ɍ쐬‚³‚ꂽƒƒOƒtƒ@ƒCƒ‹‚ð“n‚µ‚Ä‚à‚炦‚é‚ÆŠJ”­ŽÒ‚ª”ñí‚ÉŠì‚Ñ‚Ü‚·"); + errMessage += TEXT("\r\nƒGƒ‰[ƒƒbƒZ[ƒW:"); + errMessage += summary; + DebugOutW(fileName,function,line,DUMPING__DEBUGER__ | LINEFEAD__DEBUGER__ ,ERRORMODE__DEBUGER__,TEXT("%s"),summary); + ::MessageBox(NULL,errMessage.c_str(),TEXT("‘z’肳‚ê‚Ä‚¢‚È‚¢ƒGƒ‰["),MB_ICONERROR | MB_OK); + + + + return; + } + + HINSTANCE OpenURL(HWND hwnd,const GeneralProperty &gp,LPCTSTR url ,INT nShowCommand){ + + HINSTANCE rslt; + + if(gp.browserPath.Length() == 0){ + + rslt = ShellExecute(hwnd, NULL, url, NULL, NULL, nShowCommand); + + } else{ + + rslt = ShellExecute(hwnd, NULL, gp.browserPath, url, NULL, nShowCommand); + + } + + return rslt; + + } + + +const CApplicationInfo * appInfo = NULL; + +} \ No newline at end of file