各版本的windows,从95开始,如何取得登录消息?

解决方案 »

  1.   

    在NT/2000中交互式的登陆支持是由WinLogon调用GINA DLL实现的,GINA DLL提供了一个交互式的界面为用户登陆提供认证请求。WinLogon会和GINA DLL进行交互,缺省是MSGINA.DLL(在System32目录下)。微软同时也为我们提供了接口,我们可以自己编写GINA DLL来代替MSGINA.DLL。WinLogon初始化时会创建3个桌面:
    (1)、winlogon桌面:主要显示Windows 安全等界面,如你按下CTRL+ALT+DEL,登陆的界面等
    (2)、应用程序桌面:我们平时见到的那个有我的电脑的界面
    (3)、屏幕保护桌面:屏幕保护显示界面。在默认情况下,GINA显示登陆对话框,用户输入用户名及密码 。所以要获得用户名和密码 ,则可以写一个新的GINA DLL.GINA 函数一览表 函数  描述 
    WlxActivateUserShell 激活用户外壳程序 
    WlxDisplayLockedNotice 允许GINA DLL 显示锁定信息 
    WlxDisplaySASNotice  当没有用户登陆时,Winlogon调用此函数 
    WlxDisplayStatusMessage Winlogon 用一个状态信息调用此函数进行显示 
    WlxGetConsoleSwitchCredentials  Winlogon调用此函数读取当前登陆用户的信任信息,并透明地将它们传到目标会话 
    WlxGetStatusMessage  Winlogon 调用此函数获取当前状态信息 
    WlxInitialize  针对指定的窗口位置进行GINA DLL初始化 
    WlxIsLockOk  验证工作站正常锁定 
    WlxIslogoffOk  验证注销正常 
    WlxLoggedOnSAS  用户已登陆并且工作站没有被加锁,如果此时接收到SAS事件,则Winlogon 调用此函数 
    WlxLoggedOutSAS  没有用户登陆,如果此时收到SAS事件,则Winlogon 调用此函数, This indicates that a logon attempt should be made 。 
    WlxLogoff  请求注销操作时通知GINA DLL  
    WlxNegotiate  表示当前的Winlogon版本是否能使用GINA DLL 
    WlxNetworkProviderLoad  在加载网络服务提供程序收集了身份和认证信息后,Winlogon 调用此函数 
    WlxRemoveStatusMessage  Winlogon 调用此函数告诉GINA DLL 停止显示状态信息 
    WlxScreensaverNotify  允许GINA与屏幕保护操作交互 
    WlxShutdown  在关闭之前Winlogon 调用此函数,允许GINA实现任何关闭任务,例如从读卡器中退出智能卡 
    WlxStartApplication  当系统需要在用户的上下文中启动应用程序时调用此函数 
    WlxWkstaLockedSAS 当工作站被锁定,如果接收到一个SAS,则Winlogon 调用此函数 
      

  2.   

    我是要在登录的时候做些处理那就用楼上说法,自己重写gina
    http://www.vckbase.com/code/listcode.asp?mclsid=13&sclsid=&page=2
    WINDOWS 2000下获得用户登录名和密码
      

  3.   

    如果只在2000和XP下,我的要求还不需要重写gina,重写gina会带来很多麻烦。
    我是想问有没有什么简单一些的方法可以搞定,例如收到消息什么的。
      

  4.   

    如果系统上启用了终端服务,那么可以监视终端服务的事件。
      
    Platform SDK: DLLs, Processes, and Threads 
    Receiving Events in a Service
    A service that is a console application can register a console control handler to receive notification when a user logs off. However, there is no event sent when an interactive user logs on. To determine whether an interactive user is logged on, verify that the process specified in the following key is running:HKEY_LOCAL_MACHINE\SOFTWARE\
         Microsoft\
              Windows NT\
                   CurrentVersion\
                        Winlogon
    This process is started when an interactive user logs onto a system. Therefore, if this process is running, there is an interactive user logged on. To obtain a list of all running processes, see Enumerating All Processes.The system broadcasts device change events to all services. These events can be received by a service in a window procedure or in its service control handler. To specify which events your service should receive, use the RegisterDeviceNotification function.Be sure to handle Plug and Play device events as quickly as possible. Otherwise, the system may become unresponsive. If your event handler is to perform an operation that may block execution (such as I/O), it is best to start another thread to perform the operation asynchronously.When a service calls RegisterDeviceNotification, the service also specifies either a window handle or a service status handle. If a service specifies a window handle, the window procedure receives the notification events. If a service specifies its service status handle, its service control handler receives the notification events. For more information, see HandlerEx.Device notification handles returned by RegisterDeviceNotification must be closed by calling the UnregisterDeviceNotification function when they are no longer needed.
    Command what is yours
    Conquer what is not