Solved

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

Posted on 2000-05-09
7
244 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
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Title # Comments Views Activity
Is AWS.RDS considered a part of "Big Data"? 4 114
Is COM supported from Apache 1 64
Why is "packages element is not declared"? 2 325
Question to Pivot table 1 63
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 …
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…

860 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