Solved

Simple one... you think? - for the experts.

Posted on 2000-05-09
7
238 Views
Last Modified: 2013-12-03
I kinda asked this before, but now I really need the answer.

I need some source, small and simple, in Visual C or Delphi, that runs on Windows 2000, that disables the Windows key.

Thanks in advance.
0
Comment
Question by:Sadam
7 Comments
 

Expert Comment

by:afzalj
Comment Utility
Bit short for time, but you could:
hook the keyboard using SetWindowsHookEx(WH_KEYBOARD, ......),
and scan for the keycode for the windows-key ?
0
 

Author Comment

by:Sadam
Comment Utility
I started out that way.

First of all you use WH_KEYBOARD_LL and not WH_KEYBOARD.

Didn't work out too well though.

I managed to hook the Windows key and stop windows from seeing it, but the key doesn't release. Therefor any key I press after that becomes a combination of the Windows key and that new key.

This must be the right way to do it, but I need some help... some source.

-out.
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
A quick&dirty solution would be

char c;
// disable key
SystemParametersInfo ( SPI_SCREENSAVERRUNNING, 1, (void*) &c, 0);

char c;
// enable key
SystemParametersInfo ( SPI_SCREENSAVERRUNNING, 0, (void*) &c, 0);

(haven't tried it on Win2k)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Sadam
Comment Utility
jkr.

In my opinion it should be the sollution, but MS removed it in windows 2000.

My guess is, to keep a stable OS.
Now any key pressed on a screen saver just returns you to the login screen.

So... Unfortunately it doesn't work on 2000.

-out.
0
 
LVL 2

Accepted Solution

by:
waseemanis earned 100 total points
Comment Utility
Try using pretranslatemessage to capture the messages and then do nothing if the key Code is VK_LWIN & VK_WIN


Tell me if you need the code

Luck,
Waseem
0
 

Author Comment

by:Sadam
Comment Utility
Sorry I only comment now.
I've been very busy lately...

I tried a quick test this morning on the PreTranslateMessage, but can't get it to work.

Could you send me some source please.
Just a Hello World.

Thanks.

-out.
0
 

Author Comment

by:Sadam
Comment Utility
Waseemanis...

You got some code for me please???

I need it urgently.

-out.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now