Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[green]
//Define an accelerator object in your .h
[/green]
[blue]HACCEL myAccelerator[/blue]
[green]
//In your OnInitDialog Function in the cpp file, add this
[/green]
[blue]myAccelerator=LoadAccelerators(AfxGetInstanceHandle(),MAKEINTRESOURCE(MENU_PRIMARY_ACCEL));[/blue]
[green]
//Where MENU_PRIMARY_ACCEL is the resource name of the accelerator object
[/green]
[blue]
[green]//Add this function your class
//This is the Prototype for the .h[/green]
[red] BOOL PreTranslateMessage(Msg* pMsg);[/red]
BOOL CYourClass::PreTranslateMessage(MSG* pMsg) {
if (myAccelerator) {
if (::TranslateAccelerator(this->m_hWnd,myAccelerator, pMsg)) {
return(TRUE);
}
}
return CDialog::PreTranslateMessage(pMsg);
}
[/blue]