OSDN Git Service

lvNoリンク機能追加
authorqwerty2501 <riot313@gmail.com>
Sat, 4 Feb 2012 07:40:49 +0000 (16:40 +0900)
committerqwerty2501 <riot313@gmail.com>
Sat, 4 Feb 2012 07:40:49 +0000 (16:40 +0900)
nlite.suo
nlite/nlite.cpp
nlite/nlite.h
nlite/nlite.vcxproj
nlite/nlite.vcxproj.filters
nlite/nlite_commentview.cpp
nlite/nlite_common.cpp [new file with mode: 0644]

index cc9e503..37a45d3 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index b593a2d..847d433 100644 (file)
@@ -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("\91z\92è\82³\82ê\82Ä\82¢\82È\82¢\83G\83\89\81[\82ª\94­\90\82µ\82Ü\82µ\82½\81B\83A\83v\83\8a\83P\81[\83V\83\87\83\93\94z\92u\83t\83H\83\8b\83_\82É\8dì\90¬\82³\82ê\82½\83\8d\83O\83t\83@\83C\83\8b\82ð\93n\82µ\82Ä\82à\82ç\82¦\82é\82Æ\8aJ\94­\8eÒ\82ª\94ñ\8fí\82É\8aì\82Ñ\82Ü\82·");
-       errMessage += TEXT("\r\n\83G\83\89\81[\83\81\83b\83Z\81[\83W:");
-       errMessage += summary;
-       DebugOutW(fileName,function,line,DUMPING__DEBUGER__ | LINEFEAD__DEBUGER__ ,ERRORMODE__DEBUGER__,TEXT("%s"),summary);
-       ::MessageBox(NULL,errMessage.c_str(),TEXT("\91z\92è\82³\82ê\82Ä\82¢\82È\82¢\83G\83\89\81["),MB_ICONERROR | MB_OK);
-       
-
-
-        return;
- }
\ No newline at end of file
index fd44598..c5f706f 100644 (file)
@@ -8,12 +8,17 @@ namespace nlite{
        class CApplicationInfo;
        class CListenerList;
        struct Property;
+       struct GeneralProperty;
 
        //\83O\83\8d\81[\83o\83\8b
        extern const CApplicationInfo * appInfo;
        extern CListenerList listenerList;
+
+       //\83O\83\8d\81[\83o\83\8b\8aÖ\90\94
        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);
+
        //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\83v\83\8d\83p\83e\83B
        extern Property nliteProperty;                                          
        const static UINT_PTR COMMENTVIEW_HEADERITEMSIZE = 5;
index 9cc5f51..95fb94e 100644 (file)
     <ClCompile Include="nlite_chatData.cpp" />
     <ClCompile Include="nlite_commentview.cpp" />
     <ClCompile Include="nlite_commentWrite.cpp" />
+    <ClCompile Include="nlite_common.cpp" />
     <ClCompile Include="nlite_exception.cpp" />
     <ClCompile Include="nlite_mainframe.cpp" />
     <ClCompile Include="nlite_nlib.cpp" />
index 0333885..0639688 100644 (file)
     <ClCompile Include="nlite_propertyWindow.cpp">
       <Filter>ソース ファイル</Filter>
     </ClCompile>
+    <ClCompile Include="nlite_common.cpp">
+      <Filter>ソース ファイル</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="nlite.rc">
index 5cb9ce0..1f6778c 100644 (file)
@@ -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 (file)
index 0000000..4beee1b
--- /dev/null
@@ -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("\91z\92è\82³\82ê\82Ä\82¢\82È\82¢\83G\83\89\81[\82ª\94­\90\82µ\82Ü\82µ\82½\81B\83A\83v\83\8a\83P\81[\83V\83\87\83\93\94z\92u\83t\83H\83\8b\83_\82É\8dì\90¬\82³\82ê\82½\83\8d\83O\83t\83@\83C\83\8b\82ð\93n\82µ\82Ä\82à\82ç\82¦\82é\82Æ\8aJ\94­\8eÒ\82ª\94ñ\8fí\82É\8aì\82Ñ\82Ü\82·");
+       errMessage += TEXT("\r\n\83G\83\89\81[\83\81\83b\83Z\81[\83W:");
+       errMessage += summary;
+       DebugOutW(fileName,function,line,DUMPING__DEBUGER__ | LINEFEAD__DEBUGER__ ,ERRORMODE__DEBUGER__,TEXT("%s"),summary);
+       ::MessageBox(NULL,errMessage.c_str(),TEXT("\91z\92è\82³\82ê\82Ä\82¢\82È\82¢\83G\83\89\81["),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