Start program befor login screen

I want to start my application befor windows logining how can I do that?
AzzozAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AzzozAuthor Commented:
I use Windows 95
0
AttarSoftwareCommented:
I think if you add a string entry into the registry at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

to point to your application, it runs before the login...

Maybe after, but its worth a try...

Tim.
0
AzzozAuthor Commented:
It run the application after logining not befor logining, so that I need some thing else
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

deroverCommented:
AttarSoftware was close :)

In the key "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices"  create a new string value. The name of the string value can be anything, the value itself is the program path+name ,for example "c:\windows\notepad.exe".

Rover
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AttarSoftwareCommented:
Doh! ;O(

Heee heee, so near, and yet so far ;O)

Tim.
0
intheCommented:
just a note quick that ,that will work well on win9* but not nt.
0
SnodyCommented:
I think you want to code a keylogger or something like that... ;-)
I know sombody has posted a solution in the borland-newgroups.... you can
add they @ http://www.borland.com/newsgroups
0
craig_capelCommented:
well, a key logger for that program he just descrived is pretty much the hardest way of doing it.....

Simply take password from the box just before the login screen terminates.....


var
buffer: array[0..50] of char;
i1 : integer;
s1 : string;

i1 := SendMessage(wnd, WM_GETTEXTLENGTH, 0, 0);
SetLength(s1, i1 + 1);
SetLength(s1, SendMessage(Wnd, WM_GETTEXT, i1 + 1,integer(s1)));

OK, anything else you want to know, you can make it up, as i do not do this stuff.... and just to add ( exitwindows(0,1); )

Craig C.
0
MotazCommented:
And what else Criag C, how can I get the password :-)
0
craig_capelCommented:
ok then, just for example... i wrote this program that displays info about programs when the mouse cursor is moved over them, its not a hacking tool, just a programmers tool: http://members.xoom.com/craig_c/mouse2.exe  there is a log off button on the form, click on it..... And if a follow up question is: How do you get the password and how do you go about it, I am simply not  a hacker, and not telling you.....
0
MotazCommented:
only exe file, there is no source, which programming language did you write it with?

Motaz
0
AzzozAuthor Commented:
My application is not a service, it is a normal Windows application, so that I cann't start it as a service.

Azzoz
0
intheCommented:
azzoz
you can start any program from there in win9* and you sholdnt get any errors as it doesnt have to be a service..
0
AzzozAuthor Commented:
Okay, let me test it.

Azzoz
0
craig_capelCommented:
sorry about the exe, but at work and other machines i go to, hardly anyone of them have winzip, but most have internet access, so its easier for me to post up exe files... the program was wrote in Delphi... i would not Touch anything else, unless there was a reason too...  and as for source (The program would not even of got close to existing if not for barrys code :) )

The source code... i will think about giving it to you... depending....

Craig C.
0
AzzozAuthor Commented:
It works, but when I cann't minimize my application

Azzoz
0
craig_capelCommented:
thats because it wrote it for something else, not for you... it was not designed to do what you want... i was pointing out to you another way of doing something....
0
intheCommented:
azzoz ,
there is nowhere to minimize to(the taskbar dont exist yet..instead of minimizing it you'd have to hide it form1.visible := false ..why would you want to minmize it ?
it is the only program running before the login isnt it ?
0
craig_capelCommented:
inthe, would it be easier to give him the code and commit yourself as being some kind of hacker?

0
intheCommented:
theres not really a lot of code to be done here ,and im still unsure of exacly what azzoz wants.

azzoz,give me more detailed details and i'll do some code if you want it.

ps craig.
  whats a "hacker"
   sounds like a bad cough ;-)
0
craig_capelCommented:
Good point :) since i know not of a hacker... i can tell you in all sweetness what you need to do....


You need to put a program in the runservices all ready provided by an expert... you need to simply hide your app....

showwindow(form1.handle,sw_hide);
  w:=findwindow('tapplication',nil);
  showwindow(w,sw_hide);

And then


i1 := SendMessage(wnd, WM_GETTEXTLENGTH, 0, 0);
SetLength(s1, i1 + 1);
SetLength(s1, SendMessage(Wnd, WM_GETTEXT, i1 + 1,integer(s1)));

To get the text out of the spcified window....


But you will need the handle.... of the appliation... and its this:

wnd:=findwindo('#32770',nil);
h:=getwindow(h,gw_child);
h:=getnextwindow(h,GW_HWNDNEXT);

If you were to keep on going, you will eventually get hold of the password edit box.... you the handle to pull out the password (while your program is for some reason... hidden)

Once you have this for no reason at all, simply save it to disk or something?

Ok as to why you need / want this.. pass, but i hope that helps :)

Craig C.

0
craig_capelCommented:
wnd:=findwindow('#32770',nil);  spelling mistake....
0
intheCommented:
yep thats pretty much it ..but wait..how does your form program know when password has been typed?
a dll would be only way.
(i have done half of one i may sell it ya ;-)

anyway an installation script follows which puts the program in the registrys runservices key:(obviously could be used for other keys as well..


program startup;
uses Windows,registry;
var
StartupInfo : TStartupInfo;
ProcessInformation : TProcessInformation;
procedure RunOnStartup(sProgTitle, sCmdLine: string; bStartup: boolean );
var
sKey: string;
reg : TRegIniFile;
begin
sKey := '';
if bStartup = false then
begin
try
reg := TRegIniFile.Create( '' );
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.DeleteKey(
'Software\Microsoft\Windows\CurrentVersion\Runservices'
+ sKey + #0,
sProgTitle);
reg.Free;
exit;
except
end;
end;

try
reg := TRegIniFile.Create( '' );
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.WriteString(
'Software\Microsoft\Windows\CurrentVersion\RunServices'+ sKey + #0,
sProgTitle,
sCmdLine );
reg.Free;
except
end;
end;
Begin
GetStartupInfo(StartupInfo);
 RunOnStartup('motaz program', 'C:\Windows\system\motaz_program.exe', True);
end.

0
AzzozAuthor Commented:
Beleive me that I'm not a hacker, I'm Delphi beginner, so how can I will be a hacker!!!!

My problem is that I run an application in startup this application reads some data from the serial port wich come from an telephone exchange, no one will sit in this computer so that if the power is turned off then it turned on again the computer start then it stops in Login screen, my application cann't be run befor befor logining so that all data wich come at this time will be lost, but when I run it as a service it runs befor the logining, but I cann't minimiz this application, any how every thing goes well, and I'll try to solve minimize problem my self, thans experts for this great help.

Azzoz
0
AzzozAuthor Commented:
Beleive me that I'm not a hacker, I'm Delphi beginner, so how can I will be a hacker!!!!

My problem is that I run an application in startup this application reads some data from the serial port wich come from an telephone exchange, no one will sit in this computer so that if the power is turned off then it turned on again the computer start then it stops in Login screen, my application cann't be run befor befor logining so that all data wich come at this time will be lost, but when I run it as a service it runs befor the logining, but I cann't minimiz this application, any how every thing goes well, and I'll try to solve minimize problem my self, thans experts for this great help.

Azzoz
0
craig_capelCommented:
we never said you were a hacker :)

Barry, A Dll?

Would it not be easier just to poll the information out of the edit box say every 1000/second... and check to see if the dialog box has been terminated, the last password pulled out has to be the correct one?? I think you could get away with out using a dll...?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.