They're different because GetWindowText() gives you the TitleBar text of the window, whereas GetWindowModuleFileName() gives you the path to the executable that's running the window.