SendMessage(Wnd,WM_KEYDOWN, VK_HOME, 0);
ASC:=ORD('F');
SendMessage(Wnd,WM_CHAR,ASC,0);
ASC:=ORD('F');
SendMessage(Wnd,WM_CHAR,ASC,0);
解决方案 »
- 请高手帮助把这个翻译成C#
- 【面试题目】成败在此一举 Delphi转换c# 求高手
- devExpress组件用来做什么的?怎么用呢?
- 关于动态报表创建的一个问题,比较棘手,如果是你,你怎么解决呢???
- 怎样用最快的方法检测数据库是否连通?
- 我开始学delphi7!怎样才能学好呢,有没有delphi7的教程吧,请各位高手赐教?
- 请问在Delphi中怎么样对数据库操作(ADO),在线,马上给分
- 请问Indy控件组里的TCPServer、TCPClient控件怎样解决代理服务器的问题,进行局域网内、外的连接?
- 提教controls的问题
- 想做一个时间轴显示。
- 在Delphi5中如何实现把excel文件中的内容导入到文本文件中,100分
- 高分求答!如何把20万条数据在45分钟内从一个文本文件导入数据库?在线等候!
with RichEdit1 do
Begin
SelStart := StrToInt(MaskEdit1.Text);
RichEdit1.Perform(EM_SCROLLCARET, 0, 0);
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
edit1.Perform(WM_Char,Ord('A'),0);
end;
procedure SendTextToWinControl(const WinControlHandle: HWND; const str: string);
var
i: integer;
begin
if WinControlHandle = 0 then
Exit;
if Length(str) = 0 then
Exit;
for i:= 1 to Length(str) do
begin
if Ord(str[i]) in [9, 13, 32..254] then
SendMessage(WinControlHandle, WM_CHAR, Ord(str[i]), 0);
end;
end;
调用此过程就可
不好意思,我问题是如何向一正在运行的运用程序发送消息,比如A.exe发送<Ctrl + p>给正在运行的B.exe,A的代码应该如何写,谢谢
keybd_event(
bVk: Byte; {virtual-key code}
bScan: Byte; {scan-code}
dwFlags: DWORD; {option flags}
dwExtraInfo: DWORD {additional information about the key}
); {this procedure does not return a value}Description
The keybd_event function simulates a keystroke. The system generates a WM_KEYUP or WM_KEYDOWN message as if the key were pressed on the keyboard.example:
procedure TForm1.ButtonSnapShotClick(Sender: TObject);
var
Bitmap: TBitmap; // holds a bitmap
begin
{see which radio button is checked}
if ImageOptions.ItemIndex = 0
then keybd_event(VK_SNAPSHOT,1,0,0) {desktop window snapshot}
else keybd_event(VK_SNAPSHOT,0,0,0); {client window snapshot} {check to see if there is a picture}
if Clipboard.HasFormat(CF_BITMAP) then begin
{Create a bitmap to hold the contents of the Clipboard}
Bitmap := TBitmap.Create; {trap for clipboard bitmap errors}
try
{get the bitmap off the clipboard using Assign}
Bitmap.Assign(Clipboard); {copy the bitmap to the Image}
Image1.Canvas.Draw(0, 0, Bitmap);
finally
{the bitmap is no longer needed, so free it} Bitmap.Free;
end;
end;
end;