Solved

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

Posted on 2000-05-09
7
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Expert Comment

by:afzalj
ID: 2795926
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
ID: 2796234
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
ID: 2797519
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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:Sadam
ID: 2799057
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
ID: 2809581
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
ID: 2820272
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
ID: 2837852
Waseemanis...

You got some code for me please???

I need it urgently.

-out.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 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