0

I was trying to make a simple batch file that would hide a window using the ShowWindow function. I've seen many scripts running others functions like RUNDLL32 devmgr.dll DeviceManager_Execute, but I don't know why running rundll32 user32.dll, ShowWindow 115689 0 does not works. It simply doesn't hides the window. Is there some kind of security intervention making this command unable to be executed?

Rafael
  • 165
  • 1
  • 1
  • 10
  • This would probably be better answered on StackOverflow, but one thing: is the `115689` the window handle or the PID? The `ShowWindow` API needs the window `HANDLE` to the window you wish to show/hide. If it's the PID, you'll have to do some more API trickery (via `EnumWindows` and other API's) to get the window you want and it's associated handle. – txtechhelp Jan 22 '15 at 00:32
  • @txtechhelp 115689 is actually a random number I typed, but even if i place a real window handle, the command won't work. – Rafael Jan 22 '15 at 00:38
  • `rundll32` doesn't pass parameters to the function in the way you expect. See [Under what circumstances can I use rundll32 to invoke a function in a DLL?](http://superuser.com/q/1074587/380318) – Ben N May 08 '16 at 22:13

0 Answers0