查找飞秋的聊天窗口控件句柄

来源:互联网 发布:网站关键词优化查询 编辑:程序博客网 时间:2024/04/29 13:58

 提供一个子程序

szButtor       db 'Button',0
szButtor1 db '发送(&S)',0

szTring        db 'RichEdit20A',0

 

_Find proc uses ebx esi edi _lParam
 
   LOCAL @hAndle
   LOCAL @szBuffer[1028]:byte
   LOCAL @szBuffer1[1028]:byte
         xor eax,eax
         invoke lstrlen,addr szWindow
         
         dec eax
       ; .if eax==0
         invoke FindWindow,NULL,addr szCaption1
       ; .else
       ;  invoke FindWindow,NULL,addr szWindow
        ; .endif 
       .if eax
          mov hAndle2,eax
        invoke wsprintf,addr @szBuffer,addr szForMat1,eax
          invoke SetDlgItemText,hWinMain,IDC_EDT2,addr @szBuffer
          
            ;***********************************************************找到输入的句柄
       invoke FindWindowEx,hAndle2,NULL,addr szTring,NULL;hAndle2父窗口句柄,NULL,表示全部的子窗口,szTring控件的类型,null,标题
     
       mov hText,eax
       
       invoke GetWindowLong,hText,GWL_ID;获取控件ID
       mov dwID,eax
       
       add eax,1   ;控件ID+1就是下一个ID
       
       invoke GetDlgItem,hAndle2,eax   ;获取输入窗口句柄
       
       
       
       mov hText1,eax
 ;**************************************************************************************************找到发送句柄       
       invoke FindWindowEx,hAndle2,NULL,addr szButtor,addr szButtor1
       
         mov hButtor,eax
         
         mov eax,1
         
         mov dwBool,eax
        .else
         invoke MessageBox,hWinMain,addr szText1,0,MB_OK
         mov eax,0
         mov dwBool,eax
         
        .endif
      
         
          
         
        
             
 ret

_Find endp