Preheat oven to 375°.
Lightly spoon flour into dry measuring cups; level with a knife. Sift together 1 2/3 cups flour, 1/2 teaspoon salt, and baking powder. Combine 3/4 cup milk and 2 eggs, stirring with a whisk. Add milk mixture to flour mixture, stirring with a whisk until combined. Let stand 10 minutes.
Bring 2 quarts water to a boil in a large saucepan. Hold a colander with large holes (about 1/4-inch in diameter) over boiling water; spoon about 1/2 cup dough into colander. Press the dough through holes with a rubber spatula (droplets will form spaetzle); set colander aside. Cook 3 minutes or until done (spaetzle will rise to surface). Remove with a slotted spoon; drain in a strainer (spaetzle will stick to a paper towel). Repeat procedure with remaining dough.
Heat a medium nonstick skillet coated with cooking spray over medium heat. Add onion; cook 5 minutes or until lightly browned, stirring frequently. Remove from heat; stir in ham. Combine spaetzle and onion mixture in a 2-quart baking dish coated with cooking spray, tossing gently.
Combine remaining 1/2 teaspoon salt, 1 1/2 cups milk, 2 eggs, 2 tablespoons flour, and pepper, stirring with a whisk. Pour milk mixture over spaetzle mixture. Sprinkle evenly with cheese. Bake at 375° for 35 minutes or until cheese is lightly browned.