Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. entry question, thanks

entry question, thanks

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sean_Yang
    wrote on last edited by
    #1

    In my dialog function as following, the key_board input wouldn't get response, why? BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message) { case WM_INITDIALOG: ..... return TRUE; case WM_CHAR: switch(wParam) { case '1': record_data_pair(1); break; case '2': record_data_pair(2); break; case '3': record_data_pair(3); break; default: break; } return TRUE; } default: return FALSE; } Thanks Sean

    P A 2 Replies Last reply
    0
    • S Sean_Yang

      In my dialog function as following, the key_board input wouldn't get response, why? BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message) { case WM_INITDIALOG: ..... return TRUE; case WM_CHAR: switch(wParam) { case '1': record_data_pair(1); break; case '2': record_data_pair(2); break; case '3': record_data_pair(3); break; default: break; } return TRUE; } default: return FALSE; } Thanks Sean

      P Offline
      P Offline
      Peak
      wrote on last edited by
      #2

      hi maybe you havn't called TranslateMessage in your message loop. you know what's message loop, yes? any way this is a simple message loop: while(GetMessage(...)) { TranslateMessage(...); DispatchMessage(...); } hope it helps:)

      S 1 Reply Last reply
      0
      • P Peak

        hi maybe you havn't called TranslateMessage in your message loop. you know what's message loop, yes? any way this is a simple message loop: while(GetMessage(...)) { TranslateMessage(...); DispatchMessage(...); } hope it helps:)

        S Offline
        S Offline
        Sean_Yang
        wrote on last edited by
        #3

        NO, I guess you misunderstood the question. The code I posted is a callback function of a DIALOG, which is launched by the main window. i.e, that's not the main window's callback function. I have TranslateMessage in my WinMain() function. Any idea about this situation? Thanks Sean

        1 Reply Last reply
        0
        • S Sean_Yang

          In my dialog function as following, the key_board input wouldn't get response, why? BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message) { case WM_INITDIALOG: ..... return TRUE; case WM_CHAR: switch(wParam) { case '1': record_data_pair(1); break; case '2': record_data_pair(2); break; case '3': record_data_pair(3); break; default: break; } return TRUE; } default: return FALSE; } Thanks Sean

          A Offline
          A Offline
          Alvaro Mendez
          wrote on last edited by
          #4

          The only other recommendation is to debug the thing and check to see if it's even going into the function at all, when you press a key. Regards, Alvaro


          Well done is better than well said. -- Benjamin Franklin (I actually prefer medium-well.)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups