脳内コンパイルだけどこれで駄目ですか?

static int oldX,oldY;;
static bool bDrag=false;

//左ボタンが押されてたら移動
if(bDrag) move(mouseX-oldX,mouseY-oldY);
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000){
 //カーソルが矩形内にあるかどうか判定
 if (mouseX>=wndX && mouseX<=wndX+wndW &&
     mouseY>=wndY && mouseY<=wndY+wndH){
  bDrag=true;
 }
}
else bDrag=false;
oldX=mouseX;
oldY=mouseY;