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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get the keyboard inputs

How to get the keyboard inputs

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 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.
  • V Offline
    V Offline
    Veeresh Hiremath
    wrote on last edited by
    #1

    Hi all, My application uses a spalsh screen for about 30 seconds and then the main window appears. During these if the user types any keyboard key ,the main window should appear immediately. My code looks like this: // *************** SPLASH SCREEN *********************** // create a temp. invisible wnd. as parent of splash screen if(m_wndOwner.m_hWnd == NULL) { LPCTSTR pstrOwnerClass = AfxRegisterWndClass(0); if ( !m_wndOwner.CreateEx(0, pstrOwnerClass, _T(""), WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, 0) ) return FALSE; } int nDelay = 30000; // Create and show the splash screen. CSplashWnd::ShowSplashScreen(nDelay, BMP_MICATECH_BIG, &m_wndOwner); Sleep(nDelay) ; Can any one tell me how to overcome these problem? Regards, Veeresh

    B H 2 Replies Last reply
    0
    • V Veeresh Hiremath

      Hi all, My application uses a spalsh screen for about 30 seconds and then the main window appears. During these if the user types any keyboard key ,the main window should appear immediately. My code looks like this: // *************** SPLASH SCREEN *********************** // create a temp. invisible wnd. as parent of splash screen if(m_wndOwner.m_hWnd == NULL) { LPCTSTR pstrOwnerClass = AfxRegisterWndClass(0); if ( !m_wndOwner.CreateEx(0, pstrOwnerClass, _T(""), WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, 0) ) return FALSE; } int nDelay = 30000; // Create and show the splash screen. CSplashWnd::ShowSplashScreen(nDelay, BMP_MICATECH_BIG, &m_wndOwner); Sleep(nDelay) ; Can any one tell me how to overcome these problem? Regards, Veeresh

      B Offline
      B Offline
      bmzhao
      wrote on last edited by
      #2

      Don't use Sleep(nDelay),Sleep will block keyboard input. Use OnTimer set delay time. Use OnKeyDown get the typed keyboard key

      1 Reply Last reply
      0
      • V Veeresh Hiremath

        Hi all, My application uses a spalsh screen for about 30 seconds and then the main window appears. During these if the user types any keyboard key ,the main window should appear immediately. My code looks like this: // *************** SPLASH SCREEN *********************** // create a temp. invisible wnd. as parent of splash screen if(m_wndOwner.m_hWnd == NULL) { LPCTSTR pstrOwnerClass = AfxRegisterWndClass(0); if ( !m_wndOwner.CreateEx(0, pstrOwnerClass, _T(""), WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, 0) ) return FALSE; } int nDelay = 30000; // Create and show the splash screen. CSplashWnd::ShowSplashScreen(nDelay, BMP_MICATECH_BIG, &m_wndOwner); Sleep(nDelay) ; Can any one tell me how to overcome these problem? Regards, Veeresh

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        You can use WM_KEYUP orWM_KEYDOWN did you try it?:)


        WhiteSky


        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