Solved

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

Posted on 2000-05-09
7
239 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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 explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

914 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

13 Experts available now in Live!

Get 1:1 Help Now