1 // ------------------------------------------------
6 // Windows front end GUI, PeerCast core is not dependant on any of this.
7 // Its very messy at the moment, but then again Windows UI always is.
8 // I really don`t like programming win32 UI.. I want my borland back..
10 // (c) 2002 peercast.org
11 // ------------------------------------------------
12 // This program is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation; either version 2 of the License, or
15 // (at your option) any later version.
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 // ------------------------------------------------
23 #define _WIN32_WINNT 0x0500
31 #include "win32/wsys.h"
33 #include "win32/wsocket.h"
46 #include "chkMemoryLeak.h"
47 #define DEBUG_NEW new(__FILE__, __LINE__)
52 bool shownChannels=false;
53 WINDOWPLACEMENT winPlace;
56 using namespace Gdiplus;
60 void APICALL MyPeercastApp ::printLog(LogBuffer::TYPE t, const char *str)
62 /* ADDLOG(str,logID,true,NULL,t);
65 logFile.writeLine(str);
70 void APICALL MyPeercastApp::updateSettings()
75 Gdiplus::Bitmap bmpBack(800,600,PixelFormat24bppRGB);
79 Gdiplus::Image *backImage;
80 Gdiplus::Bitmap *backBmp;
81 Gdiplus::Graphics *backGra;
83 Gdiplus::Image *img_idle;
84 Gdiplus::Image *img_connect;
85 Gdiplus::Image *img_conn_ok;
86 Gdiplus::Image *img_conn_full;
87 Gdiplus::Image *img_conn_over;
88 Gdiplus::Image *img_conn_ok_skip;
89 Gdiplus::Image *img_conn_full_skip;
90 Gdiplus::Image *img_conn_over_skip;
91 Gdiplus::Image *img_error;
92 Gdiplus::Image *img_broad_ok;
93 Gdiplus::Image *img_broad_full;
99 extern HINSTANCE hInst;
104 WLock ChannelDataLock;
106 ChannelData *channelDataTop = NULL;
108 extern bool gbGetFile;
110 extern time_t gtGetFile;
111 extern time_t gtStartTime;
113 ThreadInfo gtiGetFile;
114 static char *data1URL = "http://www.idolmaster.jp/download/images/wallpaper/imas360p_800.jpg";
115 static char *data2URL = "http://www.xbox.com/NR/rdonlyres/CAB05E2F-3051-409B-A4C8-830167C1C138/0/wpr0701idolmasterw120001.jpg";
118 bool gbDispTop = false;
119 bool gbAllOpen = false;
121 THREAD_PROC FestivalStart(ThreadInfo *thread);
123 THREAD_PROC GetHostName(ThreadInfo *thread){
124 IdData *id = (IdData*)(thread->data);
130 ChannelDataLock.on();
131 ip = htonl(id->getIpAddr());
133 for (int i=0; i<5 && flg; i++){
134 he = gethostbyaddr((char *)&ip,sizeof(ip),AF_INET);
136 ChannelData* cd = channelDataTop;
140 if (cd->setName(id->getServentId(), he->h_name)){
144 cd = cd->getNextData();
148 ChannelDataLock.off();
156 bool DownloadFile(LPCTSTR URL, LPCTSTR local){
157 char header[] = "Accept: */*\r\n\r\n";
165 f.openWriteReplace(local);
166 }catch(StreamException &e){
170 hInternet = ::InternetOpen(NULL, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
171 if (hInternet == NULL){
175 hConnect = ::InternetOpenUrl(hInternet, URL, header, strlen(header), INTERNET_FLAG_DONT_CACHE, 0);
176 if (hConnect == NULL){
177 ::InternetCloseHandle(hInternet);
184 BOOL ret = ::InternetReadFile(hConnect, buf, 4096, &dwReadSize);
186 if (dwReadSize == 0){
190 f.write(buf, dwReadSize);
192 } catch(StreamException e){
195 ::InternetCloseHandle(hConnect);
196 ::InternetCloseHandle(hInternet);
203 ::InternetCloseHandle(hConnect);
204 ::InternetCloseHandle(hInternet);
209 THREAD_PROC GetInternetFile(ThreadInfo *thread){
211 DownloadFile(data1URL, "data1.jpg");
212 DownloadFile(data2URL, "data2.jpg");
216 extern TCHAR szWindowClass3[]; // The title bar text
219 int drawSpeed(Graphics *gra, int posX, int posY){
221 //
\91¬
\93x
\95\
\8e¦
\95\94\82Ì
\94w
\8ci
\82ð
\94\92\82
\82·
\82é
222 SolidBrush b(Color(180,255,255,255));
223 backGra->FillRectangle(&b, posX, posY, 200, 14);
224 //
\83t
\83H
\83\93\83g
\90Ý
\92è
225 Font font(L"
\82l
\82r
\82o
\83S
\83V
\83b
\83N",10);
227 SolidBrush strBrush(Color::Black);
228 //
\95¶
\8e\9a\97ñ
\8dì
\90¬
230 sprintf(tmp, "R:%.1fkbps S:%.1fkbps",
231 BYTES_TO_KBPS(stats.getPerSecond(Stats::BYTESIN)-stats.getPerSecond(Stats::LOCALBYTESIN)),
232 BYTES_TO_KBPS(stats.getPerSecond(Stats::BYTESOUT)-stats.getPerSecond(Stats::LOCALBYTESOUT)));
234 //
\95¶
\8e\9a\95\
\8e¦
\94Í
\88Í
\8ew
\92è
236 format.SetAlignment(StringAlignmentCenter);
237 RectF r((REAL)posX, (REAL)posY, (REAL)200, (REAL)14);
238 //
\95¶
\8e\9a\95`
\89æ
239 gra->DrawString(bstr, -1, &font, r, &format, &strBrush);
246 void MakeBack(HWND hwnd, UINT x, UINT y){
257 backBmp = ::new Bitmap(x,y);
258 backGra = ::new Graphics(backBmp);
260 //
\91S
\82Ä
\94\92\82Å
\93h
\82è
\82Â
\82Ô
\82µ
261 SolidBrush b(Color(255,255,255,255));
262 backGra->FillRectangle(&b, 0, 0, x, y);
264 backWidth = backImage->GetWidth();
265 backHeight = backImage->GetHeight();
267 //
\94w
\8ci
\89æ
\91\9c\82ð
\95`
\89æ
268 for (UINT xx = 0; xx < x/backWidth + 1; xx++){
269 for (UINT yy = 0; yy < y/backHeight + 1; yy++){
271 if (backWidth*(xx+1) > x){
272 width = x % backWidth;
276 if (backHeight*(yy+1) > y){
277 height = y % backHeight;
281 Rect r((INT)backWidth*xx, (INT)backHeight*yy, width, height);
282 backGra->DrawImage(backImage, r, 0, 0, (INT)width, (INT)height, UnitPixel);
290 drawSpeed(backGra, winWidth-205, 5);
292 //
\83`
\83\83\83\93\83l
\83\8b\8fî
\95ñ
\82ð
\95`
\89æ
293 ChannelDataLock.on();
294 ChannelData *cd = channelDataTop;
296 posY = cd->drawChannel(backGra, 20, posY);
297 cd = cd->getNextData();
299 ChannelDataLock.off();
303 void MakeBack(HWND hwnd){
304 MakeBack(hwnd, winWidth, winHeight);
305 ::InvalidateRect(guiWnd, NULL, FALSE);
308 void ChannelData::setData(Channel *c){
311 sjis.convertTo(String::T_SJIS);
313 strncpy(name, sjis, 256);
315 channel_id = c->channel_id;
316 bitRate = c->info.bitrate;
317 lastPlayStart = c->info.lastPlayStart;
319 totalListeners = c->totalListeners();
320 totalRelays = c->totalRelays();
321 localListeners = c->localListeners();
322 localRelays = c->localRelays();
323 stayConnected = c->stayConnected;
325 bTracker = c->sourceHost.tracker;
326 lastSkipTime = c->lastSkipTime;
327 skipCount = c->skipCount;
333 int ChannelData::drawChannel(Graphics *g, int x, int y){
338 //
\88Ê
\92u
\82ð
\95Û
\91¶
344 if (getWidth() == 0){
355 //
\83`
\83\83\83\93\83l
\83\8b\95\
\8e¦
\95\94\82Ì
\94w
\8ci
\82ð
\93h
\82é
358 SolidBrush b(Color(160,49,106,197));
359 g->FillRectangle(&b, x, y, w, 14);
362 SolidBrush b(Color(160,255,255,255));
363 g->FillRectangle(&b, x, y, w, 14);
366 //
\83X
\83e
\81[
\83^
\83X
\95\
\8e¦
367 Gdiplus::Image *img = NULL;
368 unsigned int nowTime = sys->getTime();
369 switch(this->getStatus()){
370 case Channel::S_IDLE:
373 case Channel::S_SEARCHING:
374 case Channel::S_CONNECTING:
377 case Channel::S_RECEIVING:
378 if ((skipCount > 2) && (lastSkipTime + 120 > nowTime)){
380 img = img_conn_ok_skip;
382 if (chDisp.numRelays){
383 img = img_conn_full_skip;
385 img = img_conn_over_skip;
392 if (chDisp.numRelays){
400 case Channel::S_BROADCASTING:
403 case Channel::S_ERROR:
411 PointF origin(xx, yy);
412 //
\83X
\83e
\81[
\83^
\83X
\95\
\8e¦
\88Ê
\92u
413 Rect img_rect((INT)origin.X, (INT)origin.Y + 1, img ? img->GetWidth() : 12, 12);
414 //
\83X
\83e
\81[
\83^
\83X
\95`
\89æ
416 // att.SetColorKey(Color::White, Color::White, ColorAdjustTypeBitmap);
417 g->DrawImage(img, img_rect, 0, 0, img_rect.Width, 12, UnitPixel, &att);
418 //
\8e\9f\82Ì
\8aî
\93_
419 origin.X += img_rect.Width;
421 //
\83t
\83H
\83\93\83g
\90Ý
\92è
422 Gdiplus::Font font(L"
\82l
\82r
\82o
\83S
\83V
\83b
\83N",10);
424 SolidBrush *strBrush;
425 if (servMgr->getFirewall() == ServMgr::FW_ON){
426 strBrush = ::new SolidBrush(Color::Red);
427 } else if (isTracker() && (getStatus() == Channel::S_RECEIVING)){
428 strBrush = ::new SolidBrush(Color::Green);
432 strBrush = ::new SolidBrush(Color::White);
435 strBrush = ::new SolidBrush(Color::Black);
438 //
\83`
\83\83\83\93\83l
\83\8b\96¼
\95\
\8e¦
439 g->SetTextRenderingHint(TextRenderingHintAntiAlias);
440 _bstr_t bstr1(getName());
441 //
\95¶
\8e\9a\95`
\89æ
\94Í
\88Í
\8ew
\92è
442 RectF r1(origin.X, origin.Y, 120.0f, 13.0f);
444 format.SetAlignment(StringAlignmentNear);
445 g->DrawString(bstr1, -1, &font, r1, &format, strBrush);
446 //
\8e\9f\82Ì
\8aî
\93_
447 origin.X += r1.Width;
449 //
\83\8a\83X
\83i
\81[
\90\94/
\83\8a\83\8c\81[
\90\94\95\
\8e¦
451 sprintf(tmp, "%d/%d - [%d/%d]", getTotalListeners(), getTotalRelays(), getLocalListeners(), getLocalRelays());
453 //
\95¶
\8e\9a\95\
\8e¦
\94Í
\88Í
\8ew
\92è
454 RectF r2(origin.X, origin.Y, 100.0f, 13.0f);
455 format.SetAlignment(StringAlignmentCenter);
456 g->DrawString(bstr2, -1, &font, r2, &format, strBrush);
457 //
\8e\9f\82Ì
\8aî
\93_
458 origin.X += r2.Width;
462 if (isStayConnected()){
463 f = ::new Font(L"Arial", 9.0f, FontStyleItalic|FontStyleBold, UnitPoint);
465 f = ::new Font(L"Arial", 9.0f);
467 sprintf(tmp, "%dkbps", getBitRate());
469 format.SetAlignment(StringAlignmentFar);
470 //
\95¶
\8e\9a\95\
\8e¦
\94Í
\88Í
\8ew
\92è
471 RectF r3(origin.X, origin.Y, 80.0f, 13.0f);
472 g->DrawString(bstr3, -1, f, r3, &format, strBrush);
473 //
\83t
\83H
\83\93\83g
\8aJ
\95ú
476 //
\8e\9f\82Ì
\8aî
\93_
477 origin.X += r3.Width;
479 //
\83u
\83\89\83V
\8dí
\8f\9c
485 int count = getServentCount();
486 // Servent
\95\
\8e¦
\95\94\82Ì
\94w
\8ci
\82ð
\94\92\82É
\82·
\82é
487 SolidBrush b(Color(160,255,255,255));
488 g->FillRectangle(&b, (INT)origin.X, (INT)origin.Y, 14*count, 14);
493 SolidBrush *serventBrush;
494 if (sd->getInfoFlg()){
495 ChanHit *hit = sd->getChanHit();
496 if (hit->firewalled){
497 SolidBrush bb(Color(180,255,0,0));
498 g->FillRectangle(&bb, (INT)origin.X + 14*index, (INT)origin.Y, 14, 14);
501 //
\83\8a\83\8c\81[
\82n
\82j
502 serventBrush = ::new SolidBrush(Color::Green);
504 //
\83\8a\83\8c\81[
\95s
\89Â
506 //
\83\8a\83\8c\81[
\88ê
\94t
507 serventBrush = ::new SolidBrush(Color::Blue);
509 //
\83\8a\83\8c\81[
\82È
\82µ
510 serventBrush = ::new SolidBrush(Color::Purple);
515 serventBrush = ::new SolidBrush(Color::Black);
518 backGra->FillRectangle(serventBrush, (INT)origin.X + index*14 + 1, (INT)origin.Y + 1, 12, 12);
520 ::delete serventBrush;
521 sd = sd->getNextData();
526 //
\8e\9f\82Ì
\8aî
\93_
529 //
\83T
\83C
\83Y
\82ð
\95Û
\91¶
530 setWidth((int)origin.X - posX);
531 setHeight((int)origin.Y - posY);
533 // ServentData
\95\
\8e¦
536 if (openFlg || sd->getSelected()){
537 sd->drawServent(g, (INT)x+12, (INT)origin.Y);
538 //
\8e\9f\82Ì
\8aî
\93_
541 sd = sd->getNextData();
545 return (int)(origin.Y);
548 bool ChannelData::checkDown(int x,int y){
549 //
\94Í
\88Í
\93à
\83`
\83F
\83b
\83N
552 && (x < posX + getWidth())
554 && (y < posY + getHeight())
561 ServentData *ChannelData::findServentData(int servent_id){
562 ServentData *sv = serventDataTop;
564 if (sv->getServentId() == servent_id){
567 sv = sv->getNextData();
572 void ChannelData::addServentData(ServentData *sd){
573 sd->setNextData(serventDataTop);
577 void ChannelData::deleteDisableServents(){
578 ServentData *sd = serventDataTop;
579 ServentData *prev = NULL;
582 if (!(sd->getEnableFlg())){
583 ServentData *next = sd->getNextData();
585 prev->setNextData(next);
587 serventDataTop = next;
593 sd = sd->getNextData();
598 int ChannelData::getServentCount(){
601 ServentData *sd = serventDataTop;
604 sd = sd->getNextData();
609 bool ChannelData::setName(int servent_id, String name){
610 ServentData *sd = serventDataTop;
612 if (sd->getServentId() == servent_id){
616 sd = sd->getNextData();
621 void ServentData::setData(Servent *s, ChanHit *hit, unsigned int listeners, unsigned int relays, bool f){
622 servent_id = s->servent_id;
625 lastSkipTime = s->lastSkipTime;
628 chanHit.numRelays = hit->numRelays;
629 chanHit.relay = hit->relay;
630 chanHit.firewalled = hit->firewalled;
631 chanHit.version = hit->version;
632 chanHit.version_vp = hit->version_vp;
633 chanHit.version_ex_number = hit->version_ex_number;
634 chanHit.version_ex_prefix[0] = hit->version_ex_prefix[0];
635 chanHit.version_ex_prefix[1] = hit->version_ex_prefix[1];
637 totalListeners = listeners;
638 totalRelays = relays;
643 int ServentData::drawServent(Gdiplus::Graphics *g, int x, int y){
648 //
\88Ê
\92u
\82ð
\95Û
\91¶
652 if (getWidth() == 0){
664 PointF origin(xx, yy);
666 //
\83t
\83H
\83\93\83g
\90Ý
\92è
667 Font font(L"
\82l
\82r
\82o
\83S
\83V
\83b
\83N",9);
669 SolidBrush *strBrush;
670 if (chanHit.firewalled){
671 strBrush = ::new SolidBrush(Color::Red);
675 strBrush = ::new SolidBrush(Color::White);
678 strBrush = ::new SolidBrush(Color::Black);
681 // ServantData
\95\
\8e¦
682 g->SetTextRenderingHint(TextRenderingHintAntiAlias);
683 //
\95¶
\8e\9a\97ñ
\8dì
\90¬
689 if (chanHit.version_ex_number){
690 //
\8ag
\92£
\83o
\81[
\83W
\83\87\83\93
691 sprintf(tmp, "%c%c%04d - %d/%d - %s(%s)",
692 chanHit.version_ex_prefix[0],
693 chanHit.version_ex_prefix[1],
694 chanHit.version_ex_number,
700 } else if (chanHit.version_vp){
701 sprintf(tmp, "VP%04d - %d/%d - %s(%s)",
709 sprintf(tmp, "(-----) - %d/%d - %s(%s)",
717 sprintf(tmp, "(-----) - %d/%d - %s(%s)",
726 //
\83X
\83e
\81[
\83^
\83X
\95\
\8e¦
727 Gdiplus::Image *img = NULL;
728 unsigned int nowTime = sys->getTime();
730 case Servent::S_CONNECTING:
733 case Servent::S_CONNECTED:
734 if (lastSkipTime + 120 > nowTime){
736 img = img_conn_ok_skip;
738 if (chanHit.numRelays){
739 img = img_conn_full_skip;
741 img = img_conn_over_skip;
748 if (chanHit.numRelays){
760 //
\95¶
\8e\9a\95`
\89æ
\94Í
\88Í
\8ew
\92è
761 RectF r1(origin.X + img->GetWidth() + 2, origin.Y, 800.0f, 13.0f);
764 format.SetAlignment(StringAlignmentNear);
765 g->MeasureString(bstr1, -1, &font, r1, &format, &r2);
767 w = (INT)r2.Width + img->GetWidth() + 2;
768 // ServentData
\95\
\8e¦
\95\94\82Ì
\94w
\8ci
\82ð
\93h
\82é
771 SolidBrush b(Color(160,49,106,197));
772 g->FillRectangle(&b, x, y, w, 13);
775 SolidBrush b(Color(160,200,200,200));
776 g->FillRectangle(&b, x, y, w, 13);
779 //
\83X
\83e
\81[
\83^
\83X
\95\
\8e¦
\88Ê
\92u
780 Rect img_rect((INT)origin.X, (INT)origin.Y+1, img ? img->GetWidth() : 12, 12);
781 //
\83X
\83e
\81[
\83^
\83X
\95`
\89æ
783 // att.SetColorKey(Color::White, Color::White, ColorAdjustTypeBitmap);
784 g->DrawImage(img, img_rect, 0, 0, img_rect.Width, 12, UnitPixel, &att);
785 //
\8e\9f\82Ì
\8aî
\93_
788 g->DrawString(bstr1, -1, &font, r2, &format, strBrush);
789 //
\8e\9f\82Ì
\8aî
\93_
790 origin.X += r2.Width;
793 setWidth((int)origin.X-posX);
794 setHeight((int)origin.Y - posY);
800 bool ServentData::checkDown(int x, int y){
803 && (x < posX + getWidth())
805 && (y < posY + getHeight())
813 THREAD_PROC GUIDataUpdate(ThreadInfo *thread){
816 // set GUI thread status to running
817 thread->finish = false;
819 while(thread->active){
820 //
\83`
\83\83\83\93\83l
\83\8b\83f
\81[
\83^
\83\8d\83b
\83N
821 ChannelDataLock.on();
822 //
\83`
\83\83\83\93\83l
\83\8b\83f
\81[
\83^
\82Ì
\8dX
\90V
\83t
\83\89\83O
\82ð
\91S
\82ÄFALSE
\82É
\82·
\82é
823 ChannelData *cd = channelDataTop;
825 // Servent
\82Ì
\8dX
\90V
\83t
\83\89\83O
\82ðFALSE
\82É
\82·
\82é
826 ServentData *sv = cd->getServentDataTop();
828 sv->setEnableFlg(FALSE);
829 sv = sv->getNextData();
831 cd->setEnableFlg(FALSE);
832 cd = cd->getNextData();
835 Channel *c = chanMgr->channel;
836 //
\8c»
\8dÝ
\91¶
\8dÝ
\82·
\82é
\83`
\83\83\83\93\83l
\83\8b\95ª
\83\8b\81[
\83v
838 //
\8aù
\82É
\83`
\83\83\83\93\83l
\83\8b\83f
\81[
\83^
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82é
\82©
840 //
\94
\8c©
\83t
\83\89\83OFALSE
841 bool bFoundFlg = FALSE;
843 if (cd->getChannelId() == c->channel_id){
844 //
\8aù
\82É
\83`
\83\83\83\93\83l
\83\8b\83f
\81[
\83^
\82ª
\82 \82é
\82Ì
\82Å
\81A
\82»
\82Ì
\82Ü
\82Ü
\8dX
\90V
846 //
\8dX
\90V
\83t
\83\89\83OTRUE
847 cd->setEnableFlg(TRUE);
848 //
\94
\8c©
\83t
\83\89\83OTRUE
850 //
\83\8b\81[
\83v
\97£
\92E
853 //
\8c©
\82Â
\82©
\82ç
\82È
\82©
\82Á
\82½
\8fê
\8d\87\81A
\8e\9f\82Ì
\83f
\81[
\83^
\82ð
\83`
\83F
\83b
\83N
854 cd = cd->getNextData();
857 //
\90V
\82µ
\82¢
\83`
\83\83\83\93\83l
\83\8b\82Ì
\8fê
\8d\87\81A
\90V
\8bK
\83f
\81[
\83^
\8dì
\90¬
859 //
\90V
\8bK
\83f
\81[
\83^
\8dì
\90¬
860 cd = ::new ChannelData();
861 //
\83f
\81[
\83^
\8dX
\90V
863 //
\8dX
\90V
\83t
\83\89\83OTRUE
864 cd->setEnableFlg(TRUE);
866 //
\90V
\8bK
\83f
\81[
\83^
\82ð
\83\8a\83X
\83g
\82Ì
\90æ
\93ª
\82É
\93ü
\82ê
\82é
867 cd->setNextData(channelDataTop);
870 //
\8e\9f\82Ì
\83`
\83\83\83\93\83l
\83\8b\82ð
\8eæ
\93¾
874 //
\83`
\83\83\83\93\83l
\83\8b\82ª
\82È
\82
\82È
\82Á
\82Ä
\82¢
\82é
\8fê
\8d\87\82Ì
\8f\88\97\9d
876 ChannelData *prev = NULL;
878 //
\83f
\81[
\83^
\82ð
\8dX
\90V
\82µ
\82È
\82©
\82Á
\82½
\82©
879 if (cd->getEnableFlg() == FALSE){
880 //
\83`
\83\83\83\93\83l
\83\8b\82ª
\82È
\82
\82È
\82Á
\82Ä
\82¢
\82é
\82Ì
\82Å
\8dí
\8f\9c
882 next = cd->getNextData();
884 //
\90æ
\93ª
\82Ì
\83f
\81[
\83^
\82ð
\8dí
\8f\9c
885 channelDataTop = next;
887 //
\93r
\92\86\82Ì
\83f
\81[
\83^
\82ð
\8dí
\8f\9c
888 prev->setNextData(next);
890 //
\8e\9f\82Ì
\83f
\81[
\83^
\82Ö
893 //
\83f
\81[
\83^
\8dX
\90V
\8dÏ
\81F
\8e\9f\82Ì
\83f
\81[
\83^
\82Ö
895 cd = cd->getNextData();
899 Servent *s = servMgr->servents;
903 bool infoFlg = false;
905 bool firewalled = false;
906 unsigned int numRelays = 0;
908 char ver_ex_prefix[2] = {' ',' '};
909 int ver_ex_number = 0;
910 //
\92¼
\89º
\83z
\83X
\83g
\8fî
\95ñ
\83`
\83F
\83b
\83N
911 unsigned int totalRelays = 0;
912 unsigned int totalListeners = 0;
915 //
\8eó
\90M
\92\86\82©
916 if ((s->type == Servent::T_RELAY) && (s->status == Servent::S_CONNECTED)){
917 //
\83z
\83X
\83g
\8fî
\95ñ
\83\8d\83b
\83N
918 chanMgr->hitlistlock.on();
919 //
\92¼
\89º
\83z
\83X
\83g
\82ª
\8eó
\90M
\82µ
\82Ä
\82¢
\82é
\83`
\83\83\83\93\83l
\83\8b\82Ì
\83z
\83X
\83g
\8fî
\95ñ
\82ð
\8eæ
\93¾
920 chl = chanMgr->findHitListByID(s->chanID);
921 //
\83`
\83\83\83\93\83l
\83\8b\82Ì
\83z
\83X
\83g
\8fî
\95ñ
\82ª
\82 \82é
\82©
923 //
\83`
\83\83\83\93\83l
\83\8b\82Ì
\83z
\83X
\83g
\8fî
\95ñ
\82ª
\82 \82é
\8fê
\8d\87
924 ChanHit *hit = chl->hit;
925 //
\81@
\83`
\83\83\83\93\83l
\83\8b\82Ì
\83z
\83X
\83g
\8fî
\95ñ
\82ð
\91S
\91\96\8d¸
\82µ
\82Ä
927 // ID
\82ª
\93¯
\82¶
\82à
\82Ì
\82Å
\82 \82ê
\82Î
928 if (hit->servent_id == s->servent_id){
929 //
\83g
\81[
\83^
\83\8b\83\8a\83\8c\81[
\82Æ
\83g
\81[
\83^
\83\8b\83\8a\83X
\83i
\81[
\82ð
\89Á
\8eZ
930 totalRelays += hit->numRelays;
931 totalListeners += hit->numListeners;
932 //
\92¼
\89º
\82Å
\82 \82ê
\82Î
933 if (hit->numHops == 1){
934 //
\8fî
\95ñ
\82ð
\88ê
\92U
\95Û
\91¶
936 hitData.relay = hit->relay;
937 hitData.firewalled = hit->firewalled;
938 hitData.numRelays = hit->numRelays;
939 hitData.version_vp = hit->version_vp;
940 hitData.version_ex_prefix[0] = hit->version_ex_prefix[0];
941 hitData.version_ex_prefix[1] = hit->version_ex_prefix[1];
942 hitData.version_ex_number = hit->version_ex_number;
945 //
\8e\9f\82ð
\83`
\83F
\83b
\83N
950 //
\83`
\83\83\83\93\83l
\83\8b\83f
\81[
\83^
\82©
\82çServent
\82ð
\8c\9f\8dõ
951 bool bFoundFlg = FALSE;
954 ServentData *sv = cd->findServentData(s->servent_id);
955 // ServentData
\82ª
\82 \82ê
\82Î
957 //
\83f
\81[
\83^
\90Ý
\92è
958 sv->setData(s, &hitData, totalListeners, totalRelays, infoFlg);
959 sv->setEnableFlg(TRUE);
963 cd = cd->getNextData();
965 // ServentData
\82ª
\8c©
\82Â
\82©
\82ç
\82È
\82©
\82Á
\82½
\8fê
\8d\87
967 //
\83`
\83\83\83\93\83l
\83\8b\83f
\81[
\83^
\82ð
\92T
\82·
970 //
\83`
\83\83\83\93\83l
\83\8bID
\82ª
\93¯
\82¶
\82©
971 if (cd->getChannelId() == s->channel_id){
972 //
\83f
\81[
\83^
\90Ý
\92è
973 ServentData *sv = ::new ServentData();
974 sv->setData(s, &hitData, totalListeners, totalRelays, infoFlg);
975 sv->setEnableFlg(TRUE);
976 //
\83`
\83\83\83\93\83l
\83\8b\83f
\81[
\83^
\82ÉServentData
\92Ç
\89Á
977 cd->addServentData(sv);
978 //
\83z
\83X
\83g
\96¼
\82ð
\8eæ
\93¾
\82·
\82é
979 IdData *id = ::new IdData(cd->getChannelId(), sv->getServentId(), sv->getHost().ip);
981 t.func = GetHostName;
983 sys->startThread(&t);
984 //
\83\8b\81[
\83v
\8fI
\97¹
987 //
\8e\9f\82Ì
\83f
\81[
\83^
\82Ö
988 cd = cd->getNextData();
991 //
\83z
\83X
\83g
\8fî
\95ñ
\83A
\83\93\83\8d\83b
\83N
992 chanMgr->hitlistlock.off();
997 //
\8dX
\90V
\82µ
\82Ä
\82¢
\82È
\82¢ServentData
\82ð
\8dí
\8f\9c
1000 cd->deleteDisableServents();
1001 cd = cd->getNextData();
1004 //
\83`
\83\83\83\93\83l
\83\8b\83f
\81[
\83^
\83A
\83\93\83\8d\83b
\83N
1005 ChannelDataLock.off();
1012 // 0.1
\95b
\81~10
\82Å1
\95b
\91Ò
\82¿
1015 if (!thread->active)
1020 if (gbGetFile && (sys->getTime() > gtGetFile)){
1022 gtiGetFile.func = GetInternetFile;
1023 gtiGetFile.data = NULL;
1024 sys->startThread(>iGetFile);
1026 else if (gbStart && (sys->getTime() > gtStartTime)){
1028 SendMessage(guiWnd, WM_START, 0, 0);
1029 gtiStart.func = FestivalStart;
1030 gtiStart.data = NULL;
1031 sys->startThread(>iStart);
1035 // set GUI thread status to terminated
1036 thread->finish = true;
1041 ChannelData *findChannelData(int channel_id){
1042 ChannelData *cd = channelDataTop;
1045 if (cd->getChannelId() == channel_id){
1048 cd = cd->getNextData();
1055 void PopupChannelMenu(int channel_id){
1057 MENUITEMINFO info, separator;
1061 hMenu = CreatePopupMenu();
1063 memset(&separator, 0, sizeof(MENUITEMINFO));
1064 separator.cbSize = sizeof(MENUITEMINFO);
1065 separator.fMask = MIIM_ID | MIIM_TYPE;
1066 separator.fType = MFT_SEPARATOR;
1067 separator.wID = 8000;
1069 memset(&info, 0, sizeof(MENUITEMINFO));
1070 info.cbSize = sizeof(MENUITEMINFO);
1071 info.fMask = MIIM_ID | MIIM_TYPE;
1072 info.fType = MFT_STRING;
1074 ChannelData *cd = findChannelData(channel_id);
1081 info.dwTypeData = "
\90Ø
\92f";
1082 InsertMenuItem(hMenu, -1, true, &info);
1084 InsertMenuItem(hMenu, -1, true, &separator);
1087 info.dwTypeData = "
\8dÄ
\90¶";
1088 InsertMenuItem(hMenu, -1, true, &info);
1090 InsertMenuItem(hMenu, -1, true, &separator);
1093 info.dwTypeData = "
\8dÄ
\90Ú
\91±";
1094 InsertMenuItem(hMenu, -1, true, &info);
1097 info.dwTypeData = "
\83L
\81[
\83v";
1098 InsertMenuItem(hMenu, -1, true, &info);
1100 InsertMenuItem(hMenu, -1, true, &separator);
1102 if (!cd->getOpenFlg()){
1104 info.dwTypeData = "
\92¼
\89º
\95\
\8e¦";
1105 InsertMenuItem(hMenu, -1, true, &info);
1108 info.dwTypeData = "
\92¼
\89º
\89B
\95Á";
1109 InsertMenuItem(hMenu, -1, true, &info);
1113 dwID = TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RETURNCMD, pos.x, pos.y, 0, guiWnd, NULL);
1117 cd = findChannelData(channel_id);
1123 Channel *c = chanMgr->findChannelByChannelID(channel_id);
1130 case 1000: //
\8dÄ
\90¶
1131 chanMgr->playChannel(c->info);
1134 case 1001: //
\90Ø
\92f
1135 c->thread.active = false;
1136 c->thread.finish = true;
1139 case 1002: //
\8dÄ
\90Ú
\91±
1140 //
\92¼
\89º
\82©
\82Â
\8eó
\90M
\92\86\82Å
\82 \82ê
\82Î
\8am
\94F
\83\81\83b
\83Z
\81[
\83W
\95\
\8e¦
1141 if (cd->isTracker() && cd->getStatus() == Channel::S_RECEIVING)
1144 id = MessageBox(guiWnd,
1145 "
\92¼
\89º
\82Å
\82·
\82ª
\8dÄ
\90Ú
\91±
\82µ
\82Ü
\82·
\82©
\81H",
1146 "
\92¼
\89º
\8cx
\8d\90",
1147 MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2);
1155 case 1003: //
\83L
\81[
\83v
1156 if (!c->stayConnected){
1157 c->stayConnected = true;
1159 c->stayConnected = false;
1163 case 1004: //
\92¼
\89º
\95\
\8e¦
1164 cd->setOpenFlg(TRUE);
1168 case 1005: //
\92¼
\89º
\89B
\95Á
1169 cd->setOpenFlg(FALSE);
1175 void PopupServentMenu(int servent_id){
1177 MENUITEMINFO info, separator;
1181 hMenu = CreatePopupMenu();
1183 memset(&separator, 0, sizeof(MENUITEMINFO));
1184 separator.cbSize = sizeof(MENUITEMINFO);
1185 separator.fMask = MIIM_ID | MIIM_TYPE;
1186 separator.fType = MFT_SEPARATOR;
1187 separator.wID = 8000;
1189 memset(&info, 0, sizeof(MENUITEMINFO));
1190 info.cbSize = sizeof(MENUITEMINFO);
1191 info.fMask = MIIM_ID | MIIM_TYPE;
1192 info.fType = MFT_STRING;
1194 ServentData *sd = NULL;
1195 ChannelData *cd = channelDataTop;
1197 sd = cd->findServentData(servent_id);
1201 cd = cd->getNextData();
1204 if (cd == NULL || sd == NULL){
1209 info.dwTypeData = "
\90Ø
\92f";
1210 InsertMenuItem(hMenu, -1, true, &info);
1212 // InsertMenuItem(hMenu, -1, true, &separator);
1215 dwID = TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RETURNCMD, pos.x, pos.y, 0, guiWnd, NULL);
1219 cd = channelDataTop;
1221 sd = cd->findServentData(servent_id);
1225 cd = cd->getNextData();
1228 if (cd == NULL || sd == NULL){
1232 Servent *s = servMgr->findServentByServentID(servent_id);
1239 case 1001: //
\90Ø
\92f
1240 s->thread.active = false;
1246 void PopupOtherMenu(){
1248 MENUITEMINFO info, separator;
1252 hMenu = CreatePopupMenu();
1254 memset(&separator, 0, sizeof(MENUITEMINFO));
1255 separator.cbSize = sizeof(MENUITEMINFO);
1256 separator.fMask = MIIM_ID | MIIM_TYPE;
1257 separator.fType = MFT_SEPARATOR;
1258 separator.wID = 8000;
1260 memset(&info, 0, sizeof(MENUITEMINFO));
1261 info.cbSize = sizeof(MENUITEMINFO);
1262 info.fMask = MIIM_ID | MIIM_TYPE;
1263 info.fType = MFT_STRING;
1267 info.dwTypeData = "
\8dÅ
\91O
\96Ê
\95\
\8e¦";
1268 InsertMenuItem(hMenu, -1, true, &info);
1271 info.dwTypeData = "
\8dÅ
\91O
\96Ê
\89ð
\8f\9c";
1272 InsertMenuItem(hMenu, -1, true, &info);
1275 InsertMenuItem(hMenu, -1, true, &separator);
1279 info.dwTypeData = "
\91S
\92¼
\89º
\93W
\8aJ";
1280 InsertMenuItem(hMenu, -1, true, &info);
1283 info.dwTypeData = "
\91S
\92¼
\89º
\89B
\95Á";
1284 InsertMenuItem(hMenu, -1, true, &info);
1287 InsertMenuItem(hMenu, -1, true, &separator);
1289 if (!servMgr->autoServe){
1291 info.dwTypeData = "
\97L
\8cø";
1292 InsertMenuItem(hMenu, -1, true, &info);
1295 info.dwTypeData = "
\96³
\8cø";
1296 InsertMenuItem(hMenu, -1, true, &info);
1300 dwID = TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RETURNCMD, pos.x, pos.y, 0, guiWnd, NULL);
1304 ChannelData *cd = channelDataTop;
1307 case 1101: //
\8dÅ
\91O
\96Ê
\95\
\8e¦
1309 ::SetWindowPos(guiWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
1312 case 1102: //
\8dÅ
\91O
\96Ê
\89ð
\8f\9c
1314 ::SetWindowPos(guiWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
1317 case 1103: //
\91S
\92¼
\89º
\93W
\8aJ
1320 cd->setOpenFlg(true);
1321 cd = cd->getNextData();
1325 case 1104: //
\91S
\92¼
\89º
\89B
\95Á
1328 cd->setOpenFlg(false);
1329 cd = cd->getNextData();
1333 case 1105: //
\97L
\8cø
1334 servMgr->autoServe = true;
1337 case 1106: //
\96³
\8cø
1338 servMgr->autoServe = false;
1344 void WmCreateProc(HWND hwnd){
1348 _bstr_t bstr("back.jpg");
1349 backImage = ::new Image(bstr);
1351 MakeBack(hwnd, 800, 600);
1353 guiThread.func = GUIDataUpdate;
1354 if (!sys->startThread(&guiThread)){
1355 MessageBox(hwnd,"Unable to start GUI","PeerCast",MB_OK|MB_ICONERROR);
1356 PostMessage(hwnd,WM_DESTROY,0,0);
1359 SetWindowPlacement(hwnd, &winPlace);
1364 ::delete img_connect;
1365 ::delete img_conn_ok;
1366 ::delete img_conn_full;
1367 ::delete img_conn_over;
1368 ::delete img_conn_ok_skip;
1369 ::delete img_conn_full_skip;
1370 ::delete img_conn_over_skip;
1372 ::delete img_broad_ok;
1373 ::delete img_broad_full;
1375 bstr = L"ST_IDLE.bmp";
1376 img_idle = ::new Image(bstr);
1377 bstr = L"ST_CONNECT.bmp";
1378 img_connect = ::new Image(bstr);
1379 bstr = L"ST_CONN_OK.bmp";
1380 img_conn_ok = ::new Image(bstr);
1381 bstr = L"ST_CONN_FULL.bmp";
1382 img_conn_full = ::new Image(bstr);
1383 bstr = L"ST_CONN_OVER.bmp";
1384 img_conn_over = ::new Image(bstr);
1385 bstr = L"ST_CONN_OK_SKIP.bmp";
1386 img_conn_ok_skip = ::new Image(bstr);
1387 bstr = L"ST_CONN_FULL_SKIP.bmp";
1388 img_conn_full_skip = ::new Image(bstr);
1389 bstr = L"ST_CONN_OVER_SKIP.bmp";
1390 img_conn_over_skip = ::new Image(bstr);
1391 bstr = L"ST_ERROR.bmp";
1392 img_error = ::new Image(bstr);
1393 bstr = L"ST_BROAD_OK.bmp";
1394 img_broad_ok = ::new Image(bstr);
1395 bstr = L"ST_BROAD_FULL.bmp";
1396 img_broad_full = ::new Image(bstr);
1399 void WmPaintProc(HWND hwnd){
1405 hdc = BeginPaint(hwnd, &paint);
1406 RECT *rcRect; //
\95`
\89æ
\94Í
\88Í
1407 rcRect = &(paint.rcPaint);
1408 LONG width = rcRect->right - rcRect->left + 1;
1409 LONG height = rcRect->bottom - rcRect->top + 1;
1412 Rect r(rcRect->left, rcRect->top, width, height);
1413 g2.DrawImage(backBmp,r, rcRect->left, rcRect->top, width, height, UnitPixel);
1414 EndPaint(hwnd, &paint);
1419 void WmSizeProc(HWND hwnd, LPARAM lParam){
1420 UINT width = LOWORD(lParam);
1421 UINT height = HIWORD(lParam);
1423 MakeBack(hwnd, width, height);
1427 void WmLButtonDownProc(HWND hwnd, LPARAM lParam){
1429 bool changeFlg = FALSE;
1431 ChannelDataLock.on();
1432 cd = channelDataTop;
1434 int x = LOWORD(lParam);
1435 int y = HIWORD(lParam);
1436 if (cd->checkDown(LOWORD(lParam), HIWORD(lParam))){
1437 if (!(cd->isSelected())){
1440 cd->setSelected(TRUE);
1442 if (cd->isSelected()){
1445 cd->setSelected(FALSE);
1447 int sx = cd->getPosX() + cd->getWidth();
1448 int sy = cd->getPosY();
1450 ServentData *sd = cd->getServentDataTop();
1452 if ( ( (!cd->getOpenFlg())
1453 && (sx + index*14 < x)
1454 && (x < sx + (index+1)*14)
1457 || sd->checkDown(LOWORD(lParam), HIWORD(lParam))
1459 if (!sd->getSelected()){
1462 sd->setSelected(TRUE);
1464 if (sd->getSelected()){
1467 sd->setSelected(FALSE);
1469 sd = sd->getNextData();
1472 cd = cd->getNextData();
1474 ChannelDataLock.off();
1480 void WmLButtonDblclkProc(HWND hwnd, LPARAM lParam){
1482 bool changeFlg = FALSE;
1484 ChannelDataLock.on();
1485 cd = channelDataTop;
1487 int x = LOWORD(lParam);
1488 int y = HIWORD(lParam);
1489 if (cd->checkDown(LOWORD(lParam), HIWORD(lParam))){
1490 if (!(cd->isSelected())){
1493 if (!(cd->getOpenFlg())){
1495 cd->setOpenFlg(TRUE);
1498 cd->setOpenFlg(FALSE);
1500 cd->setSelected(TRUE);
1502 if (cd->isSelected()){
1505 cd->setSelected(FALSE);
1507 /* int sx = cd->getPosX() + cd->getWidth();
1508 int sy = cd->getPosY();
1510 ServentData *sd = cd->getServentDataTop();
1512 if ( ( (!cd->getOpenFlg())
1513 && (sx + index*14 < x)
1514 && (x < sx + (index+1)*14)
1517 || sd->checkDown(LOWORD(lParam), HIWORD(lParam))
1519 if (!sd->getSelected()){
1522 sd->setSelected(TRUE);
1524 if (sd->getSelected()){
1527 sd->setSelected(FALSE);
1529 sd = sd->getNextData();
1532 cd = cd->getNextData();
1534 ChannelDataLock.off();
1540 void WmRButtonDownProc(HWND hwnd, LPARAM lParam){
1542 bool changeFlg = FALSE;
1543 bool channel_selected = FALSE;
1544 bool servent_selected = FALSE;
1548 cd = channelDataTop;
1550 if (cd->checkDown(LOWORD(lParam), HIWORD(lParam))){
1551 if (!(cd->isSelected())){
1554 cd->setSelected(TRUE);
1555 channel_id = cd->getChannelId();
1556 channel_selected = TRUE;
1558 if (cd->isSelected()){
1561 cd->setSelected(FALSE);
1563 ServentData *sd = cd->getServentDataTop();
1565 if (sd->checkDown(LOWORD(lParam), HIWORD(lParam))){
1566 if (!sd->getSelected()){
1569 sd->setSelected(TRUE);
1570 servent_id = sd->getServentId();
1571 servent_selected = TRUE;
1573 if (sd->getSelected()){
1576 sd->setSelected(FALSE);
1578 sd = sd->getNextData();
1580 cd = cd->getNextData();
1586 if (channel_selected){
1587 PopupChannelMenu(channel_id);
1588 } else if (servent_selected){
1589 PopupServentMenu(servent_id);
1595 LRESULT CALLBACK GUIProc (HWND hwnd, UINT message,
1596 WPARAM wParam, LPARAM lParam)
1599 case WM_CREATE: //
\83E
\83B
\83\93\83h
\83E
\8dì
\90¬
1603 case WM_PAINT: //
\95`
\89æ
1607 case WM_SIZE: //
\83T
\83C
\83Y
\95Ï
\8dX
1608 WmSizeProc(hwnd,lParam);
1611 case WM_LBUTTONDOWN: //
\8d¶
\83{
\83^
\83\93\89\9f\82·
1612 WmLButtonDownProc(hwnd,lParam);
1615 case WM_RBUTTONDOWN: //
\89E
\83{
\83^
\83\93\89\9f\82·
1616 WmRButtonDownProc(hwnd,lParam);
1619 case WM_LBUTTONDBLCLK: //
\8d¶
\83_
\83u
\83\8b\83N
\83\8a\83b
\83N
1620 WmLButtonDblclkProc(hwnd,lParam);
1623 case WM_ERASEBKGND: //
\94w
\8ci
\8fÁ
\8b\8e
1624 return TRUE; //
\94w
\8ci
\82Í
\8fÁ
\82³
\82È
\82¢
1628 // ::delete backImage;
1629 // backImage = NULL;
1631 GetWindowPlacement(hwnd, &winPlace);
1633 DestroyWindow( hwnd );
1636 GetWindowPlacement(hwnd, &winPlace);
1638 guiThread.active = false;
1640 // wait until GUI thread terminated,
1641 // and then dispose background image.
1644 if (guiThread.finish)
1656 ghStart = ::CreateWindow(szWindowClass3,
1658 WS_OVERLAPPEDWINDOW & ~(WS_MAXIMIZEBOX),
1667 ::ShowWindow(ghStart, SW_SHOWNORMAL);
1671 return (DefWindowProc(hwnd, message, wParam, lParam));
1677 Gdiplus::Image *data1 = NULL;
1678 Gdiplus::Image *data2 = NULL;
1679 Gdiplus::Bitmap *startBmp = NULL;
1680 Gdiplus::Graphics *startGra = NULL;
1681 WLock MakeStartLock;
1683 LRESULT CALLBACK StartProc (HWND hwnd, UINT message,
1684 WPARAM wParam, LPARAM lParam)
1686 SolidBrush b(Color::Black);
1691 startBmp = ::new Bitmap(400,300);
1692 startGra = ::new Graphics(startBmp);
1693 bstr = L"data1.jpg";
1694 data1 = ::new Image(bstr);
1695 bstr = L"data2.jpg";
1696 data2 = ::new Image(bstr);
1697 //
\8d\95\82Å
\93h
\82è
\82Â
\82Ô
\82µ
1698 startGra->FillRectangle(&b, 0, 0, 400, 300);
1706 hdc = BeginPaint(hwnd, &paint);
1708 rcRect = &(paint.rcPaint);
1709 LONG width = rcRect->right - rcRect->left + 1;
1710 LONG height = rcRect->bottom - rcRect->top + 1;
1713 Rect r(rcRect->left, rcRect->top, width, height);
1714 g2.DrawImage(startBmp, r, rcRect->left, rcRect->top, width, height, UnitPixel);
1715 EndPaint(hwnd, &paint);
1716 MakeStartLock.off();
1722 DestroyWindow(ghStart);
1738 return (DefWindowProc(hwnd, message, wParam, lParam));
1744 THREAD_PROC FestivalStart(ThreadInfo *thread){
1746 while(startGra==NULL){
1753 Font font(L"
\82l
\82r
\82o
\83S
\83V
\83b
\83N",40);
1754 StringFormat format;
1755 format.SetAlignment(StringAlignmentCenter);
1756 startGra->SetTextRenderingHint(TextRenderingHintAntiAlias);
1757 PointF origin(199.0f,49.0f);
1758 RectF rect(0,0,400,100);
1759 LinearGradientBrush b1(rect, Color::LightSkyBlue, Color::White, LinearGradientModeHorizontal);
1760 startGra->DrawString(L"
\91æ
\82Q
\89ñ", -1, &font, origin, &format, &b1);
1762 LinearGradientBrush b2(rect, Color::LightGreen, Color::White, LinearGradientModeHorizontal);
1763 startGra->DrawString(L"
\83A
\83C
\83h
\83\8b\83}
\83X
\83^
\81[", -1, &font, origin, &format, &b2);
1765 LinearGradientBrush b3(rect, Color::LightGoldenrodYellow, Color::White, LinearGradientModeHorizontal);
1766 startGra->DrawString(L"
\83t
\83@
\83\93\8a´
\8eÓ
\8dÕ", -1, &font, origin, &format, &b3);
1767 MakeStartLock.off();
1768 InvalidateRect(ghStart, NULL, FALSE);
1772 startGra->DrawImage(data1, Rect(0,0,80,400), 200,200,66,330, UnitPixel);
1773 MakeStartLock.off();
1774 InvalidateRect(ghStart, NULL, FALSE);
1778 startGra->DrawImage(data1, Rect(80,0,80,400), 266,200,66,330, UnitPixel);
1779 MakeStartLock.off();
1780 InvalidateRect(ghStart, NULL, FALSE);
1784 startGra->DrawImage(data1, Rect(160,0,80,400), 332,200,66,330, UnitPixel);
1785 MakeStartLock.off();
1786 InvalidateRect(ghStart, NULL, FALSE);
1790 startGra->DrawImage(data1, Rect(240,0,80,400), 398,200,66,330, UnitPixel);
1791 MakeStartLock.off();
1792 InvalidateRect(ghStart, NULL, FALSE);
1796 startGra->DrawImage(data1, Rect(320,0,80,400), 464,200,66,330, UnitPixel);
1797 MakeStartLock.off();
1798 InvalidateRect(ghStart, NULL, FALSE);
1802 startGra->DrawImage(data1, Rect(0,0,80,400), 530,200,54,270, UnitPixel);
1803 MakeStartLock.off();
1804 InvalidateRect(ghStart, NULL, FALSE);
1808 startGra->DrawImage(data1, Rect(80,0,80,400), 584,200,54,270, UnitPixel);
1809 MakeStartLock.off();
1810 InvalidateRect(ghStart, NULL, FALSE);
1814 startGra->DrawImage(data1, Rect(160,0,80,400), 638,200,54,270, UnitPixel);
1815 MakeStartLock.off();
1816 InvalidateRect(ghStart, NULL, FALSE);
1820 startGra->DrawImage(data1, Rect(240,0,80,400), 692,200,54,270, UnitPixel);
1821 MakeStartLock.off();
1822 InvalidateRect(ghStart, NULL, FALSE);
1826 startGra->DrawImage(data1, Rect(320,0,80,400), 746,200,54,270, UnitPixel);
1827 MakeStartLock.off();
1828 InvalidateRect(ghStart, NULL, FALSE);
1831 for (int i=1; i<=10; i++){
1833 1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
1834 0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
1835 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
1836 0.0f, 0.0f, 0.0f, 0.1f*i, 0.0f,
1837 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
1838 ImageAttributes att;
1841 att.SetColorMatrix(&mtx, ColorMatrixFlagsDefault, ColorAdjustTypeBitmap);
1842 startGra->DrawImage(data2, Rect(0,0,400,300), 360,130,400,300, UnitPixel, &att);
1843 MakeStartLock.off();
1844 InvalidateRect(ghStart, NULL, FALSE);
1851 INT style = FontStyleBold;
1852 Font font2(L"
\82l
\82r
\82o
\83S
\83V
\83b
\83N",70,style,UnitPoint);
1853 PointF origin2(199.0f,99.0f);
1854 SolidBrush bs(Color::Black);
1855 startGra->DrawString(L"START!", -1, &font2, origin2, &format, &bs);
1856 Font font3(L"
\82l
\82r
\82o
\83S
\83V
\83b
\83N",70,style,UnitPoint);
1857 LinearGradientBrush bx(rect, Color::LightPink, Color::DeepPink, LinearGradientModeHorizontal);
1858 startGra->DrawString(L"START!", -1, &font3, origin2, &format, &bx);
1859 MakeStartLock.off();
1860 InvalidateRect(ghStart, NULL, FALSE);
1863 SendMessage(ghStart, WM_CLOSE, 0, 0);