Jump to content
Sign in to follow this  
SoulA

CUI question

Recommended Posts

SoulA

If I compile a script as a CUI application, is there any way possible to have the cmd window that it would run in start hidden without using some kind of WinSetState type option in the beginning. Just have it compiled in to run that way?

The reason I ask is I am making a service and for services to run correctly they need to be in CUI form. I also want this CUI app service to run some other GUI functions but without the user ever seeing the cmd window.

For instance when windows starts and no user is logged in than the program is running waiting for someone to log in. Once they log in the window has to pop up before I can hide it. I want to avoid this.

Share this post


Link to post
Share on other sites
Skruge

If I compile a script as a CUI application, is there any way possible to have the cmd window that it would run in start hidden without using some kind of WinSetState type option in the beginning. Just have it compiled in to run that way?

It would have to be launched hidden, or the window hidden after it's drawn.

The reason I ask is I am making a service and for services to run correctly they need to be in CUI form.

Where did you hear this? I wrote several "GUI" services in C++ and they run without issues. The majority of the windows built-in services are the same.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites
SoulA

It would have to be launched hidden, or the window hidden after it's drawn.

Where did you hear this? I wrote several "GUI" services in C++ and they run without issues. The majority of the windows built-in services are the same.

The GUI services run fine until a user logs off. At that point the script terminates. The only way I have found that I can have GUI stuff included and keep the script running after a user log off is to compile a script in CUI form and to poll to see if "Program Manager" is running. If it is then we can have our gui stuff... if it isn't close it.

Share this post


Link to post
Share on other sites
Skruge

The GUI services run fine until a user logs off. At that point the script terminates.

SRVANY solves that problem. I can't find the article at the moment, but if I remember correctly it works by intercepting the notification so your program doesn't quit when a user logs off.

Not only that, but you get the ability to start/stop the service using any standard method.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites
SoulA

SRVANY solves that problem. I can't find the article at the moment, but if I remember correctly it works by intercepting the notification so your program doesn't quit when a user logs off.

Not only that, but you get the ability to start/stop the service using any standard method.

I am using srvany. I run my service as interactive. Right now I have the program only displaying an icon but this happens for any GUI interactive program. As soon as the user logs off then the program will exit. Try it for yourself and you will see. I can run a GUI program but not as an interactive service so you wouldn't be able to see it and it won't exit but that is pointless.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×