Show window before logon in NT

Posted on 2003-02-28
Medium Priority
Last Modified: 2010-04-07
I need to know how to show a window before someone logs in in an OS such as NT/2K/XP. I have seen this done with programs such as the Cisco VPN client. I know that it requires the program to start as a service, and that you have to do work with the desktops and stuff. I just don't know what to do exactly.
Question by:MNetwork
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8046343
I think if you put a string containing your programs path and filename into this key, it will run before someone signs on.


So this would be your code:
'Begin code:
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Const REG_SZ = 1

Sub SaveString(hKey As Long, strPath As String, strValue As String, strData As String)
    Dim Ret
    'Create a new key
    RegCreateKey hKey, strPath, Ret
    'Save a string to the key
    RegSetValueEx Ret, strValue, 0, REG_SZ, ByVal strData, Len(strData)
    'close the key
    RegCloseKey Ret
End Sub

Private Sub Form_Load()
SaveString "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", , App.Title, App.Path & "\" & App.EXEName
End Sub
'End code.

I haven't tested it, so I wouldn't recommend running it without reviewing it.

Author Comment

ID: 8047604
This code wouldn't even work in that os. All you are doing is adding a registry entry that tells windows to run that program AFTER logon.

Expert Comment

ID: 8063201
I guess if you made a DOS compatible program to load Windows then load yours you could put it in the autoexec.bat file. But it might be a different file on different versions of windows. Like autoexec.nt. You could make a program like that with the old QBasic and Quick Basic compilers. I'm pretty sure that's how Nevell did it.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

ID: 8063206
Or you could just put the command to open your program after the "load Windows" commands. But, theres still the problem of the right autoexec file...

Author Comment

ID: 8071047
OMG, ok, first of all win nt/2k/xp don't use autoexec.bat like that, just 9x. Second even if they did they wouldn't run a win32 file. This is more advanced then you guys can handle. You have to do things with security desktops and stuff.

Expert Comment

ID: 8940424
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
LVL 49

Expert Comment

ID: 9001702
MNetwork, an EE Moderator will delete this for you.
Moderator, my recommended disposition is:

    DELETE this question (refund points).

DanRollins -- EE database cleanup volunteer
LVL 28

Accepted Solution

vinnyd79 earned 400 total points
ID: 9004123
The only way to show a window before login is to rewrite the msgina.dll
Here is some info on msgina.dll


Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question