Lm th? no ? v hi?u ho cng vi?c chuy?n ?i trn n?n t?ng Win32

D?ch tiu ? D?ch tiu ?
ID c?a bi: 226359 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

? Trang ny


Bi vi?t ny m t? lm th? no ? v hi?u ho nhi?m v? chuy?n m?ch v cc ch?c nng h? th?ng truy c?p thng qua cc t? h?p phm CTRL + ESC v ALT + TAB trn n?n t?ng Win32.

Windows 95 v Windows 98

Cc ?ng d?ng c th? kch ho?t v v hi?u ho ALT + TAB v CTRL + ESC, v d?, b?ng cch g?i SystemParametersInfo (SPI_SETSCREENSAVERRUNNING). ? v hi?u ho ALT + TAB v CTRL + ESC, ?t tham s? uiParam thnh S? TH?T; ? cho php cc t? h?p phm, thi?t l?p cc thng s? ? SAI:
UINT nPreviousState;

// Disables task switching
SystemParametersInfo (SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0);

// Enables task switching
SystemParametersInfo (SPI_SETSCREENSAVERRUNNING, FALSE, &nPreviousState, 0);
Chu y Cc ?ng d?ng s? d?ng SystemParametersInfo (SPI_SETSCREENSAVERRUNNING) ? v hi?u ho nhi?m v? chuy?n m?ch ph?i b?t cng vi?c chuy?n ?i tr?c khi thot ho?c cng vi?c chuy?n m?ch v?n b? v hi?u ho sau khi ti?n tr?nh ch?m d?t.

Windows NT 4.0 Service Pack 3 v sau v Windows 2000

Cc ?ng d?ng c th? v hi?u ha ALT + TAB ho?c CTRL + ESC b?ng cch ci ?t m?t mc ? ? cao th?p bn phm. M?t mc ? ? cao th?p bn phm (WH_KEYBOARD_LL) ?c ci ?t b?ng cch g?i SetWindowsHookEx. ? bi?t thm thng tin v? c?a s? mc xem t?ng quan "Mc" trong cc ti li?u n?n t?ng SDK.

Sau y l m?t th? t?c mc ? ? cao th?p bn phm m?u v hi?u ho CTRL + ESC, ALT + TAB v ALT + ESC:
LRESULT CALLBACK LowLevelKeyboardProc (INT nCode, WPARAM wParam, LPARAM lParam)
    // By returning a non-zero value from the hook procedure, the
    // message does not get passed to the target window
    BOOL bControlKeyDown = 0;

    switch (nCode)
        case HC_ACTION:
            // Check to see if the CTRL key is pressed
            bControlKeyDown = GetAsyncKeyState (VK_CONTROL) >> ((sizeof(SHORT) * 8) - 1);
            // Disable CTRL+ESC
            if (pkbhs->vkCode == VK_ESCAPE && bControlKeyDown)
                return 1;

            // Disable ALT+TAB
            if (pkbhs->vkCode == VK_TAB && pkbhs->flags & LLKHF_ALTDOWN)
                return 1;

            // Disable ALT+ESC
            if (pkbhs->vkCode == VK_ESCAPE && pkbhs->flags & LLKHF_ALTDOWN)
                return 1;


    return CallNextHookEx (hHook, nCode, wParam, lParam);

Windows NT 4.0 Service Pack 2 v tr?c , Windows NT 3.51 v tr?c

Cc ?ng d?ng c th? v hi?u ho CTRL + ESC ton h? th?ng b?ng cch thay th? Windows NT Task Manager, nhng i?u ny l khng nn.

Cc ?ng d?ng c th? t?t ALT + TAB v ALT + ESC khi ?ng d?ng ang ch?y b?ng cch ng k? phm nng cho ALT + TAB v t? h?p ALT + ESC b?ng cch g?i RegisterHotKey.


Cng c? pht tri?n c? hn, ch?ng h?n nh Microsoft Visual C++ Phin b?n 5.0 v tr?c , c th? ch?a tiu ? cc t?p tin c?n thi?t ? xy d?ng m?t ?ng d?ng s? d?ng bn phm low-level mc. ? c ?c cc t?p tin tiu ? m?i nh?t, t?i SDK n?n t?ng m?i nh?t t? Microsoft Web site sau c?a:
B?i v? t?m th?p bn phm mc l m?t tnh nng ?c trng cho Windows NT 4.0 Service Pack 3 v sau , xc ?nh _WIN32_WINNT > = 0x0400 tr?c khi ? bao g?m winuser.h (hay windows.h).

Thu?c tnh

ID c?a bi: 226359 - L?n xem xt sau cng: 21 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft Win32 Application Programming Interface, khi ?c dng v?i:
    • Microsoft Windows Millennium Edition
    • Microsoft Windows 98 Standard Edition
    • Microsoft Windows 95
T? kha:
kbhook kbhowto kbinput kbmt KB226359 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:226359

Cung cp Phan hi


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com