Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4588066
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:52:11+00:00 2026-05-21T21:52:11+00:00

MY application has had a mode for years where the customer can ‘disable access

  • 0

MY application has had a mode for years where the customer can ‘disable access to the OS’. Obviously this feature goes against the grain (at least as far as Windows is concerned) but there are installations where my App is the only program that should ever be visibile to a machine operator amd in this case such a feature is useful.

The technigue I used was built from several ‘layers’:

  1. Hide the taskbar and button.
  2. Disable task-switching.
  3. Disable my main form system icons.

To disable the taskbar I used:

// Get a handle to the taskbar and its button..
Taskbar := FindWindow('Shell_TrayWnd', Nil);
StartButton := FindWindow('Button', Nil);

// Hide the taskbar and button
if Taskbar <> 0 then
  ShowWindow( Taskbar, SW_HIDE );
if StartButton <> 0 then
  ShowWindow( StartButton, SW_HIDE );

// Set the work area to the whole screen
R := Rect( 0,0,Screen.Width,Screen.Height );
SystemParametersInfo(
  SPI_SETWORKAREA,
  0,
  @R,
  0 );

This worked well and still seems fine on W7.
Researching how to disable task-switching some years ago turned up the only technique of ‘pretending’ that your App is a screen saver (other than terrible things like renaming your app to ‘explorer.exe’ and booting into it etc):

procedure EnableTaskSwitching( AState : boolean );
// Enables / disables task switching
begin
  SystemParametersInfo(
    SPI_SCREENSAVERRUNNING,
    Cardinal( not AState),
    nil,
    0 );
end;

Not surprisingly this seems to have no effect in W7 (I think it works in XP etc).
Does anyone know of another, better, way of enabling / disabling Alt-Tab (and other special windows keys) from working?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:52:12+00:00Added an answer on May 21, 2026 at 9:52 pm

    If found a solution:

    function LowLevelKeyboardProc(nCode: integer; wParam: WPARAM; lParam: LPARAM):
      LRESULT; stdcall;
    type
      PKBDLLHOOKSTRUCT = ^TKBDLLHOOKSTRUCT;
      TKBDLLHOOKSTRUCT = record
        vkCode: cardinal;
        scanCode: cardinal;
        flags: cardinal;
        time: cardinal;
        dwExtraInfo: Cardinal;
      end;
    
      PKeyboardLowLevelHookStruct = ^TKeyboardLowLevelHookStruct;
      TKeyboardLowLevelHookStruct = TKBDLLHOOKSTRUCT;
    const
      LLKHF_ALTDOWN = $20;
    var
      hs: PKeyboardLowLevelHookStruct;
      ctrlDown: boolean;
    begin
    
      if nCode = HC_ACTION then
      begin
    
        hs := PKeyboardLowLevelHookStruct(lParam);
        ctrlDown := GetAsyncKeyState(VK_CONTROL) and $8000 <> 0;
        if (hs^.vkCode = VK_ESCAPE) and ctrlDown then
          Exit(1);
        if (hs^.vkCode = VK_TAB) and ((hs^.flags and LLKHF_ALTDOWN) <> 0) then
          Exit(1);
        if (hs^.vkCode = VK_ESCAPE) and ((hs^.flags and LLKHF_ALTDOWN) <> 0) then
          Exit(1);
        if (hs^.vkCode = VK_LWIN) or (hs^.vkCode = VK_RWIN) then
          Exit(1);
    
      end;
    
      result := CallNextHookEx(0, nCode, wParam, lParam);
    
    end;
    
    procedure TForm1.FormShow(Sender: TObject);
    begin
      SetWindowsHookEx(WH_KEYBOARD_LL, @LowLevelKeyboardProc, 0, 0);
    end;
    

    This disables (as you can see!)

    • Ctrl+Esc (show start menu)
    • Alt+Tab (task switch)
    • Alt+Esc (task switch)
    • Win (show start menu)
    • Win+Tab (3D task switch)
    • Win+D, Win+M, Win+Space, Win+Arrows, Win+P, Win+U, Win+E, Win+F, Win+Digit, …
    • Almost any combination including the Windows key (but not all, e.g. Win+L)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a large and old C++ application that has had many
Has anyone had any experience using Adobe Air to create BitTorrent application? Is there
My application has multiple SQLite tables(around 20 with different fields). This I have created
We are working on a restful application that has a 'whiteboard' like feature. I
My application has just started exhibiting strange behaviour. I can boot it through the
Since the early days, Palm OS has had a special easter egg mode that's
I have a .NET 2.0 application that has recently had contributions that are Service
I had an issue that a Win32 application has huge performance difference between debug
Has anyone had any experiences developing large Java applications using GNU gettext for internationalization?
My application has one activity which starts two services but does not bind them.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.