create function getWindowPid in mymodel.py