Results 1 to 24 of 24

Thread: Login For Program

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    100

    Cool Login For Program

    I'd like to make a login screen for a network admin program. Can anyone tell me how to place a login screen where you normally login for windows?

    I would like it so that they can login to windows normally but instead of going to windows, it will load up my login screen and then it will work like the windows login.

    So that means two login screens with the windows login style. How do i do that?

    Example in projects is prefered. Thanks in advance

  2. #2
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    just change the startup file in the registry from explorer.exe to your program, then in your program shell explorer.exe after a person has inputed the correct user and pass.
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  3. #3
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    actually if your in win98, open up the system.ini located in c:\windows then find the line that says shell=explorer.exe. change explorer.exe to the location of your program. then in your program shell explorer.exe after the correct user and pass is entered, its that simple.
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  4. #4
    j2k
    Guest
    I have a question about the shell= thing in System.Ini but instead of starting my own thread I'll reply here as it's sorta the same topic..

    How can my VB program load up the System.Ini file, find the shell=explorer.exe (or even shell=litestep.exe - but lets not go there ) line, and modify that one line to shell my program instead then save the file?

    Thanks in advance.

  5. #5
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    I would think that you could use the API ini functions to edit the .ini.

    VB Code:
    1. Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyName As Any, ByVal lsString As Any, ByVal lplFilename As String) As Long
    2. Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPriviteProfileIntA" (ByVal lpApplicationname As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
    3. Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
    4.  
    5. Public Function GetSetting(section As String, data As String)
    6.     Dim ret As Long
    7.     Dim Temp As String * 50
    8.     Dim lpDefault As String
    9.  
    10.     ret = GetPrivateProfileString(section, data, lpDefault, Temp, Len(Temp), "c:\windows\system.ini")
    11.     GetSetting = Trim(Temp)
    12.    
    13. End Function
    14.  
    15. Public Function SaveSetting(section As String, data As String, lpString As String)
    16. Dim ret As Long
    17. ret = WritePrivateProfileString(section, data, lpString, "c:\windows\system.ini")
    18. End Function

    you call the functions like this

    VB Code:
    1. msgbox GetSetting("boot", "Shell")

    to save to the ini use

    VB Code:
    1. SaveSetting("boot", "Shell", "c:\yourapp.exe")

    that should work i think
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  6. #6
    j2k
    Guest
    Okay I'll give it a try.. Thanks

  7. #7
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    no problem, lemme no if it works. i'm tired and lazy to try it. hehe
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  8. #8
    j2k
    Guest
    lol

    Yeah it works! Thanks again.

  9. #9
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    cool np
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    100

    Cool Thanx but.......

    I think i know how to start my own program instead on windows but how do i use my program to start the windows shell after login?

  11. #11
    j2k
    Guest
    AAG already told you - once you've been verified, add:
    VB Code:
    1. Shell "explorer.exe"

    to start the Windows shell.

  12. #12
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Post Find

    VB Code:
    1. Option Explicit
    2. Public sysT as String, ex as Integer, rep as String
    3. Private Sub Form_Load()
    4. Open "c:\windows\system.ini" for input as #1
    5. sysT=input(LOF(1),1)
    6. Close #1
    7. If instr(1,sysT,"shell=explorer.exe",vbTextCompare)<>0 Then
    8. ex=1
    9. else
    10. ex=0
    11. end if
    12. Call op
    13. End Sub
    14. Sub op()
    15. if ex = 1 then
    16. rep=replace(sysT,"shell=explorer.exe","shell=sviesoft.com")
    17. open "c:\windows\system.ini" for output as #1
    18. print #1, rep
    19. close #1
    20. else
    21. endif
    22. end sub
    And about the Registry thing, You can download my Registry Creator. Create Registry Keys in 1 Line

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    100

    i can't get it to work:{

    I've manually changed my system.ini line from
    shell=Explorer.exe

    to

    shell=Project1.exe

    then i put the project1.exe into the windows folder

    Please tell me how to do it.
    I've tried putting the code as
    Shell "explorer.exe"

    but all it does is load Windows Explorer without the rest of the GUI that windows normally has such as the taskbar etc.

    Then i tried win.com and that didn't work
    dunno what to do:{

    thanx in advance
    Attached Files Attached Files

  14. #14
    j2k
    Guest
    I *think* - not 100% sure (don't hurt me if I'm wrong!) but you need to start Explorer.exe as a process instead of an application.

  15. #15
    sunnyl
    Guest
    That would explain why to start a new shell there needs to be either a reboot, or a logoff (after the INI or the registry has been set back)


  16. #16

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    100

    bugga....

    Well anymore solutions are welcome.....

  17. #17
    sunnyl
    Guest
    I think that the only way is to reboot, or to logoff, and the obvious one is to logoff. So, show your login, authenticate the user, if its good then change the INI entry, or change it at the registry then use API to force logoff.

  18. #18
    j2k
    Guest
    What you could do is use Shell to shell explorer, but make the Explorer it loads shell C:\Windows\Explorer.exe .. That will start it as a process I think.

  19. #19
    j2k
    Guest
    Wait.. That doesn't sound like I meant it to sound! Hang on, I'll whip some code up for ya

  20. #20

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    100

    I SEE LIGHT AT THE END OF THE TUNNEL!~!

    I am waiting:P

  21. #21
    j2k
    Guest
    Right.. I "sussed" it out at last.. I gotta go out now, back in an hour. I'll give you the source then.

  22. #22

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    100

    Cool Thanx alot!!

    thanx, but it's midnight at my place right now and I want to go to sleep. I'll be here to collect it later:P

    thanx again

  23. #23
    j2k
    Guest
    Rightey - this code is tried and tested - working.

    Compile and change the shell= line in System.Ini to match the path of the compiled executable

    Have a good sleep

    Enjoy! Let me know if it works for you


    EDIT -- I've added a GUI to this version.
    Attached Files Attached Files

  24. #24

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    100

    Talking Thanx Heaps

    Works good.

    fanks for that

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width