📄 dialog_1000msgproc.c
字号:
if (!b)
{
SetWindowText(hSimpleEdit,N_("SimpleEdit111"));
SetWindowText(hMultiEdit,N_("MultiEdit111 MultiEdit111 MultiEdit111 MultiEdit111 MultiEdit111 MultiEdit111"));
itor = LEGetCurSel(hListEx);
p = LEGetItemText(hListEx,itor);
isvisible = LEIsItemShown(hListEx,itor);
SetWindowText(hComboBox,N_("ComBoBox"));
}
else
{
SetWindowText(hSimpleEdit,N_("SimpleEdit222"));
SetWindowText(hMultiEdit,N_("MultiEdit222 MultiEdit222 MultiEdit222 MultiEdit222 MultiEdit222 MultiEdit222"));
}
//测试播放amr_NB文件1.amr
if (TRUE == bPlay)
{
MessageBox(hWnd,"begin of playing 1.amr !","begin",MB_OK);
nFlag = tp_man_mm_audio_open();
if (nFlag != 0)
{
MessageBox(hWnd,"tp_man_mm_audio_open fail !","error",MB_OK);
}
mAuo.volume = 120;
mAuo.loop_times = 1;
mAuo.channel = MAN_MM_CHANNEL_EARPHONE;
mAuo.crescendo = MAN_MM_VOL_TYPE_NORMAL;
mAuo.start_position = 0;
mAuo.rawdata_mode = MM_RAW_MIDI;//MM_RAW_MIDI;//MM_RAW_AMR_NB;
nFlag = tp_man_mm_audio_play("/flash/2.mid", &mAuo);//2.mid //1.amr
if (nFlag != OS_SUCCESS)
{
MessageBox(hWnd,"tp_man_mm_audio_play fail !","error",MB_OK);
}
bPlay = !bPlay;
}
else
{
MessageBox(hWnd,"end of playing 1.amr !","end",MB_OK);
tp_man_mm_audio_stop();
tp_man_mm_audio_close();
bPlay = !bPlay;
}
/************************************************************************/
return DefaultMainWinProc(hWnd, MSG_COMMAND, w, l);}
/**********************************************************************************
* Function: OnInitDialog
* Purpose: <describing what the function is to do>
* Relation: <describing the name, version and position of protocols involved by
* this function>
* Params:
*
* Name Type In/Out Description
* -------- ---- ------ -----------
*
* Return: <comment on the returned values>
* Note: <the limitations to use this function or other comments>
***********************************************************************************/
static SINT32 OnInitDialog(HWND hWnd,WPARAM w,LPARAM l)
{
HWND hListex = HWND_INVALID;
HWND hComboBox = HWND_INVALID;
DLCITOR itor = INVALID_ITOR;
ListExItem item_st = {0};
CHAR text[20] = "ListItem内容";
SINT32 i = 0;
ListExSkin NewSkin = {0};
SKINTYPE skt = 0;
SINT16 nFlag = 0;
hListex = GetDlgItem( hWnd, IDC_LISTCTRLEX_1005 );
hComboBox = GetDlgItem(hWnd,IDC_COMBOBOX_1009);
/*clean all and add*/
LEClearAll( hListex );
LEClearAll( hComboBox );
/*get the notepad to show*/
for ( i = 0; i < 10; i++ )
{
item_st.nID = i;
item_st.dwItemData = i;
item_st.szInfo = N_("ListItem_info");
item_st.szText = (CONST CHAR*)(text);
item_st.pLogoBmp = &bmp_text2;
itor = LEAddItem(hListex, &item_st, itor);
itor = LEAddItem(hComboBox,&item_st,itor);
LEEnsureItemVisible(hListex,itor);
LEEnsureItemVisible(hComboBox,itor);
NewSkin.pBmpBkGnd = &bmp_text;
LESetCtrlSkin( &NewSkin, skt);
}
/*set cursel, new or view or edit*/
itor = LEGetFirst( hListex );
for ( i = 0; i < 5; i++ )
itor = LEGetNext( hListex, itor, 1 );
LESetCurSel( hListex, itor);
LESetVBarWidth(hListex,10);
TCSetTitle( GetDlgItem( hWnd, IDC_SIMPLE_TITLE), APP_NOTEPAD_STR, MAJOR_TITLE);
//初始化音频播放器
MessageBox(hWnd,"Init audio !","Init",MB_OK);
nFlag = tp_man_mm_audio_init();
if (nFlag != 0)
{
MessageBox(hWnd,"tp_man_mm_audio_init fail !","error",MB_OK);
}
/************************************* end of create ***********************************/
return DefaultMainWinProc(hWnd, MSG_INITDIALOG, w, l);
}
SINT32 app_TestControls_main_on_keydown(HWND hWnd, WPARAM wparam, LPARAM lparam)
{
HWND list = HWND_INVALID;
DLCITOR itor = INVALID_ITOR;
SINT32 index = 0;
switch ( wparam )
{
case KEY_OK:
case KEY_LSK:
{
if ( 0 == g_app_TestControls.count )
{
/*new notepad*/
app_TestControls_create_edit(hWnd, APP_NOTEPAD_VALUE_NEW);
g_app_TestControls.count++;
return 0;
}
/*create the menu list*/
list = GetDlgItem( hWnd, IDC_SIMPLE_LISTEX );
if ( HWND_INVALID == list )
{
return -1;
}
itor = LEGetCurSel( list );
if ( INVALID_ITOR == itor )
{
return -1;
}
/*get the index, the postion in the array*/
index = LEGetItemID( list, itor);
app_TestControls_create_menu(hWnd, index);
}
break;
case KEY_RSK:
DestroyMainWindowIndirect(hWnd);
return 0;
default:
break;
}
return DefaultMainWinProc(hWnd, MSG_KEYDOWN, wparam, lparam);
}
/**********************************************************************************
* Function: CreateDialog_1000
* Purpose: <describing what the function is to do>
* Relation: <describing the name, version and position of protocols involved by
* this function>
* Params:
*
* Name Type In/Out Description
* -------- ---- ------ -----------
*
* Return: <comment on the returned values>
* Note: <the limitations to use this function or other comments>
***********************************************************************************/
HWND CreateDialog_1000(HWND hParentWnd)
{
HWND hWnd = NULL;
BEGIN_STATIC_MSGMAP(Dialog_1000maps) MAPMESSAGE(MSG_INITDIALOG,OnInitDialog) MAPCOMMAND(IDC_BUTTON_1003,BN_CLICKED,OnBnClked1003)
MAPMESSAGE(MSG_KEYDOWN,app_TestControls_main_on_keydown) END_STATIC_MSGMAP(Dialog_1000maps)
hWnd = tp_resource_window_create( hParentWnd,
"TestControls",
&Dialog_1000maps,
DIALOG_1000_PATH,
"Dialog_1000",
0
);
g_app_TestControls_list_hwnd = hWnd;
return hWnd;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -