Pre-heat oven to 350 degrees. Grease a 9 by 12 or other large casserole dish.
Heat a large skillet with a couple tablespoons of oil and add the onion. Cook for a few minutes until they begin to turn translucent. Add the chopped ham and cook for another 4 - 5 minutes. Remove from heat.
Combine half and half, milk and flour and whisk until well combined.
Using a mandoline or other slicer, slice the potatoes into thin slices. Place 1 third of the sliced potatoes in your casserole dish. Then cover with half of the ham and onion mixure, then a sprinkling of cheese. Then, add about a third of the milk/cream mixutre. Next add another layer of potatoes, then the remainder of the ham and onion, another sprinkling of cheese, and another third of the milk/cream mix. Finally, top with the remaining potatoes and the rest of the milk/cream mix. Top with a generous cover of cheese and then sprinkle on the cup of corn flakes or crushed saltines and dot with chunks of butter.
Cover with aluminum foil and bake for about 40 minutes. Remove the foil and continue baking for another 20 minutes or until bubbly and hot.
Remove from oven. Let rest for 10 minutes, cut into squares and serve.