Results 1 to 9 of 9

Thread: Disable/enable Alt only

  1. #1

    Thread Starter
    Addicted Member g-mie's Avatar
    Join Date
    Jan 2004
    Location
    EarTh
    Posts
    212

    Disable/enable Alt only

    Hello Gurus

    How to disable/enable Alt button ONLY on WinXP?

    Thanks

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Disable/enable Alt only

    Are you asking for your own application only? Explain with more detail. As a keyboard user vs mouse user, I'd be really irate if my Alt keys stop working, especially Alt+Tab which I use a ton.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Disable/enable Alt only

    Yes, disabling any key(s) should be for your app only as anything else is just too irratating. I would quickly uninstall an app that did that.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Addicted Member g-mie's Avatar
    Join Date
    Jan 2004
    Location
    EarTh
    Posts
    212

    Re: Disable/enable Alt only

    It is not just for my app only.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Disable/enable Alt only

    So, you want to toggle the ability to use the ALT key?

    You would need to code the KeyDown event of the Form, but before I could supply an example I would need to know under what conditions should you be able to use ALT and under what conditions should you not be able to use ALT.

  6. #6

    Thread Starter
    Addicted Member g-mie's Avatar
    Join Date
    Jan 2004
    Location
    EarTh
    Posts
    212

    Re: Disable/enable Alt only

    Here the condition.
    I have a third party software. This software running in full screen mode and always on top.
    So, I want to avoid the user from closing this software by using Alt-F4. That why I want to disable ALT button all the time and it will running at background.

    Extra info;
    1-The third party software is Library Management System(Client Module).

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Disable/enable Alt only

    So, this is a program to which you do not have access to the source code, right?

    This means it would be more than just this app. You can't alter the source, because you don't have it, so this would have to be something done across the system which would mean the ALT key wouldn't be available to anything.

    What is bad about the user closing it? There are more ways than just ALT-F4. I would assume this software has its own close buttons/features. How are you going to disable them?

  8. #8

    Thread Starter
    Addicted Member g-mie's Avatar
    Join Date
    Jan 2004
    Location
    EarTh
    Posts
    212

    Re: Disable/enable Alt only

    Yes. The library system, I bought from the Shelf.
    And this library system can be close by using Alt-F4.

    I hope, I can have sample code to disable Alt-F4 here.

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Disable/enable Alt only

    But since you have no access to the source code for the third party software you cant add code to it to disable alt+f4. You will need to write an app that subclasses the third party app and intercepts the alt+f4 message but then how would you propose it ever gets closed?

    This will need to be a VB6 & C++ solution.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width