Posts Tagged ‘workaround’

I see your errorlevel and raise you a process exit code

December 7, 2012

Have you ever written a batch file that is more of a “application” than a script? Of course you made sure ERRORLEVEL is set correctly so when your batch file is a part of a larger script, IF ERRORLEVEL error checking can be used. What could go wrong?

For some crazy reason, cmd.exe does not use the expected logic when you use the && and/or || syntax. I assume part of the problem is because the batch file is executed by cmd.exe itself and there is no child process and no real process exit code.

Fixing this requires some hacky workarounds and is generally a big pain in the ass.

(Safe) SHAutoComplete

May 29, 2010

For a long time, MSDN has stated that SHAutoComplete can only be called once on a HWND, but a recent blog post by Raymond Chen “documents” that this issue was fixed in Vista.

It sure would be nice to avoid the leak on older platforms as well, but MS is not going to help you (Implementing such a thing would reveal that their Subclassing API that supposedly is XP+ only actually goes all the way back to Win98 (Really IE5 on Win95 / NT4))

Without knowing the internals of browseui.dll (Where most of the autocomplete stuff seems to be implemented) we are left with a ugly hack: (more…)