15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


problem in providing hot keys for bitmap buttons

Mahesh Apte -- mahesha@surya.trddc.ernet.in
Wednesday, November 13, 1996

Environment : windows 95, VC++ 1.51

Hi there,

	In our project we are extensively using  bitmap buttons. We have =
provided hot keys 	for all buttons such as Alt-c for Cancel. For each =
bitmap button, there is a static field
	which will explain the functionality of the button and it's hot key. So =
the text in=20
	the static control will expalin the hot key and when the key is pressed =
it will go=20
	to the specific button message handler.

	V have impelmented it in following way..

	We are using AutoLoad function for loading bitmap button. So in the =
button caption
	and bitmap name we are preceding & before the actual character such as=20
	&CANCEL for cancel button. and for static controls , instead of using=20
	SetWindowText we are using DrawText after getting device context of the =
static
	control for setting the text alongwith the hot keys like "&Cancel".=20

	This implementation works. But it's behaviour is very unpredictable. =
Sometime it=20
	gives GPF in user.exe or gives assertion in wincore.cpp line 208. This =
also works
	for the views and dialogs which do not have accelerators.=20

	So will somebidy help me ?? Am I doing anything wrong?? Is there any =
other better
	solution ??

							Regards ,+
							Maha





T.K.Wessing -- tkw@xs4all.nl
Friday, November 15, 1996

Try Accelerator keys

/=====================================
|  T.K.Wessing
|  Senior Software Engineer
|  Caledon systems international BV
|  The Netherlands
|  Private E-Mail:
|  tkw@xs4all.nl
\=====================================
The Nedherlands ?
Yep, "The Nedherlands" It does exists indeed!


----------
From: Mahesh Apte 
To: 'mfc-l@netcom.com'
Subject: problem in providing hot keys for bitmap buttons
Date: Wednesday, November 13, 1996 12:13 PM

Environment : windows 95, VC++ 1.51

Hi there,

	In our project we are extensively using  bitmap buttons. We have provided
hot keys 	for all buttons such as Alt-c for Cancel. For each bitmap button,
there is a static field
	which will explain the functionality of the button and it's hot key. So
the text in 
	the static control will expalin the hot key and when the key is pressed it
will go 
	to the specific button message handler.

	V have impelmented it in following way..

	We are using AutoLoad function for loading bitmap button. So in the button
caption
	and bitmap name we are preceding & before the actual character such as 
	&CANCEL for cancel button. and for static controls , instead of using 
	SetWindowText we are using DrawText after getting device context of the
static
	control for setting the text alongwith the hot keys like "&Cancel". 

	This implementation works. But it's behaviour is very unpredictable.
Sometime it 
	gives GPF in user.exe or gives assertion in wincore.cpp line 208. This
also works
	for the views and dialogs which do not have accelerators. 

	So will somebidy help me ?? Am I doing anything wrong?? Is there any other
better
	solution ??

							Regards ,+
							Maha


----------





| Вернуться в корень Архива |