void OnLButtonDown(POINT p) { if (!s) { s.Create(*this, WS_CHILD | WS_VISIBLE, "X", SHIP_ID, p.x, p.y, 15, 20); } else { SetWindowPos(s, NULL, p.x, p.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); } cp = p; }
void OnLButtonDown(POINT p) { if (!ship) { ship.Create(*this, WS_VISIBLE | WS_CHILD, "x", NULL, p.x, p.y, SHIP_WIDTH, SHIP_HEIGHT); pos.x = p.x; pos.y = p.y; } //kreiraj brod i zapamti vrijednosti koordinata SetWindowPos(ship,NULL, p.x, p.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); pos.x = p.x; pos.y = p.y; //promijeni koordinate broda i zapamti nove vrijednosti }