[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Trapping Windows button

Posted on 1998-01-26
8
Medium Priority
?
218 Views
Last Modified: 2010-04-04
I am not sure if this is an easy task but:

how can i  trap the Windows button??

Regards
Keith
0
Comment
Question by:keithcsl
[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
  • 5
  • 2
8 Comments
 
LVL 4

Expert Comment

by:d003303
ID: 1357565
Hum, Windows button ? Do you mean the minimize/maximize buttons on the title bar ?
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357566
You mean the new windows button on the keyboard (win95 ,NT)?
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357567
I believe, you have to check for the VK_LWin or VK_RWin key.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Accepted Solution

by:
ZifNab earned 80 total points
ID: 1357568
This should it be, if I correctly understood the question :

Use Plain form, copy this source to the unit, run it and push left or right window button on keyboard.

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, DtEdit97;

type
  TForm1 = class(TForm)
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
  var i : integer;
begin
 If Key = VK_LWIn then showmessage('left');
 if key = vk_RWin then showmessage('right');
end;

end.

Regards,
ZifNab;
0
 
LVL 1

Author Comment

by:keithcsl
ID: 1357569
I am so soree but I meant the Windows key on the keyboard. Should have made my question more clearly..

Keith
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357570
Keithcsl, the source code I gave you is meant for the windows key on the keyboard!!! The left and the right one!
0
 
LVL 1

Author Comment

by:keithcsl
ID: 1357571
ZifNab

Oh my, I am sorry for not reading your answer properly. The code works fine. Thanx!

If it is not too much to ask, is there a way to cancel the Keydown event?, ie i don't want the user to be able to press the Windows Key.

Thanx
Keith
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357572
Hi Keith,
I don't know really, it seems that the key is directely sended to windows. You can't just assign another value to Key as normally. I'll try to find a solution, but I can't promise anything.
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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 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