就是在一个基于对话框的工程中需要一进入就获得自己添加的菜单的焦点,不知如何实现,急!是否有高手指点一下,在线等!

解决方案 »

  1.   

    对呀,就是这个意思,如果是获得按钮可以直接用SetFocus,可对于菜单就不灵了,不知如何进行?
      

  2.   


    HWND SetFocus(
      HWND hWnd   // handle to window to receive focus
    );The SetFocus function sets the keyboard focus to the specified window. The window must be associated with the calling thread's message queue. 
      

  3.   

    If the function succeeds, the return value is the handle to the window that previously had the keyboard focus. If the hWnd parameter is invalid or the window is not associated with the calling thread's message queue, the return value is NULL.