|
void MyDlg::WMAll()
{
switch( this->message ) {
case WM_LBUTTONDOWN:
if ( this->CaptureFlg ) {
POINT pt;
HWND hTarget;
pt.x = (short)LOWORD(this->lParam);
pt.y = (short)HIWORD(this->lParam);
::ClientToScreen( this->hDlg, &pt );
hTarget = ::WindowFromPoint( pt );
if ( hTarget == NULL ) {
this->StatusSetText("キャプチャに失敗しました");
this->CaptureFlg = false;
ReleaseCapture();
::SetForegroundWindow( this->hWnd );
break;
}
::SetForegroundWindow( hTarget );
::Sleep( 500 );
Tool.PrintScreenKey( true );
::Sleep( 500 );
this->StatusSetText("キャプチャは正常終了しました");
this->CaptureFlg = false;
ReleaseCapture();
::SetForegroundWindow( this->hWnd );
}
break;
case WM_CAPTURECHANGED:
if ( this->CaptureFlg ) {
this->StatusSetText("キャプチャは解除されました");
}
break;
}
}
| |