Send Character to photoshop

hi
how i can send character code such as #132 or #186 ( no key code ) to other application ( Adobe Photoshop ) when user is in type mode?
LVL 1
mahdiparakAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
atul_parmarConnect With a Mentor Commented:
Yep, I think you need to attach with that process. e.g.

var
  hAdobe, Pid1, Pid2 : THandle;
  Key : char;
begin
  hAdobe := FindWindow(nil, PChar(AdobeTitle)); // get the handle of adobe photoshop
  if hAdobe = 0 then Exit;
  Pid1 := GetWindowThreadProcessId(hAdobe, nil);
  Pid2 := GetCurrentThreadId;
  AttachThreadInput(Pid1, Pid2, True);
  Key := #132;
  SendMessage(h,WM_CHAR,Ord(Key),0);
end;

0
 
calinutzCommented:
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
mahdiparakAuthor Commented:
dear calinutz i have a problem yet.
this code only send key Code but i want Send Character code as Ascii. for example i use this

  SendMessage(h,WM_CHAR,112,0);

This Function Work in Notepad but not Work in Photoshop.

i want a Source Code For send Charachter Code as ascii not keyCode
0
 
atul_parmarCommented:
var
 Key : char;
begin
  Key := #132
  SendMessage(h,WM_CHAR,Ord(Key),0);
end;
0
 
mahdiparakAuthor Commented:
dear Atul_Parmer thanks
but i say this code not work for send character to photoshop
0
 
mahdiparakAuthor Commented:
very thanks
0
All Courses

From novice to tech pro — start learning today.