本文整理汇总了C++中TSTR::last方法的典型用法代码示例。如果您正苦于以下问题:C++ TSTR::last方法的具体用法?C++ TSTR::last怎么用?C++ TSTR::last使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSTR
的用法示例。
在下文中一共展示了TSTR::last方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsDlgButtonChecked
// Handle WM_COMMAND messages separately
void AudioP3Dlg::WMCommand(int id, int notify, HWND hCtrl)
{
int mmerr;
AudioP3Control* af = (AudioP3Control *)GetWindowLongPtr(hWnd, DWLP_USER);
switch (id) {
case IDC_AUDAMP_ABSOLUTE:
cont->absolute = IsDlgButtonChecked(hWnd,id);
Change();
break;
case IDC_QUICKDRAW:
cont->quickdraw = IsDlgButtonChecked(hWnd,id);
Change();
break;
case IDC_AUDAMP_RECDEVICE:
if (notify == CBN_SELCHANGE) {
int devIdx = SendMessage(GetDlgItem(hWnd, IDC_AUDAMP_RECDEVICE), CB_GETCURSEL, 0, 0);
cont->rtwave->SetDevice(devIdx);
Change();
}
break;
case IDC_AUDAMP_RECENABLE:
cont->enableRuntime = IsDlgButtonChecked(hWnd,id);
// Startup or terminate runtime recording
if (cont->enableRuntime) {
if ((mmerr = cont->rtwave->StartRecording()) == 0) {
EnableWindow(GetDlgItem(hWnd, IDC_AUDAMP_RECDEVICE), 0);
}
else {
CheckDlgButton(hWnd, id, 0);
MessageBox(hWnd, GetString(IDS_CJ_DEVICE_BUSY), GetString(IDS_CJ_PROGNAME), MB_OK);
}
}
else {
cont->rtwave->StopRecording();
EnableWindow(GetDlgItem(hWnd, IDC_AUDAMP_RECDEVICE), 1);
}
// Here we are just telling trackview to repaint its hierarchy.
// We haven't actually changed anything, but the switch from file to record
// will cause a change in TrackView line height - and we need to tell that
// to TrackView
cont->NotifyDependents(FOREVER,PART_ALL,REFMSG_SUBANIM_STRUCTURE_CHANGED);
Change();
break;
case IDC_BTN_BROWSE: {
// Changed to open in the directory of the file. //CJ
TSTR dir = cont->szFilename;
if (dir.Length() == 0) {
// Use sound dir if no file.
dir = TSTR(ip->GetDir(APP_SOUND_DIR));
}
else {
int lc = dir.last((int)'\\');
if (lc == -1) {
lc = dir.last((int)'/');
}
if (lc != -1) {
dir[lc] = '\0';
}
}
// Brings up file dialog box with sound "preview".
GetSoundFileName(hCtrl, cont->szFilename, dir);
if (!cont->szFilename.isNull()) {
cont->wave->InitOpen(cont->szFilename);
SendMessage(GetDlgItem(hWnd, IDC_AUDAMP_FILENAME), WM_SETTEXT, 0, (LPARAM)((char *)cont->szFilename));
EnableChannelUI(cont->wave->GetNumChannels() == 2);
}
Change();
}
break;
case IDC_BTN_REMOVESOUND:
cont->wave->FreeSample();
cont->szFilename = "";
SendMessage(GetDlgItem(hWnd, IDC_AUDAMP_FILENAME), WM_SETTEXT, 0, (LPARAM)"");
EnableChannelUI(FALSE);
Change();
break;
case IDC_AUDAMP_LEFT:
cont->channel = 0;
Change();
break;
case IDC_AUDAMP_RIGHT:
cont->channel = 1;
Change();
break;
case IDC_AUDAMP_MIX:
cont->channel = 2;
Change();
break;
case IDC_ABOUT:
ShowAbout(hWnd);
break;
case IDC_CLOSE:
DestroyWindow(hWnd);
break;
}
//.........这里部分代码省略.........