Solved

Send Character to photoshop

Posted on 2006-07-07
7
264 Views
Last Modified: 2013-12-03
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?
0
Comment
Question by:mahdiparak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 11

Expert Comment

by:calinutz
ID: 17057763
0
 
LVL 11

Expert Comment

by:calinutz
ID: 17057779
0
 
LVL 1

Author Comment

by:mahdiparak
ID: 17059002
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:atul_parmar
ID: 17059525
var
 Key : char;
begin
  Key := #132
  SendMessage(h,WM_CHAR,Ord(Key),0);
end;
0
 
LVL 1

Author Comment

by:mahdiparak
ID: 17060869
dear Atul_Parmer thanks
but i say this code not work for send character to photoshop
0
 
LVL 10

Accepted Solution

by:
atul_parmar earned 500 total points
ID: 17070953
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
 
LVL 1

Author Comment

by:mahdiparak
ID: 17109803
very thanks
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question