if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_TEMPER_USER0, BM_GETCHECK, 0, 0)) st_temp->temper_type_mute |= 1 << 4; if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_TEMPER_USER1, BM_GETCHECK, 0, 0)) st_temp->temper_type_mute |= 1 << 5; if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_TEMPER_USER2, BM_GETCHECK, 0, 0)) st_temp->temper_type_mute |= 1 << 6; if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_TEMPER_USER3, BM_GETCHECK, 0, 0)) st_temp->temper_type_mute |= 1 << 7; 
PrefTiMidity4DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam){	static int initflag = 1; 	static int pref_channel_mode;	switch (uMess){  case WM_INITDIALOG:		pref_channel_mode = PREF_CHANNEL_MODE_DRUM_CHANNEL;		SendMessage(hwnd,WM_MYRESTORE,(WPARAM)0,(LPARAM)0);		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_TEMPER_EQUAL,				st_temp->temper_type_mute & 1 << 0);		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_TEMPER_PYTHA,				st_temp->temper_type_mute & 1 << 1);		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_TEMPER_MEANTONE,				st_temp->temper_type_mute & 1 << 2);		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_TEMPER_PUREINT,				st_temp->temper_type_mute & 1 << 3);		initflag = 0;		break;	case WM_MYRESTORE:	{		ChannelBitMask channelbitmask;		switch(pref_channel_mode){		case PREF_CHANNEL_MODE_DRUM_CHANNEL_MASK:			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL,BM_SETCHECK,0,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL_MASK,BM_SETCHECK,1,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_QUIET_CHANNEL,BM_SETCHECK,0,0);			channelbitmask = st_temp->default_drumchannel_mask;			break;		case PREF_CHANNEL_MODE_QUIET_CHANNEL:			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL,BM_SETCHECK,0,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL_MASK,BM_SETCHECK,0,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_QUIET_CHANNEL,BM_SETCHECK,1,0);			channelbitmask = st_temp->quietchannels;			break;		default:		case PREF_CHANNEL_MODE_DRUM_CHANNEL:			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL,BM_SETCHECK,1,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL_MASK,BM_SETCHECK,0,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_QUIET_CHANNEL,BM_SETCHECK,0,0);			channelbitmask = st_temp->default_drumchannels;			break;		}		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH01,IS_SET_CHANNELMASK(channelbitmask,0));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH02,IS_SET_CHANNELMASK(channelbitmask,1));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH03,IS_SET_CHANNELMASK(channelbitmask,2));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH04,IS_SET_CHANNELMASK(channelbitmask,3));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH05,IS_SET_CHANNELMASK(channelbitmask,4));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH06,IS_SET_CHANNELMASK(channelbitmask,5));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH07,IS_SET_CHANNELMASK(channelbitmask,6));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH08,IS_SET_CHANNELMASK(channelbitmask,7));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH09,IS_SET_CHANNELMASK(channelbitmask,8));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH10,IS_SET_CHANNELMASK(channelbitmask,9));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH11,IS_SET_CHANNELMASK(channelbitmask,10));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH12,IS_SET_CHANNELMASK(channelbitmask,11));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH13,IS_SET_CHANNELMASK(channelbitmask,12));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH14,IS_SET_CHANNELMASK(channelbitmask,13));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH15,IS_SET_CHANNELMASK(channelbitmask,14));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH16,IS_SET_CHANNELMASK(channelbitmask,15));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH17,IS_SET_CHANNELMASK(channelbitmask,16));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH18,IS_SET_CHANNELMASK(channelbitmask,17));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH19,IS_SET_CHANNELMASK(channelbitmask,18));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH20,IS_SET_CHANNELMASK(channelbitmask,19));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH21,IS_SET_CHANNELMASK(channelbitmask,20));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH22,IS_SET_CHANNELMASK(channelbitmask,21));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH23,IS_SET_CHANNELMASK(channelbitmask,22));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH24,IS_SET_CHANNELMASK(channelbitmask,23));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH25,IS_SET_CHANNELMASK(channelbitmask,24));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH26,IS_SET_CHANNELMASK(channelbitmask,25));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH27,IS_SET_CHANNELMASK(channelbitmask,26));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH28,IS_SET_CHANNELMASK(channelbitmask,27));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH29,IS_SET_CHANNELMASK(channelbitmask,28));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH30,IS_SET_CHANNELMASK(channelbitmask,29));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH31,IS_SET_CHANNELMASK(channelbitmask,30));		DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CH32,IS_SET_CHANNELMASK(channelbitmask,31));	}		break;	case WM_COMMAND:	switch (LOWORD(wParam)) {	  case IDCLOSE:		break;		case IDC_CHECKBOX_DRUM_CHANNEL:			{			SendMessage(hwnd,WM_MYSAVE,(WPARAM)0,(LPARAM)0);			pref_channel_mode = PREF_CHANNEL_MODE_DRUM_CHANNEL;			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL,BM_SETCHECK,1,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL_MASK,BM_SETCHECK,0,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_QUIET_CHANNEL,BM_SETCHECK,0,0);			SendMessage(hwnd,WM_MYRESTORE,(WPARAM)0,(LPARAM)0);			}		break;		case IDC_CHECKBOX_DRUM_CHANNEL_MASK:			{			SendMessage(hwnd,WM_MYSAVE,(WPARAM)0,(LPARAM)0);			pref_channel_mode = PREF_CHANNEL_MODE_DRUM_CHANNEL_MASK;			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL,BM_SETCHECK,0,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL_MASK,BM_SETCHECK,1,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_QUIET_CHANNEL,BM_SETCHECK,0,0);			SendMessage(hwnd,WM_MYRESTORE,(WPARAM)0,(LPARAM)0);			}		break;		case IDC_CHECKBOX_QUIET_CHANNEL:			{			SendMessage(hwnd,WM_MYSAVE,(WPARAM)0,(LPARAM)0);			pref_channel_mode = PREF_CHANNEL_MODE_QUIET_CHANNEL;			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL,BM_SETCHECK,0,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_DRUM_CHANNEL_MASK,BM_SETCHECK,0,0);			SendDlgItemMessage(hwnd,IDC_CHECKBOX_QUIET_CHANNEL,BM_SETCHECK,1,0);			SendMessage(hwnd,WM_MYRESTORE,(WPARAM)0,(LPARAM)0);			}		break;		case IDC_BUTTON_REVERSE:			{			SendMessage(hwnd,WM_MYSAVE,(WPARAM)0,(LPARAM)0);			switch(pref_channel_mode){			case PREF_CHANNEL_MODE_DRUM_CHANNEL_MASK:				REVERSE_CHANNELMASK(st_temp->default_drumchannel_mask);				break;			case PREF_CHANNEL_MODE_QUIET_CHANNEL:				REVERSE_CHANNELMASK(st_temp->quietchannels);				break;			default:			case PREF_CHANNEL_MODE_DRUM_CHANNEL:				REVERSE_CHANNELMASK(st_temp->default_drumchannels);				break;			}			SendMessage(hwnd,WM_MYRESTORE,(WPARAM)0,(LPARAM)0);			}			break;		default:		break;	  }		PrefWndSetOK = 1;		break;	case WM_MYSAVE:		if ( initflag ) break;	{		ChannelBitMask channelbitmask;		int tmp;#define PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,ctlid,channelbitmask,ch,tmp) \{	if(DLG_CHECKBUTTON_TO_FLAG((hwnd),(ctlid),(tmp))) SET_CHANNELMASK((channelbitmask),(ch)); \else UNSET_CHANNELMASK((channelbitmask),(ch)); }		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH01,channelbitmask,0,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH02,channelbitmask,1,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH03,channelbitmask,2,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH04,channelbitmask,3,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH05,channelbitmask,4,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH06,channelbitmask,5,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH07,channelbitmask,6,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH08,channelbitmask,7,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH09,channelbitmask,8,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH10,channelbitmask,9,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH11,channelbitmask,10,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH12,channelbitmask,11,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH13,channelbitmask,12,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH14,channelbitmask,13,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH15,channelbitmask,14,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH16,channelbitmask,15,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH17,channelbitmask,16,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH18,channelbitmask,17,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH19,channelbitmask,18,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH20,channelbitmask,19,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH21,channelbitmask,20,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH22,channelbitmask,21,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH23,channelbitmask,22,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH24,channelbitmask,23,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH25,channelbitmask,24,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH26,channelbitmask,25,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH27,channelbitmask,26,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH28,channelbitmask,27,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH29,channelbitmask,28,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH30,channelbitmask,29,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH31,channelbitmask,30,tmp);		PREF_CHECKBUTTON_SET_CHANNELMASK(hwnd,IDC_CHECKBOX_CH32,channelbitmask,31,tmp);		switch(pref_channel_mode){		case PREF_CHANNEL_MODE_DRUM_CHANNEL_MASK:			st_temp->default_drumchannel_mask = channelbitmask;			break;		case PREF_CHANNEL_MODE_QUIET_CHANNEL:			st_temp->quietchannels = channelbitmask;			break;		default:		case PREF_CHANNEL_MODE_DRUM_CHANNEL:			st_temp->default_drumchannels = channelbitmask;			break;		}	}		st_temp->temper_type_mute = 0;		if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_TEMPER_EQUAL,				BM_GETCHECK, 0, 0))			st_temp->temper_type_mute |= 1 << 0;		if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_TEMPER_PYTHA,				BM_GETCHECK, 0, 0))			st_temp->temper_type_mute |= 1 << 1;		if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_TEMPER_MEANTONE,				BM_GETCHECK, 0, 0))			st_temp->temper_type_mute |= 1 << 2;		if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_TEMPER_PUREINT,				BM_GETCHECK, 0, 0))			st_temp->temper_type_mute |= 1 << 3;	SetWindowLong(hwnd,DWL_MSGRESULT,FALSE);	break;  case WM_SIZE:		return FALSE;	case WM_CLOSE:		break;	default:	  break;	}	return FALSE;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/2109268c9747df2ac66b4964379d7d2d003309c4/w32g_pref.c/buggy/interface/w32g_pref.c