You all forgot about GetWindowThreadProcessId!
I like it because I find API functions with long names intriguing.