Forum: Object-Pascal / Delphi-Language
Delphi
by CCRDude,
23. Sep 2011
1. Don't just assume that hWnd will return something
2. Loop until hWnd no longer returns anything
Still won't those extra windows. So better:
3. Use EnumProcesses/CreateToolHelpSnapshot32 to enumerate all processes, looking for explorer.exe, instead of going by the window.
Forum: Object-Pascal / Delphi-Language
Delphi
by CCRDude,
23. Sep 2011
Explorer does have a setting to open separate instances in separate windows. Therefore, you need to make sure you kill all instances of explorer.exe.