} 
ListWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam){	switch (uMess){	case WM_INITDIALOG:		SendDlgItemMessage(hwnd,IDC_LISTBOX_PLAYLIST,			LB_SETHORIZONTALEXTENT,(WPARAM)1600,0);		w32g_send_rc(RC_EXT_UPDATE_PLAYLIST, 0);		return FALSE;	case WM_DESTROY:		INISaveListWnd();		break;		/* }EX͂Lv`ĂȂ߂̏ */	case WM_SETCURSOR:		switch(HIWORD(lParam)){		case WM_RBUTTONDOWN:			if(LOWORD(lParam)!=HTCAPTION){	// ^Cgo[ɂȂƂ				POINT point;				int res;				GetCursorPos(&point);				res = TrackPopupMenu(ListWndInfo.hPopupMenu,TPM_TOPALIGN|TPM_LEFTALIGN,					point.x,point.y,0,hwnd,NULL);				return TRUE;			}			break;		default:			break;		}		break;	case WM_CHOOSEFONT_DIAG:		{			char fontName[64];			int fontHeight;			int fontWidth;			strcpy(fontName,ListWndInfo.fontName);			fontHeight = ListWndInfo.fontHeight;			fontWidth = ListWndInfo.fontWidth;			if(DlgChooseFont(hwnd,fontName,&fontHeight,&fontWidth)==0){				ListWndSetFontListBox(fontName,fontWidth,fontHeight);			}		}		break;	case WM_COMMAND:			switch (HIWORD(wParam)) {			case IDCLOSE:				ShowWindow(hwnd, SW_HIDE);				MainWndUpdateListButton();				break;			case LBN_DBLCLK:				SendMessage(hwnd,WM_COMMAND,(WPARAM)IDM_LISTWND_PLAY,0);				return FALSE;			case LBN_SELCHANGE:				{				int idListBox = (int) LOWORD(wParam);				HWND hwndListBox = (HWND) lParam;				int selected, nfiles, cursel;				w32g_get_playlist_index(&selected,&nfiles,&cursel);				SetNumListWnd(cursel,nfiles);				return FALSE;				}			default:				break;			}			switch (LOWORD(wParam)) {			case IDC_BUTTON_CLEAR:				if(MessageBox(hListWnd,"Clear playlist?","Playlist",							  MB_YESNO)==IDYES)					w32g_send_rc(RC_EXT_CLEAR_PLAYLIST, 0);				return FALSE;			case IDC_BUTTON_REFINE:				if(MessageBox(hListWnd,							  "Remove unsupported file types from the playlist?",							  "Playlist",MB_YESNO) == IDYES)					w32g_send_rc(RC_EXT_REFINE_PLAYLIST, 0);				return FALSE;			case IDC_BUTTON_UNIQ:				if(MessageBox(hListWnd,							  "Remove the same files from the playlist and make files of the playlist unique?",							  "Playlist",MB_YESNO)==IDYES)					w32g_send_rc(RC_EXT_UNIQ_PLAYLIST, 0);				return FALSE;			case IDM_LISTWND_REMOVE:				w32g_send_rc(RC_EXT_DELETE_PLAYLIST, 0);				break;			case IDC_BUTTON_DOC: {					int cursel;					w32g_get_playlist_index(NULL, NULL, &cursel);					w32g_send_rc(RC_EXT_OPEN_DOC, cursel);				}				break;			case IDM_LISTWND_PLAY:				{					HWND hListBox = GetDlgItem(hListWnd, IDC_LISTBOX_PLAYLIST);					if(hListBox)						w32g_send_rc(RC_EXT_JUMP_FILE, ListBox_GetCurSel(hListBox));				}				return FALSE;			case IDM_LISTWND_CHOOSEFONT:				{ 					SendMessage(hwnd,WM_CHOOSEFONT_DIAG,0,0);				}				return FALSE;			default:				break;			}			break;			case WM_VKEYTOITEM:				{					UINT vkey = (UINT)LOWORD(wParam);					int nCaretPos = (int)HIWORD(wParam);					switch(vkey){					case VK_SPACE:					case VK_RETURN:						w32g_send_rc(RC_EXT_JUMP_FILE, nCaretPos);						return -2;					case 0x50:	// VK_P						SendMessage(hMainWnd,WM_COMMAND,MAKEWPARAM(IDM_PREV,0),0);						return -2;					case 0x4e:	// VK_N						SendMessage(hMainWnd,WM_COMMAND,MAKEWPARAM(IDM_NEXT,0),0);						return -2;					case 0x45:	// VK_E						SendMessage(hMainWnd,WM_COMMAND,MAKEWPARAM(IDM_STOP,0),0);						return -2;					case 0x53:	// VK_S						SendMessage(hMainWnd,WM_COMMAND,MAKEWPARAM(IDM_PAUSE,0),0);						return -2;					case VK_ESCAPE:						SendMessage(hListWnd,WM_COMMAND,MAKEWPARAM(0,IDCLOSE),0);						return -2;					case 0x51:	// VK_Q						if(MessageBox(hListWnd,"Quit TiMidity?","TiMidity",MB_ICONQUESTION|MB_YESNO)==IDYES)							SendMessage(hMainWnd,WM_CLOSE,0,0);						return -2;					case VK_BACK:						w32g_send_rc(RC_EXT_DELETE_PLAYLIST, -1);						return -2;					case 0x44:	// VK_D						w32g_send_rc(RC_EXT_DELETE_PLAYLIST, 0);						return -2;					case VK_DELETE:						w32g_send_rc(RC_EXT_ROTATE_PLAYLIST, -1);						return -2;					case VK_INSERT:						w32g_send_rc(RC_EXT_ROTATE_PLAYLIST, 1);						return -2;					case 0x46:	// VK_F						return -2;					case 0x42:	// VK_B						return -2;					case 0x4D:	// VK_M						SendMessage(hListWnd,WM_COMMAND,MAKEWPARAM(IDC_BUTTON_REFINE,0),0);						return -2;					case 0x43:	// VK_C						SendMessage(hListWnd,WM_COMMAND,MAKEWPARAM(IDC_BUTTON_CLEAR,0),0);						return -2;					case 0x55:	// VK_U						SendMessage(hListWnd,WM_COMMAND,MAKEWPARAM(IDC_BUTTON_UNIQ,0),0);						return -2;					case 0x56:	// VK_V						SendMessage(hListWnd,WM_COMMAND,MAKEWPARAM(IDC_BUTTON_DOC,0),0);						return -2;					case VK_F1:					case 0x48:	// VK_H						MessageBox(hListWnd,							"Usage of key.\n"							"List window command.\n"							"  ESC: Close Help      H: Help\n"							"  V: View Document\n"							"Player command.\n"							"  SPACE/ENTER: PLAY    E: Stop    S: Pause\n"							"  P: Prev    N: Next\n"							"Playlist command.\n"							"  M: Refine playlist    U: Uniq playlist\n"							"  C: Clear playlist\n"							"  D: Remove playlist    BS: Remove previous playlist\n"							"  INS: Push Playlist    DEL: Pop Playlist\n"							"TiMidity command.\n"							"  Q: Quit\n"							,"Help", MB_OK);						return -2;					default:						break;			}			return -1;		}	case WM_SIZE:		switch(wParam){		case SIZE_MAXIMIZED:		case SIZE_RESTORED:			{		// Ȃ񂩈ӖȂʓ|(^^;;				int x,y,cx,cy;				int maxHeight = 0;				int center, idControl;				HWND hwndChild;				RECT rcParent, rcChild, rcRest;				int nWidth = LOWORD(lParam);				int nHeight = HIWORD(lParam);				GetWindowRect(hwnd,&rcParent);				cx = rcParent.right-rcParent.left;				cy  = rcParent.bottom-rcParent.top;				if(cx < 380)					MoveWindow(hwnd,rcParent.left,rcParent.top,380,cy,TRUE);				if(cy < 200)					MoveWindow(hwnd,rcParent.left,rcParent.top,cx,200,TRUE);				GetClientRect(hwnd,&rcParent);				rcRest.left = rcParent.left; rcRest.right = rcParent.right;				// IDC_EDIT_NUM				idControl = IDC_EDIT_NUM;				hwndChild = GetDlgItem(hwnd,idControl);				GetWindowRect(hwndChild,&rcChild);				cx = rcChild.right-rcChild.left;				cy = rcChild.bottom-rcChild.top;				x = rcParent.left;				y = rcParent.bottom - cy;				MoveWindow(hwndChild,x,y,cx,cy,TRUE);				if(cy>maxHeight) maxHeight = cy;				rcRest.left += cx;				// IDC_BUTTON_DOC				idControl = IDC_BUTTON_DOC;				hwndChild = GetDlgItem(hwnd,idControl);				GetWindowRect(hwndChild,&rcChild);				cx = rcChild.right-rcChild.left;				cy = rcChild.bottom-rcChild.top;				x = rcRest.left + 10;				y = rcParent.bottom - cy;				MoveWindow(hwndChild,x,y,cx,cy,TRUE);				if(cy>maxHeight) maxHeight = cy;				rcRest.left += cx;				// IDC_BUTTON_CLEAR				idControl = IDC_BUTTON_CLEAR;				hwndChild = GetDlgItem(hwnd,idControl);				GetWindowRect(hwndChild,&rcChild);				cx = rcChild.right-rcChild.left;				cy = rcChild.bottom-rcChild.top;				x = rcParent.right - cx - 5;				y = rcParent.bottom - cy ;				MoveWindow(hwndChild,x,y,cx,cy,TRUE);				if(cy>maxHeight) maxHeight = cy;				rcRest.right -= cx + 5;				// IDC_BUTTON_UNIQ				center = rcRest.left + (int)((rcRest.right - rcRest.left)*0.52);				idControl = IDC_BUTTON_UNIQ;				hwndChild = GetDlgItem(hwnd,idControl);				GetWindowRect(hwndChild,&rcChild);				cx = rcChild.right-rcChild.left;				cy = rcChild.bottom-rcChild.top;				x = center - cx;				y = rcParent.bottom - cy;				MoveWindow(hwndChild,x,y,cx,cy,TRUE);				if(cy>maxHeight) maxHeight = cy;				// IDC_BUTTON_REFINE				idControl = IDC_BUTTON_REFINE;				hwndChild = GetDlgItem(hwnd,idControl);				GetWindowRect(hwndChild,&rcChild);				cx = rcChild.right-rcChild.left;				cy = rcChild.bottom-rcChild.top;				x = center + 3;				y = rcParent.bottom - cy;				MoveWindow(hwndChild,x,y,cx,cy,TRUE);				if(cy>maxHeight) maxHeight = cy;				// IDC_LISTBOX_PLAYLIST				idControl = IDC_LISTBOX_PLAYLIST;				hwndChild = GetDlgItem(hwnd,idControl);				cx = rcParent.right - rcParent.left;				cy = rcParent.bottom - rcParent.top - maxHeight - 3;				x  = rcParent.left;				y = rcParent.top;				MoveWindow(hwndChild,x,y,cx,cy,TRUE);				InvalidateRect(hwnd,&rcParent,FALSE);				UpdateWindow(hwnd);				GetWindowRect(hwnd,&rcParent);				ListWndInfo.Width = rcParent.right - rcParent.left;				ListWndInfo.Height = rcParent.bottom - rcParent.top;				break;			}		case SIZE_MINIMIZED:		case SIZE_MAXHIDE:		case SIZE_MAXSHOW:		default:			break;		}		break;	// See PreDispatchMessage() in w32g2_main.c	case WM_SYSKEYDOWN:	case WM_KEYDOWN:	{		int nVirtKey = (int)wParam;		switch(nVirtKey){			case VK_ESCAPE:				SendMessage(hwnd,WM_CLOSE,0,0);				break;		}	}		break;	case WM_CLOSE:		ShowSubWindow(hListWnd,0);//		ShowWindow(hListWnd, SW_HIDE);		MainWndUpdateListButton();		break;	case WM_DROPFILES:		SendMessage(hMainWnd,WM_DROPFILES,wParam,lParam);		return 0;	default:		return FALSE;	}	return FALSE;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/b145888026ba74b152bd275692a491408aa2b59e/w32g_subwin.c/clean/interface/w32g_subwin.c