This project has moved and is read-only. For the latest updates, please go here.

Problem with 'Hidden' property

Dec 15, 2011 at 8:14 AM
Edited Dec 15, 2011 at 10:33 AM

On Windows XP the execution of a console application is always hidden.

I have set the 'Hidden' field in Settings to 'false', but to no effect.

Is this line correct: v1Task.SetFlags(flags &= ~V1Interop.TaskFlags.Hidden);

without the "~" it seems to work for now.

Dec 15, 2011 at 6:33 PM

"Hidden" has to do with the task listing itself, not the executing task. Other than the command line, there is not a way to signal a task to run as hidden.

Dec 16, 2011 at 9:31 AM

If you check the source code it says:

/// <summary>
/// The task is hidden. When the task begins execution, it runs in a hidden window.
/// </summary>
Hidden = 0x200,

This supports my theory.

MS documentation is unclear: what is hidden.

The thing is that with Task Scheduler 1.6.4 (and Hidden=false) the console window is hidden and with 1.7 (and Hidden=false) it is not hidden on the same machine. I only change the dlls. 1.6.4 is release compiled and 1.7 is debug compiled.

Any hints?

Dec 16, 2011 at 5:02 PM
Edited Dec 16, 2011 at 10:20 PM

That comment in the source code on the Hidden flag is incorrect. It has been updated to match the Microsoft documentation.

I checked the source code history and nothing related to that flag has changed between those releases. I can't say why you're seeing a different behavior.