Page 1 of 1
Openwindow() question
Posted: Tue Jun 13, 2006 8:07 am
by nessie
Hi all,
Is it possible to open and display a window without having to login to a Windows XP machine? i.e. at the login prompt.
Posted: Tue Jun 13, 2006 8:18 am
by Pantcho!!
Hi,
The OpenWindow command doesnt have any relation to your question.
You basicly ask if you can do this:
1. compile a program with PureBasic .
or
1. get any program you wish to run
2. find a method in windows how to run that program you selected in the login startup.
That i dont know but your question has no relation to Purebasic, its a system configuration and with that i cant help you that much.
google is your friend.
Posted: Tue Jun 13, 2006 9:13 am
by Konne
Why do all this newbie start with programs wich make evil things?
Posted: Tue Jun 13, 2006 3:52 pm
by Rescator
Hahaha Konne! Be glad this isn't a VB forum or similar

Posted: Tue Jun 13, 2006 4:32 pm
by nessie
Newbie (?) just because I don't spend my time submitting posts doesn't make me a newbie.
Anyway, to try and clarify what I am asking as some seem to be getting a bit confused.
I want to run a program as a service, which I can do with no problems, but I have seen some apps that can display a window where you can control this service without anyone having to be logged into that machine. So all you have to do is switch on an XP (professional) machine and the service takes over from there.
I thought that what I had asked for before was self explanatory
Posted: Tue Jun 13, 2006 6:17 pm
by Trond
nessie wrote:I thought that what I had asked for before was self explanatory
Then why did you ask?
There is no problem to this is you know how to create a service. Just show the window when the service start, and you're done.
Are you
sure you know how to create a service?
Posted: Tue Jun 13, 2006 6:34 pm
by netmaestro
I don't know how to create a service. Could you tell me how please?
Posted: Tue Jun 13, 2006 8:34 pm
by nessie
Trond,
When I said it was self explanatory I meant "my question", If I already knew the answer do you really think I would have asked the question?
Secondaly, when the service runs, no window is displayed ( do you really think I didn't try this?) hense the question
Thirdly, To create a service perhaps you should look at PBOSL and look for the exellent Library by Rings.
But there is one helpfull thing you did, you reminded me of what a hostile board this can be for someone looking for some genuine help. Even though there are many helpfull people on this board there are always some who spoil it for everyone else.
If you have no help to offer then why do people respond with wise cracks and insults
Posted: Tue Jun 13, 2006 8:39 pm
by netmaestro
Thirdly, To create a service perhaps you should look at PBOSL and look for the exellent Library by Rings.
Thanks for the tip!
Posted: Tue Jun 13, 2006 8:51 pm
by Trond
nessie wrote:Thirdly, To create a service perhaps you should look at PBOSL and look for the exellent Library by Rings.
If no window shows, how can you be sure the service is running?
Edit: What is the result of the OpenWindow() command? Does it return a valid window handle? (You can check this with IsWindow_().)
Edit again:
Try to put this at the top of the program:
Code: Select all
#WINSTA_ALL = #WINSTA_WRITEATTRIBUTES | #WINSTA_READSCREEN | #WINSTA_EXITWINDOWS | #WINSTA_ENUMERATE | #WINSTA_ENUMDESKTOPS | #WINSTA_ACCESSCLIPBOARD | #WINSTA_ACCESSGLOBALATOMS | #WINSTA_CREATEDESKTOP
#DESKTOP_ALL = #DESKTOP_WRITEOBJECTS | #DESKTOP_SWITCHDESKTOP | #DESKTOP_READOBJECTS | #DESKTOP_JOURNALRECORD | #DESKTOP_JOURNALPLAYBACK | #DESKTOP_HOOKCONTROL | #DESKTOP_ENUMERATE | #DESKTOP_CREATEWINDOW | #DESKTOP_CREATEMENU
WindowStation = OpenWindowStation_("WinSta0", 1, #WINSTA_ALL)
SetProcessWindowStation_(WindowStation)
Desktop = OpenDesktop_("Winlogon", 0, 1, #DESKTOP_ALL)
SetThreadDesktop_(Desktop)
And this at the end:
Code: Select all
CloseDesktop_(Desktop)
CloseWindowStation_(WindowStation)
I think the window shows, but on the wrong window station and/or wrong desktop.
Posted: Wed Jun 14, 2006 6:37 am
by nessie
Trond,
I tried your code, but it didn't work as there is no-one logged into the pc. I'll try and explain better.
When I turn on an XP proffessional desktop which is a member of a domain, it boots up to a login prompt. The service I have written runs and connects to a streaming media server. This part all works fine and I can hear it playing from the pc. I want to display a window with a button on it which tells them that a broadcast is taking place and allows someone to stop it playing without having to login.
I can get it to play at a certain time and stop after a certain time, but I just can't get the window to appear. I have only ever seen one application that can do this, so there has to be away. Thanks for trying anyway.
Posted: Wed Jun 14, 2006 6:38 am
by netmaestro
I can't help, but how about having the program react to a hot key? Could you do that in the meantime until you find the solution?
Posted: Wed Jun 14, 2006 9:42 am
by nessie
Yeah thanks netmaestro, I never thought of that. I'll give that a go and see if it works. if it does, it means I can get on with watching the Worldcup !!