Auto selectable menu.

Auto selectable menu.

Postby HunterEC » Mon Jul 04, 2011 6:22 am

Guys:

I had a small program to rebuild all indexes from all tables (20+), the menu allows the user to select the specific table that will get its indexes recreated. Some tables got over 500,000 records. Instead of having the user wait for each table to complete its course, how can I, via an menu option, put in the keyboard buffer the accelerator key for each option ? In the old Clipper days this was done with the KEYBOARD command or with the KEYSEND() function. Any ideas ? Thank you.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am


Re: Auto selectable menu.

Postby HunterEC » Mon Jul 04, 2011 8:55 am

Enrico:

Thank you for your response. Can the ACCELERATOR keys be put in the keyboard buffer, for example Alt-I ?
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am


Re: Auto selectable menu.

Postby MaxP » Mon Jul 04, 2011 4:40 pm

Add to source keybrd.c the function
Code: Select all  Expand view

CLIPPER __PUTACCKEY( PARAMS )
{
   int vKeyAcc = _parni( 1 ), vKey = _parni( 2 );
   
   PostVirtualKeyEvent( vKeyAcc, FALSE );

   PostVirtualKeyEvent( vKey, FALSE );
   PostVirtualKeyEvent( vKey, TRUE );

   PostVirtualKeyEvent( vKeyAcc, TRUE );

   SysRefresh();
}
 


Example:

__PUTACCKEY( VK_MENU, VK_F2 ) // Alt + F2
__PUTACCKEY( VK_CONTROL, VK_F3 ) // Control + F3

Best regards
Massimo :wink:
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Auto selectable menu.

Postby HunterEC » Mon Jul 04, 2011 5:23 pm

Massimo:

Thank you. I'll give it a try.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 79 guests