If both a window handle and a process identity are supplied, they must be consistent.
If the window handle is NULL and the process identity supplied cannot be found in the switch list then the switch handle returned is the handle for the most proximal ancestor process. Once the switch list handle is obtained, it may be used in various other calls to manipulate the switch list entry or the program which it references.