Highlighted
Absent Member.
Absent Member.
2490 views

[archive] Mscal.ocx

[Migrated content. Thread originally posted on 22 January 2004]

I'm using the Microsoft Calendar OCX in my application.
Everything just works fine, but the control doesn't respond to function keys !

I tried to call "C$GETEVENTDATE" when the method KEYPRESS is invoked, but it only respond to a-z 0-9 keys.

What can I do ?
Txs
0 Likes
13 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

Are you sure the component will accept function keys?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

Gisle,

I don't know how to check if the control can accept function keys.
Any way, I allways handle my exceptions (like function keys) in the exception handler. So I thought the control would pass the exception routine if I press a function key, but it doesn't.
regards
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

May I ask why you want to use function keys?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

I use function keys for many reasons. One of them is to exit my program (not escape). So if the focus is on the calendar-object, I wan't my users to be able to exit from there too.

For now, if a user press a date, I use CALL "W$KEYBUF" using 1, {^I}" to get another control focused but this isn't properly.
Any other suggestions ?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

Hans, have you tried compiling with -Vx switch?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

DanM,

Yes, my project is allways compiled with -Vx ...
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

Hans,

We are using the KeyDown event (instead of KeyPress) to capture all function keys from Microsoft's Calendar control. Then C$GETEVENTDATA gives us two variables. The first one is the function key where 112 is F1 and 113 is F2 and so on...

The second variable passed is whether the shift or control key, etc. was pressed.

I hope this helps you.

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

Rob,

Txs for the info .. it helps.
Still, the control won't react on F10, but that's no major problem.
Everything works just fine now.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

Hans,

Glad I can help. I think that Microsoft OWNS the F10 key, so that's probably why you don't get an event or something.

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

To use the F10 key in an AcuCOBOL-GT program you need to set the runtime configuration variable F10_IS_MENU to "0" otherwise MS Windows uses the key to activate program menus.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Mscal.ocx

Thanks, mnabbs! I wasn't aware of that config variable.

Rob
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.