Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1033857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:17:50+00:00 2026-05-16T14:17:50+00:00

Hello there I have a issue related to the usage of the bitmap enabled

  • 0

Hello there I have a issue related to the usage of the bitmap enabled Dialog window.I have created a keyboard type layout and i wish to get the input through keyboard also.When i use the mouse I am able to get the button(s) pressed and also all the buttons are working fine – the other images DEFAULT,SELECTED,DISABLED ..all get loaded and work since I am using the function here m_BtnBtn1Ctrl.LoadBitmaps ,But then any key pressed on keyboard and the corresponding character on the screen isn’t able to do the same as I have been able to do it with clicking of the mouse(and using the Loadbitmaps() function ).

I am using these 3 functions to achieve the same action and effect as that using a mouse
LoadBitmap()
SetBitmap()
Invalidate()

I also tried this piece of code

HBITMAP hbm = (HBITMAP)LoadImage(NULL, "\\res\\Selected\\bitmap21.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);

and

bitmap.Attach((HBITMAP)LoadImage(NULL, "\\res\\Selected\\bitmap21.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION));

but these don’t seem to give the pressed button effect though internally they work.Can some one please help me with this

Thanks and regards
Sayonee

Collapse

BOOL KeyBoard_press::PreTranslateMessage(MSG* pMsg)
{
    // TODO: Add your specialized code here and/or call the base class
    CString strTemp;
    if (pMsg->message == WM_KEYDOWN)
    {
        if ( pMsg->wParam == 0x41 || pMsg->wParam == 0x61) //check for both 'a' and 'A'
            OnBtnBtn1();
        if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_DELETE ||
            pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_TAB ||
            pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN || GetKeyState (VK_CONTROL))
            {
                ::TranslateMessage (pMsg);
                ::DispatchMessage (pMsg);
                return TRUE;                // DO NOT process further
            }
    }
    return CDialog::PreTranslateMessage(pMsg);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:17:50+00:00Added an answer on May 16, 2026 at 2:17 pm

    As far as I understand, you have a series of buttons that simulate a computer keyboard layout. whenever the user presses a key on the keyboard, you need to simulate a button click in your dialog box. You have provided bitmaps for each state of each button.

    To do this, I would process the WM_KEYDOWN and WM_KEYUP messages. In the handlers, use some mapping of the key to the actual button instance. Then, send the BM_SETSTATE to the button control.

    Then, process the WM_COMMAND message from each of the buttons and check for the BN_CLICKED code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have an issue deploying my silverlight project to an existing website (normal
Hello i have a question, i write a requirement specification. there is a system,
Hello friends a newbie question... The Issue is like this: I have a static
Hello guys I am working on silverlight and I have issue regarding on database
Hello I have an issue with debugging code of my UserControls. I am adding
Hello there and Merry Christmas !!! I am new to WPF and I am
Is there the equivalent of the Hello World program for GIS applications? I am
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Related to my SO issue at Dojo extending dojo.dnd.Source, move not happening. Ideas? I
I'm having a strange issue with some @font-face text where there is some strange

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.