topmostGui = false;
startWithGui = false;
+ preventSS = false;
chanLog="";
iniFile.writeBoolValue("topmostGui", servMgr->topmostGui);
iniFile.writeBoolValue("startWithGui", servMgr->startWithGui);
+ iniFile.writeBoolValue("preventSS", servMgr->preventSS);
#endif
int i;
servMgr->guiAntennaNotifyIcon = iniFile.getBoolValue();
else if (iniFile.isName("topmostGui"))
- {
servMgr->topmostGui = iniFile.getBoolValue();
- } else if (iniFile.isName("startWithGui"))
- {
+ else if (iniFile.isName("startWithGui"))
servMgr->startWithGui = iniFile.getBoolValue();
- }
+ else if (iniFile.isName("preventSS"))
+ servMgr->preventSS = iniFile.getBoolValue();
#endif
// debug
bool topmostGui; // \8dÅ\91O\96Ê
bool startWithGui; // \8bN\93®\8e\9e\82ÉGUI
+ bool preventSS; // \83X\83N\83\8a\81[\83\93\83Z\81[\83o\81[\82ð\97}\8e~
int maxRelaysIndexTxt; // for PCRaw (relay)
#if 1 /* for VP extend version */
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
-static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5-2)";
-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5-2)";
+static const int PCP_CLIENT_VERSION_EX_NUMBER = 28;
+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0028)";
+static const char *PCX_VERSTRING_EX = "v0.1218(IM0028)";
#endif
// ------------------------------------------------
\81E\83\8a\83\8c\81[\8fã\8cÀ\83`\83F\83b\83N
\81@\81@bool Channel::isFull(); (channel.cpp)
+
+\81E\89º\97¬\82Ö\82Ì\93]\91\97
+\81@\81@void Servent::sendPCPChannel()
extern Stats stats;
ThreadInfo trafficDlgThread;
HWND trafficDlg = NULL;
+FileStream fs;
// \83v\83\8d\83g\83^\83C\83v\90é\8c¾
void createGUI(HWND);
void LOG2(const char *fmt,...)
{
va_list ap;
- va_start(ap, fmt);
+ va_start(ap, fmt);
char str[4096];
vsprintf(str,fmt,ap);
OutputDebugString(str);
- va_end(ap);
+ va_end(ap);
}
-
-// ---------------------------------------
-int APIENTRY WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
+// --------------------------------------------------
+int WinMainDummy(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
{
#ifdef _DEBUG
// memory leak check
*end = 0;
}
-
+
if (strnicmp(tmpURL,"peercast://",11)==0)
{
if (strnicmp(tmpURL+11,"pls/",4)==0)
if (!allowMulti)
{
HANDLE mutex = CreateMutex(NULL,TRUE,szWindowClass);
-
+
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
HWND oldWin = FindWindow(szWindowClass,NULL);
if (oldWin)
{
- //SendMessage(oldWin,WM_SHOWGUI,0,0);
+ //SendMessage(oldWin,WM_SHOWGUI,0,0);
if (killMe)
{
SendMessage(oldWin,WM_DESTROY,0,0);
if (killMe)
return 0;
-
+
MyRegisterClass(hInstance);
MyRegisterClass2(hInstance);
}
}
- Shell_NotifyIcon(NIM_DELETE, (NOTIFYICONDATA*)&trayIcon);
+ Shell_NotifyIcon(NIM_DELETE, (NOTIFYICONDATA*)&trayIcon);
peercastInst->saveSettings();
peercastInst->quit();
}
+// ---------------------------------------
+int APIENTRY WinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
+{
+ // SEH handling
+ __try
+ {
+#if 0
+#ifdef _DEBUG
+ // memory leak check
+ ::_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+#endif
+
+ char tmpURL[8192];
+ tmpURL[0]=0;
+ char *chanURL=NULL;
+
+ hInst = hInstance;
+
+ version_ex = 1; // PP\94Å\8ag\92£\8b@\94\\82ð\96³\8cø\82É\81©\91å\89R\81B\83o\81[\83W\83\87\83\93\95\\8bL\82ðEX\82É
+
+ iniFileName.set(".\\peercast.ini");
+
+ WIN32_FIND_DATA fd; //JP-EX
+ HANDLE hFind; //JP-EX
+
+ OSVERSIONINFO osInfo; //JP-EX
+ osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); //JP-EX
+ GetVersionEx(&osInfo);
+ if (osInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ winDistinctionNT = true;
+ else
+ winDistinctionNT = false;
+
+ // off by default now
+ showGUI = false;
+
+ if (strlen(lpCmdLine) > 0)
+ {
+ char *p;
+ if ((p = strstr(lpCmdLine,"-inifile"))!=NULL)
+ iniFileName.setFromString(p+8);
+
+ if (strstr(lpCmdLine,"-zen"))
+ showGUI = false;
+
+ if (strstr(lpCmdLine,"-multi"))
+ allowMulti = true;
+
+ if (strstr(lpCmdLine,"-kill"))
+ killMe = true;
+
+ if ((p = strstr(lpCmdLine,"-url"))!=NULL)
+ {
+ p+=4;
+ while (*p)
+ {
+ if (*p=='"')
+ {
+ p++;
+ break;
+ }
+ if (*p != ' ')
+ break;
+ p++;
+ }
+ if (*p)
+ strncpy(tmpURL,p,sizeof(tmpURL)-1);
+ }
+ }
+
+ // get current path
+ {
+ exePath = iniFileName;
+ char *s = exePath.cstr();
+ char *end = NULL;
+ while (*s)
+ {
+ if (*s++ == '\\')
+ end = s;
+ }
+ if (end)
+ *end = 0;
+ }
+
+
+ if (strnicmp(tmpURL,"peercast://",11)==0)
+ {
+ if (strnicmp(tmpURL+11,"pls/",4)==0)
+ chanURL = tmpURL+11+4;
+ else
+ chanURL = tmpURL+11;
+ showGUI = false;
+ }
+
+
+ MSG msg;
+ HACCEL hAccelTable;
+
+ // Initialize global strings
+ //LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
+ //LoadString(hInstance, IDC_APP_TITLE, szWindowClass, MAX_LOADSTRING);
+
+ strcpy(szTitle,"PeerCast");
+ strcpy(szWindowClass,"PeerCast");
+ strcpy(szWindowClass2,"Main");
+
+ if (!allowMulti)
+ {
+ HANDLE mutex = CreateMutex(NULL,TRUE,szWindowClass);
+
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ HWND oldWin = FindWindow(szWindowClass,NULL);
+ if (oldWin)
+ {
+ //SendMessage(oldWin,WM_SHOWGUI,0,0);
+ if (killMe)
+ {
+ SendMessage(oldWin,WM_DESTROY,0,0);
+ return 0;
+ }
+
+ if (chanURL)
+ {
+ COPYDATASTRUCT copy;
+ copy.dwData = WM_PLAYCHANNEL;
+ copy.cbData = strlen(chanURL)+1; // plus null term
+ copy.lpData = chanURL;
+ SendMessage(oldWin,WM_COPYDATA,NULL,(LPARAM)©);
+ }else{
+ if (showGUI)
+ SendMessage(oldWin,WM_SHOWGUI,0,0);
+ }
+ }
+ return 0;
+ }
+ }
+
+ if (killMe)
+ return 0;
+
+ MyRegisterClass(hInstance);
+ MyRegisterClass2(hInstance);
+
+ // Perform application initialization:
+ if (!InitInstance (hInstance, nCmdShow))
+ return FALSE;
+
+ peercastInst = new MyPeercastInst();
+ peercastApp = new MyPeercastApp();
+
+ peercastInst->init();
+
+ LOG_DEBUG("Set OS Type: %s",winDistinctionNT?"WinNT":"Win9x");
+
+ if (peercastApp->clearTemp()) //JP-EX
+ {
+ DeleteFile("play.pls");
+ hFind = FindFirstFile("*.asx",&fd);
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ do
+ {
+ DeleteFile((char *)&fd.cFileName);
+ }
+ while (FindNextFile(hFind,&fd));
+
+ FindClose(hFind);
+ }
+ }
+
+ if (chanURL)
+ {
+ ChanInfo info;
+ servMgr->procConnectArgs(chanURL,info);
+ chanMgr->findAndPlayChannel(info,false);
+ }
+
+ hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SIMPLE);
+
+ // setup menu notifes
+ int mask = peercastInst->getNotifyMask();
+ if (mask & ServMgr::NT_PEERCAST)
+ CheckMenuItem(trayMenu,ID_POPUP_SHOWMESSAGES_PEERCAST,MF_CHECKED|MF_BYCOMMAND);
+ if (mask & ServMgr::NT_BROADCASTERS)
+ CheckMenuItem(trayMenu,ID_POPUP_SHOWMESSAGES_BROADCASTERS,MF_CHECKED|MF_BYCOMMAND);
+ if (mask & ServMgr::NT_TRACKINFO)
+ CheckMenuItem(trayMenu,ID_POPUP_SHOWMESSAGES_TRACKINFO,MF_CHECKED|MF_BYCOMMAND);
+
+ if (servMgr->startWithGui)
+ {
+ createGUI((HWND)0);
+ }
+
+ // Main message loop:
+ while (GetMessage(&msg, NULL, 0, 0))
+ {
+ if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+
+ Shell_NotifyIcon(NIM_DELETE, (NOTIFYICONDATA*)&trayIcon);
+
+ peercastInst->saveSettings();
+ peercastInst->quit();
+
+ Gdiplus::GdiplusShutdown(gdiplusToken);
+
+ return msg.wParam;
+#endif
+ WinMainDummy(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
+
+ } __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ fs.openWriteReplace(".\\dump.html");
+ sys->logBuf->dumpHTML(fs);
+ fs.close();
+
+ MessageBox(NULL, "\88ê\94Ê\95Û\8cì\88á\94½\82Ì\88×\81A\83v\83\8d\83O\83\89\83\80\82Í\8b\90§\8fI\97¹\82³\82ê\82Ü\82·\81B\n"
+ "\96â\91è\89ð\8c\88\82Ì\82½\82ß\82É\83_\83\93\83v\83f\81[\83^(dump.html)\82ð\92ñ\8b\9f\82µ\82Ä\82\82¾\82³\82¢\81B", "SEH",
+ MB_OK|MB_ICONWARNING);
+
+ return GetExceptionCode();
+ }
+
+ // dummy
+ return 0;
+}
+
+
//
// FUNCTION: MyRegisterClass()
CheckMenuItem(trayMenu, ID_POPUP_START_WITH_GUI, MF_UNCHECKED|MF_BYCOMMAND);
}
+ // \83X\83N\83\8a\81[\83\93\83Z\81[\83o\81[\97}\8e~
+ if (servMgr->preventSS)
+ {
+ CheckMenuItem(trayMenu, ID_POPUP_PREVENT_SS, MF_CHECKED|MF_BYCOMMAND);
+ } else
+ {
+ CheckMenuItem(trayMenu, ID_POPUP_PREVENT_SS, MF_UNCHECKED|MF_BYCOMMAND);
+ }
+
SetForegroundWindow(hWnd);
bool skipMenu=false;
}
break;
+ case ID_POPUP_PREVENT_SS:
+ // \83X\83N\83\8a\81[\83\93\83Z\81[\83o\81[\97}\8e~
+ if (servMgr->preventSS)
+ {
+ servMgr->preventSS = false;
+ CheckMenuItem(trayMenu, ID_POPUP_PREVENT_SS, MF_UNCHECKED|MF_BYCOMMAND);
+ } else
+ {
+ servMgr->preventSS = true;
+ CheckMenuItem(trayMenu, ID_POPUP_PREVENT_SS, MF_CHECKED|MF_BYCOMMAND);
+ }
+ peercastInst->saveSettings();
+ break;
+
case ID_POPUP_EXIT_CONFIRM:
case IDM_EXIT:
DestroyWindow(hWnd);
case WM_DESTROY:
PostQuitMessage(0);
break;
+
+ case WM_SYSCOMMAND:
+ // \82È\82ñ\82©\83A\83N\83e\83B\83u\82¶\82á\82È\82¢\82Æ\91\97\82ç\82ê\82Ä\82±\82È\82¢\82ç\82µ\82¢
+ if (servMgr->preventSS && (wParam == SC_SCREENSAVE) && chanMgr->isBroadcasting())
+ return 1;
+ else
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ break;
+
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
MENUITEM "\8dÄ\90Ú\91±\8e\9e\89º\97¬\88Û\8e\9d", ID_POPUP_SHOWGUI, CHECKED
MENUITEM "\8fí\82É\8eè\91O\82É\95\\8e¦", ID_POPUP_TOPMOST
MENUITEM "\8bN\93®\8e\9e\81AGUI\82ð\95\\8e¦", ID_POPUP_START_WITH_GUI
+ MENUITEM "\94z\90M\8e\9e\81AScreenSaver\82ð\97}\8e~", ID_POPUP_PREVENT_SS, GRAYED
END
MENUITEM SEPARATOR
POPUP "\8fI\97¹"
AdditionalIncludeDirectories="../../../core,../../../core/common"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
+ ExceptionHandling="1"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/Simple.pch"
#define ID_POPUP_START_WITH_GUI 32830
#define ID_POPUP_32831 32831
#define ID_POPUP_TRAFFIC 32832
+#define ID_32833 32833
+#define ID_POPUP_PREVENT_SS 32834
#define IDC_STATIC -1
// Next default values for new objects
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 144
-#define _APS_NEXT_COMMAND_VALUE 32833
+#define _APS_NEXT_COMMAND_VALUE 32835
#define _APS_NEXT_CONTROL_VALUE 1025
#define _APS_NEXT_SYMED_VALUE 110
#endif
topmostGui = false;
startWithGui = false;
+ preventSS = false;
chanLog="";
iniFile.writeBoolValue("topmostGui", servMgr->topmostGui);
iniFile.writeBoolValue("startWithGui", servMgr->startWithGui);
+ iniFile.writeBoolValue("preventSS", servMgr->preventSS);
#endif
int i;
servMgr->guiAntennaNotifyIcon = iniFile.getBoolValue();
else if (iniFile.isName("topmostGui"))
- {
servMgr->topmostGui = iniFile.getBoolValue();
- } else if (iniFile.isName("startWithGui"))
- {
+ else if (iniFile.isName("startWithGui"))
servMgr->startWithGui = iniFile.getBoolValue();
- }
+ else if (iniFile.isName("preventSS"))
+ servMgr->preventSS = iniFile.getBoolValue();
#endif
// debug
bool topmostGui; // \8dÅ\91O\96Ê
bool startWithGui; // \8bN\93®\8e\9e\82ÉGUI
+ bool preventSS; // \83X\83N\83\8a\81[\83\93\83Z\81[\83o\81[\82ð\97}\8e~
int maxRelaysIndexTxt; // for PCRaw (relay)
#if 1 /* for VP extend version */
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
-static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5-2)";
-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5-2)";
+static const int PCP_CLIENT_VERSION_EX_NUMBER = 28;
+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0028)";
+static const char *PCX_VERSTRING_EX = "v0.1218(IM0028)";
#endif
// ------------------------------------------------
\81E\83\8a\83\8c\81[\8fã\8cÀ\83`\83F\83b\83N
\81@\81@bool Channel::isFull(); (channel.cpp)
+
+\81E\89º\97¬\82Ö\82Ì\93]\91\97
+\81@\81@void Servent::sendPCPChannel()
extern Stats stats;
ThreadInfo trafficDlgThread;
HWND trafficDlg = NULL;
+FileStream fs;
// \83v\83\8d\83g\83^\83C\83v\90é\8c¾
void createGUI(HWND);
void LOG2(const char *fmt,...)
{
va_list ap;
- va_start(ap, fmt);
+ va_start(ap, fmt);
char str[4096];
vsprintf(str,fmt,ap);
OutputDebugString(str);
- va_end(ap);
+ va_end(ap);
}
-
-// ---------------------------------------
-int APIENTRY WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
+// --------------------------------------------------
+int WinMainDummy(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
{
#ifdef _DEBUG
// memory leak check
*end = 0;
}
-
+
if (strnicmp(tmpURL,"peercast://",11)==0)
{
if (strnicmp(tmpURL+11,"pls/",4)==0)
if (!allowMulti)
{
HANDLE mutex = CreateMutex(NULL,TRUE,szWindowClass);
-
+
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
HWND oldWin = FindWindow(szWindowClass,NULL);
if (oldWin)
{
- //SendMessage(oldWin,WM_SHOWGUI,0,0);
+ //SendMessage(oldWin,WM_SHOWGUI,0,0);
if (killMe)
{
SendMessage(oldWin,WM_DESTROY,0,0);
if (killMe)
return 0;
-
+
MyRegisterClass(hInstance);
MyRegisterClass2(hInstance);
}
}
- Shell_NotifyIcon(NIM_DELETE, (NOTIFYICONDATA*)&trayIcon);
+ Shell_NotifyIcon(NIM_DELETE, (NOTIFYICONDATA*)&trayIcon);
peercastInst->saveSettings();
peercastInst->quit();
}
+// ---------------------------------------
+int APIENTRY WinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
+{
+ // SEH handling
+ __try
+ {
+#if 0
+#ifdef _DEBUG
+ // memory leak check
+ ::_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+#endif
+
+ char tmpURL[8192];
+ tmpURL[0]=0;
+ char *chanURL=NULL;
+
+ hInst = hInstance;
+
+ version_ex = 1; // PP\94Å\8ag\92£\8b@\94\\82ð\96³\8cø\82É\81©\91å\89R\81B\83o\81[\83W\83\87\83\93\95\\8bL\82ðEX\82É
+
+ iniFileName.set(".\\peercast.ini");
+
+ WIN32_FIND_DATA fd; //JP-EX
+ HANDLE hFind; //JP-EX
+
+ OSVERSIONINFO osInfo; //JP-EX
+ osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); //JP-EX
+ GetVersionEx(&osInfo);
+ if (osInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ winDistinctionNT = true;
+ else
+ winDistinctionNT = false;
+
+ // off by default now
+ showGUI = false;
+
+ if (strlen(lpCmdLine) > 0)
+ {
+ char *p;
+ if ((p = strstr(lpCmdLine,"-inifile"))!=NULL)
+ iniFileName.setFromString(p+8);
+
+ if (strstr(lpCmdLine,"-zen"))
+ showGUI = false;
+
+ if (strstr(lpCmdLine,"-multi"))
+ allowMulti = true;
+
+ if (strstr(lpCmdLine,"-kill"))
+ killMe = true;
+
+ if ((p = strstr(lpCmdLine,"-url"))!=NULL)
+ {
+ p+=4;
+ while (*p)
+ {
+ if (*p=='"')
+ {
+ p++;
+ break;
+ }
+ if (*p != ' ')
+ break;
+ p++;
+ }
+ if (*p)
+ strncpy(tmpURL,p,sizeof(tmpURL)-1);
+ }
+ }
+
+ // get current path
+ {
+ exePath = iniFileName;
+ char *s = exePath.cstr();
+ char *end = NULL;
+ while (*s)
+ {
+ if (*s++ == '\\')
+ end = s;
+ }
+ if (end)
+ *end = 0;
+ }
+
+
+ if (strnicmp(tmpURL,"peercast://",11)==0)
+ {
+ if (strnicmp(tmpURL+11,"pls/",4)==0)
+ chanURL = tmpURL+11+4;
+ else
+ chanURL = tmpURL+11;
+ showGUI = false;
+ }
+
+
+ MSG msg;
+ HACCEL hAccelTable;
+
+ // Initialize global strings
+ //LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
+ //LoadString(hInstance, IDC_APP_TITLE, szWindowClass, MAX_LOADSTRING);
+
+ strcpy(szTitle,"PeerCast");
+ strcpy(szWindowClass,"PeerCast");
+ strcpy(szWindowClass2,"Main");
+
+ if (!allowMulti)
+ {
+ HANDLE mutex = CreateMutex(NULL,TRUE,szWindowClass);
+
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ HWND oldWin = FindWindow(szWindowClass,NULL);
+ if (oldWin)
+ {
+ //SendMessage(oldWin,WM_SHOWGUI,0,0);
+ if (killMe)
+ {
+ SendMessage(oldWin,WM_DESTROY,0,0);
+ return 0;
+ }
+
+ if (chanURL)
+ {
+ COPYDATASTRUCT copy;
+ copy.dwData = WM_PLAYCHANNEL;
+ copy.cbData = strlen(chanURL)+1; // plus null term
+ copy.lpData = chanURL;
+ SendMessage(oldWin,WM_COPYDATA,NULL,(LPARAM)©);
+ }else{
+ if (showGUI)
+ SendMessage(oldWin,WM_SHOWGUI,0,0);
+ }
+ }
+ return 0;
+ }
+ }
+
+ if (killMe)
+ return 0;
+
+ MyRegisterClass(hInstance);
+ MyRegisterClass2(hInstance);
+
+ // Perform application initialization:
+ if (!InitInstance (hInstance, nCmdShow))
+ return FALSE;
+
+ peercastInst = new MyPeercastInst();
+ peercastApp = new MyPeercastApp();
+
+ peercastInst->init();
+
+ LOG_DEBUG("Set OS Type: %s",winDistinctionNT?"WinNT":"Win9x");
+
+ if (peercastApp->clearTemp()) //JP-EX
+ {
+ DeleteFile("play.pls");
+ hFind = FindFirstFile("*.asx",&fd);
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ do
+ {
+ DeleteFile((char *)&fd.cFileName);
+ }
+ while (FindNextFile(hFind,&fd));
+
+ FindClose(hFind);
+ }
+ }
+
+ if (chanURL)
+ {
+ ChanInfo info;
+ servMgr->procConnectArgs(chanURL,info);
+ chanMgr->findAndPlayChannel(info,false);
+ }
+
+ hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SIMPLE);
+
+ // setup menu notifes
+ int mask = peercastInst->getNotifyMask();
+ if (mask & ServMgr::NT_PEERCAST)
+ CheckMenuItem(trayMenu,ID_POPUP_SHOWMESSAGES_PEERCAST,MF_CHECKED|MF_BYCOMMAND);
+ if (mask & ServMgr::NT_BROADCASTERS)
+ CheckMenuItem(trayMenu,ID_POPUP_SHOWMESSAGES_BROADCASTERS,MF_CHECKED|MF_BYCOMMAND);
+ if (mask & ServMgr::NT_TRACKINFO)
+ CheckMenuItem(trayMenu,ID_POPUP_SHOWMESSAGES_TRACKINFO,MF_CHECKED|MF_BYCOMMAND);
+
+ if (servMgr->startWithGui)
+ {
+ createGUI((HWND)0);
+ }
+
+ // Main message loop:
+ while (GetMessage(&msg, NULL, 0, 0))
+ {
+ if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+
+ Shell_NotifyIcon(NIM_DELETE, (NOTIFYICONDATA*)&trayIcon);
+
+ peercastInst->saveSettings();
+ peercastInst->quit();
+
+ Gdiplus::GdiplusShutdown(gdiplusToken);
+
+ return msg.wParam;
+#endif
+ WinMainDummy(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
+
+ } __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ fs.openWriteReplace(".\\dump.html");
+ sys->logBuf->dumpHTML(fs);
+ fs.close();
+
+ MessageBox(NULL, "\88ê\94Ê\95Û\8cì\88á\94½\82Ì\88×\81A\83v\83\8d\83O\83\89\83\80\82Í\8b\90§\8fI\97¹\82³\82ê\82Ü\82·\81B\n"
+ "\96â\91è\89ð\8c\88\82Ì\82½\82ß\82É\83_\83\93\83v\83f\81[\83^(dump.html)\82ð\92ñ\8b\9f\82µ\82Ä\82\82¾\82³\82¢\81B", "SEH",
+ MB_OK|MB_ICONWARNING);
+
+ return GetExceptionCode();
+ }
+
+ // dummy
+ return 0;
+}
+
+
//
// FUNCTION: MyRegisterClass()
CheckMenuItem(trayMenu, ID_POPUP_START_WITH_GUI, MF_UNCHECKED|MF_BYCOMMAND);
}
+ // \83X\83N\83\8a\81[\83\93\83Z\81[\83o\81[\97}\8e~
+ if (servMgr->preventSS)
+ {
+ CheckMenuItem(trayMenu, ID_POPUP_PREVENT_SS, MF_CHECKED|MF_BYCOMMAND);
+ } else
+ {
+ CheckMenuItem(trayMenu, ID_POPUP_PREVENT_SS, MF_UNCHECKED|MF_BYCOMMAND);
+ }
+
SetForegroundWindow(hWnd);
bool skipMenu=false;
}
break;
+ case ID_POPUP_PREVENT_SS:
+ // \83X\83N\83\8a\81[\83\93\83Z\81[\83o\81[\97}\8e~
+ if (servMgr->preventSS)
+ {
+ servMgr->preventSS = false;
+ CheckMenuItem(trayMenu, ID_POPUP_PREVENT_SS, MF_UNCHECKED|MF_BYCOMMAND);
+ } else
+ {
+ servMgr->preventSS = true;
+ CheckMenuItem(trayMenu, ID_POPUP_PREVENT_SS, MF_CHECKED|MF_BYCOMMAND);
+ }
+ peercastInst->saveSettings();
+ break;
+
case ID_POPUP_EXIT_CONFIRM:
case IDM_EXIT:
DestroyWindow(hWnd);
case WM_DESTROY:
PostQuitMessage(0);
break;
+
+ case WM_SYSCOMMAND:
+ // \82È\82ñ\82©\83A\83N\83e\83B\83u\82¶\82á\82È\82¢\82Æ\91\97\82ç\82ê\82Ä\82±\82È\82¢\82ç\82µ\82¢
+ if (servMgr->preventSS && (wParam == SC_SCREENSAVE) && chanMgr->isBroadcasting())
+ return 1;
+ else
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ break;
+
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
MENUITEM "\8dÄ\90Ú\91±\8e\9e\89º\97¬\88Û\8e\9d", ID_POPUP_SHOWGUI, CHECKED
MENUITEM "\8fí\82É\8eè\91O\82É\95\\8e¦", ID_POPUP_TOPMOST
MENUITEM "\8bN\93®\8e\9e\81AGUI\82ð\95\\8e¦", ID_POPUP_START_WITH_GUI
+ MENUITEM "\94z\90M\8e\9e\81AScreenSaver\82ð\97}\8e~", ID_POPUP_PREVENT_SS, GRAYED
END
MENUITEM SEPARATOR
POPUP "\8fI\97¹"
AdditionalIncludeDirectories="../../../core,../../../core/common"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
+ ExceptionHandling="1"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/Simple.pch"
#define ID_POPUP_START_WITH_GUI 32830
#define ID_POPUP_32831 32831
#define ID_POPUP_TRAFFIC 32832
+#define ID_32833 32833
+#define ID_POPUP_PREVENT_SS 32834
#define IDC_STATIC -1
// Next default values for new objects
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 144
-#define _APS_NEXT_COMMAND_VALUE 32833
+#define _APS_NEXT_COMMAND_VALUE 32835
#define _APS_NEXT_CONTROL_VALUE 1025
#define _APS_NEXT_SYMED_VALUE 110
#endif