};
-
+
// -------------------------------------------------------------------
// ウィンドウプロシージャ
// -------------------------------------------------------------------
break;
case WM_PLAY_PLAY:
play_();
- break;
+ return TRUE;
case WM_PLAY_STOP:
stop_();
return TRUE;
SendMessage(GetDlgItem(hwnd_,IDC_SLIDER), TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 30000));
}
+ void ready()
+ {
+ // プレイボタンは有効化
+ enable_control(IDC_PLAY,true);
+ focus(IDC_PLAY);
+ highlight(IDC_PLAY);
+ // その他のボタンは無効化
+ enable_control(IDC_PAUSE,false);
+ enable_control(IDC_SLIDER,true);
+ enable_control(IDC_STOP,false);
+ }
+
void play()
{
- send_message(WM_PLAY_PLAY,0,0);
+ post_message(WM_PLAY_PLAY,0,0);
}
void play_()
{
enable_control(IDC_PLAY,false);
enable_control(IDC_STOP,true);
+ focus(IDC_STOP);
+ highlight(IDC_STOP);
enable_control(IDC_PAUSE,true);
::SetWindowText(GetDlgItem(hwnd_,IDC_PAUSE),L"一時停止");
enable_control(IDC_SLIDER,true);
void stop()
{
- send_message(WM_PLAY_STOP,0,0);
+ post_message(WM_PLAY_STOP,0,0);
}
void stop_()
{
enable_control(IDC_PLAY,true);
+ focus(IDC_PLAY);
+ highlight(IDC_PLAY);
enable_control(IDC_STOP,false);
enable_control(IDC_PAUSE,false);
- enable_control(IDC_SLIDER,false);
+ enable_control(IDC_SLIDER,true);
}
void pause()
enable_control(IDC_PLAY,false);
enable_control(IDC_STOP,false);
enable_control(IDC_PAUSE,true);
+ focus(IDC_PAUSE);
+ highlight(IDC_PAUSE);
::SetWindowText(GetDlgItem(hwnd_,IDC_PAUSE),L"再開");
- enable_control(IDC_SLIDER,false);
+ enable_control(IDC_SLIDER,true);
}
virtual void create(){
create_device_independent_resources();
void create_dialog()
{
- hwnd_ = ::CreateDialog(HINST_THISCOMPONENT,MAKEINTRESOURCE(IDD_MAINDIALOG),0,thunk_proc_);
+ hwnd_ = ::CreateDialog(HINST_THISCOMPONENT,MAKEINTRESOURCE(IDD_MAINDIALOG),::GetDesktopWindow(),thunk_proc_);
// ::DialogBox(HINST_THISCOMPONENT,MAKEINTRESOURCE(IDD_MAINDIALOG),0,thunk_proc_);
}
}
}
}
- void ready()
- {
- // プレイボタンは有効化
- enable_control(IDC_PLAY,true);
-
- // その他のボタンは無効化
- enable_control(IDC_PAUSE,false);
- enable_control(IDC_SLIDER,false);
- enable_control(IDC_STOP,false);
- }
+
void create_window()
{
{
::EnableWindow(GetDlgItem(hwnd_,id),enable?TRUE:FALSE);
}
+
+ void focus(uint32_t id)
+ {
+ //::PostMessage(GetDlgItem(hwnd_,id),WM_SETFOCUS,NULL,NULL);
+ ::SetFocus(GetDlgItem(hwnd_,id));
+ //::PostMessage(hwnd_,WM_COMMAND,MAKEWPARAM(id,BN_SETFOCUS),(LPARAM)GetDlgItem(hwnd_,id));
+ }
+
+ void highlight(uint32_t id)
+ {
+ //Button_SetState(GetDlgItem(hwnd_,id),TRUE);
+ }
+
private:
void read_start() {};