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. I don't know how to do!?

I don't know how to do!?

Scheduled Pinned Locked Moved C / C++ / MFC
questionperformancetutorial
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.
  • S Offline
    S Offline
    Suyeong
    wrote on last edited by
    #1

    POINT Point; ::GetCursorPos(&Point); HWND hWnd = ::WindowFromPoint(Point); ::PostMessage(hWnd, WM_KEYDOWN, 'a', NULL); I sent a message WM_KEYDOWN to hWnd. It is activate on Windows Notepad.. but on games like need for speed, it isn't activate.. how do i do?

    R C 2 Replies Last reply
    0
    • S Suyeong

      POINT Point; ::GetCursorPos(&Point); HWND hWnd = ::WindowFromPoint(Point); ::PostMessage(hWnd, WM_KEYDOWN, 'a', NULL); I sent a message WM_KEYDOWN to hWnd. It is activate on Windows Notepad.. but on games like need for speed, it isn't activate.. how do i do?

      R Offline
      R Offline
      Ron Beyer
      wrote on last edited by
      #2

      Thats because it probably doesn't use the windows message pump for keyboard and mouse interaction.

      1 Reply Last reply
      0
      • S Suyeong

        POINT Point; ::GetCursorPos(&Point); HWND hWnd = ::WindowFromPoint(Point); ::PostMessage(hWnd, WM_KEYDOWN, 'a', NULL); I sent a message WM_KEYDOWN to hWnd. It is activate on Windows Notepad.. but on games like need for speed, it isn't activate.. how do i do?

        C Offline
        C Offline
        Captain Price
        wrote on last edited by
        #3

        Games like need for speed doesn't use the usual windows messages system. Your application responds when your window gets the message through WindProc and the message loop. The way which is used in games is entirely different. A cool video :- http://www.youtube.com/watch?v=XLCe-hQ8lgE[^]

        "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

        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