Findwindow and SendMessage

前端 未结 3 1790
北海茫月
北海茫月 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:47

    Use Postmessage instead of Sendmessage

    Public Const WM_SYSKEYDOWN = &H104
    
    PostMessage hwnd, WM_SYSKEYDOWN, vbKeyF, 2 ^ 29 
    
    'Simulates Alt + F (2^29 sets the 29 bit of lParam indicating Alt is being pressed.
    

提交回复
热议问题