求助:用VB.NET编写一个锁定屏幕的程序?
求助:请用VB.NET编写一个锁定屏幕的程序,有一个活动窗口就是登录界面,用户只有在通过有效用户名和密码登录后才能进行其他操作。 要求: 1、用API函数 2、鼠标和键盘只能在当前的窗口进行操作 例如:像点开始——>关闭计算机后只能在当前提示框中操作一样 3、当前窗口不能被任意拖动、最大化、最小化 十万火急~~~万分感谢~~~~!!!
Private Sub cmdLockWorkstation_Click() Dim prev_value As Long Dim wid As Long Dim hgt As Long cmdLockWorkstation。
Enabled = False cmdUnlockWorkstation。Enabled = True cmdExit。Enabled = False ' Save the current size and position。
m_LastLeft = Left m_LastTop = Top m_LastWidth = Width m_LastHeight = Height ' Put the form on top of everything including ' the task bar。
wid = Screen。Width / Screen。TwipsPerPixelX hgt = Screen。Height / Screen。TwipsPerPixelY SetWindowPos hwnd, HWND_TOPMOST, 0, 0, wid, hgt, 0 ' Tell the system a screen saver is running。
SystemParametersInfo SPI_SCREENSAVERRUNNING, True, _ prev_value, 0 End Sub To unlock the workstation, the program uses SystemParametersInfo to tell the system that no screen saver is running。
Private Sub cmdUnlockWorkstation_Click() Dim prev_value As Long cmdLockWorkstation。Enabled = True cmdUnlockWorkstation。
Enabled = False cmdExit。Enabled = True ' Restore the size and position。 Move m_LastLeft, m_LastTop, m_LastWidth, m_LastHeight ' Tell the system no screen saver is running。
SystemParametersInfo SPI_SCREENSAVERRUNNING, False, _ prev_value, 0 End Sub 。
find in book
发给
既然已经选择用api函数了,为什么还要用vb.net呢,vb或者vc就搞定了……
答:Dim myFont As System.Drawing.Font Dim strName As String strName = "黑体" Dim myFon...详情>>
答:在 VS 2008中,我们就开发人员所关心的一些常见的使用场景在性能上作了很大的改进.我们对新的产品功能以及现有的产品功能都设置了明确的性能指标。 例如,对于新...详情>>