Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #10329
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "Karl-Heinz" <invalid@invalid.invalid> |
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: a short question |
| Date | Thu, 23 Mar 2017 09:16:54 +0100 |
| Lines | 70 |
| Message-ID | <ejhejrF2933U1@mid.individual.net> (permalink) |
| References | <128a2508-a92e-4dcd-862b-08b5bb3fd113@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; format=flowed; charset="UTF-8"; reply-type=original |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net uTnIpmqzt4bG73ODQyAbGwG6Dp6N9Wtk3L25p4bVVlKMcMyAY= |
| Cancel-Lock | sha1:hnv2aOCa/bYGEKRC91wz4nF09pc= |
| In-Reply-To | <128a2508-a92e-4dcd-862b-08b5bb3fd113@googlegroups.com> |
| X-Priority | 3 |
| X-MSMail-Priority | Normal |
| Importance | Normal |
| X-Newsreader | Microsoft Windows Live Mail 16.4.3564.1216 |
| X-MimeOLE | Produced By Microsoft MimeOLE V16.4.3564.1216 |
| Xref | csiph.com comp.lang.clipper.visual-objects:10329 |
Show key headers only | View raw
Hi Gunter,
> how can I catch a function key pressed in a dialog window without any edit
> control?
Here“s a sample how to trap e.g. the key F9. Each time the window is
activated the key will be registered, otherwise unregistered.
----------------
METHOD Dispatch ( oEvent ) CLASS YourDlg
DO CASE
CASE oEvent:message == WM_HOTKEY
SELF:OnHotKey ( oEvent:wparam )
ENDCASE
RETURN SUPER:Dispatch ( oEvent )
------------------
METHOD OnHotKey ( dwKey ) CLASS YourDlg
DO CASE
CASE dwKey ==101
? "Hotkey F9 pressed"
ENDCASE
RETURN SELF
METHOD Activate(oEvent) CLASS YourDlg
SUPER:Activate(oEvent)
SELF:__RegisterHotkeys( TRUE )
RETURN NIL
------------------
METHOD Deactivate(oEvent) CLASS YourDlg
SUPER:Deactivate(oEvent)
SELF:__RegisterHotkeys( FALSE )
RETURN NIL
-------------------------------
METHOD __RegisterHotkeys ( lRegister ) CLASS YourDlg
IF lRegister
RegisterHotKey(SELF:Handle(), 101, 0 , VK_F9)
ELSE
UnregisterHotKey(SELF:Handle(), 101)
ENDIF
RETURN SELF
regards
Karl-Heinz
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
a short question Gunter <g.huebner@dsh-anklam.de> - 2017-03-22 02:44 -0700
Re: a short question Frans Wauters <info@wautersit.com> - 2017-03-22 04:33 -0700
Re: a short question Robert van der Hulst <rjvanderhulst@gmail.com> - 2017-03-22 06:34 -0700
Re: a short question Frans Wauters <info@wautersit.com> - 2017-03-23 16:25 -0700
Re: a short question "Karl-Heinz" <invalid@invalid.invalid> - 2017-03-23 09:16 +0100
Re: a short question Gunter <g.huebner@dsh-anklam.de> - 2017-03-23 02:36 -0700
csiph-web