怎样列出当前所有窗体,然后从中找出一个想要的窗体,
使用sendmessage()向一个这个窗体发送消息比如Ctrl+s

解决方案 »

  1.   

    列出所有窗体可以用EnumWindow
    有个函数可以模似按键的,但记不清怎么拼写了,呵呵.
      

  2.   

    枚举窗口的方法请参考
    http://expert.csdn.net/Expert/topic/1402/1402037.xml?temp=.3236811
      

  3.   

    keyBD_Event是模拟按键的。不过 接收的是当前活动的窗体
    keyBD_Event(Byte(65),0,0,0)就是按下a
      

  4.   

    肯定要用sendMessage来做的,先发keyDOwn的消息,再发KeyUP的消息,来实现组合健
      

  5.   

    function EnumWindowsProc(AhWnd:LongInt;AForm:TForm1):boolean;
    var
    lpszClassName,lpszWindowText:array[0..254] of char;
    begin
    GetWindowText(AhWnd,lpszWindowText,254);
    GetClassName(AhWnd,lpszClassName,254);
    Aform.logs.items.add(StrPas(lpszWindowText)+'--------------------'+StrPas(lpszClassName));
    Result:=True;
    end;
    procedure TForm1.FormShow(Sender: TObject);
    begin
      EnumWindows(@EnumWindowsProc,LongInt(self));
    end;
    列出所有窗口
      

  6.   

    function EnumWindowsProc(AhWnd:LongInt;AForm:TForm1):boolean;stdcall;