Findwindow and SendMessage

前端 未结 3 1921
北海茫月
北海茫月 2021-01-25 08:48

I am trying to figure out why this is not sending a ALT+F to notepad,

Private Declare Function FindWindow1 Lib \"user32\" Alias \"FindWindowA\" (ByVal lpClassNam         


        
3条回答
  •  半阙折子戏
    2021-01-25 09:36

    I think this is the problem: you're sending your message to the frame around the notepad window, and need to send it to the menu window. Use your handle with FindWindowEx and the 32768 class name (that's a menu) to get the menu window, which is a child of the one you've got the handle to. Here are two pages: http://msdn.microsoft.com/en-us/library/ms633500(v=VS.85).aspx and http://msdn.microsoft.com/en-us/library/ms633574(VS.85).aspx#class_name that should help.

提交回复
热议问题