Openwindow() question

Just starting out? Need help? Post your questions and find answers here.
nessie
User
User
Posts: 60
Joined: Mon Jul 07, 2003 1:19 pm
Location: Glasgow / Scotland
Contact:

Openwindow() question

Post 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.
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post 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.
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post by Konne »

Why do all this newbie start with programs wich make evil things?
Apart from that Mrs Lincoln, how was the show?
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

Hahaha Konne! Be glad this isn't a VB forum or similar :P
nessie
User
User
Posts: 60
Joined: Mon Jul 07, 2003 1:19 pm
Location: Glasgow / Scotland
Contact:

Post 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
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

:oops:
I don't know how to create a service. Could you tell me how please?
BERESHEIT
nessie
User
User
Posts: 60
Joined: Mon Jul 07, 2003 1:19 pm
Location: Glasgow / Scotland
Contact:

Post 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
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post 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!
BERESHEIT
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
nessie
User
User
Posts: 60
Joined: Mon Jul 07, 2003 1:19 pm
Location: Glasgow / Scotland
Contact:

Post 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.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post 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?
BERESHEIT
nessie
User
User
Posts: 60
Joined: Mon Jul 07, 2003 1:19 pm
Location: Glasgow / Scotland
Contact:

Post 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 !!
Post Reply