// Read map data
ReadProcessMemory(hProcess, LPCVOID(ADR_GAME_MAP),&Game_Map,(MAX_HEIGHT_Y*MAX_WIDTH_X),&ReadCount);
if (!ReadCount) return FALSE;
// x & y starts from 1 to skip the boundary data
for (x = 1; x <= Map_Width_X; x++)
{
for (y = 1; y <= Map_Height_Y; y++)
{
// No mine is found in this cell
if (Game_Map[x + y * 32] == NO_MINE_VALUE)
{
pt.x = FIRST_MINE_X + ((x-1)*STEP_X);
pt.y = FIRST_MINE_Y + ((y-1)*STEP_Y);
// Click cell
PostMessage(hMineAppWnd,WM_LBUTTONDOWN,0x1,MAKELPARAM(pt.x,pt.y));
PostMessage(hMineAppWnd,WM_LBUTTONUP,0,MAKELPARAM(pt.x,pt.y));
}
}
}
return TRUE;
}