哪里有例子?谢谢?

解决方案 »

  1.   

    不知道楼主要求怎么个锁定法?
    这是用 Ctrl + Alt + Del 锁定的方法:#include <windows.h>#define IsWin2000Plus() ((DWORD)(LOBYTE(LOWORD(GetVersion()))) >= 5)int (__stdcall * MyLockWorkStation)();int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    {
    HINSTANCE hinstLib; if (IsWin2000Plus())
    {
    hinstLib = LoadLibrary("USER32.DLL"); if (hinstLib)
    {
    MyLockWorkStation = (int (__stdcall *)()) GetProcAddress(hinstLib, "LockWorkStation"); if (MyLockWorkStation != NULL)
    (MyLockWorkStation) ();
    } FreeLibrary(hinstLib);
    }
    else
    MessageBox(NULL, "This application requires Windows 2000 Professional or higher!", "Lock Workstation", MB_OK); return 0;
    }