Solved

Send Character to photoshop

Posted on 2006-07-07
7
260 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 11

Expert Comment

by:calinutz
Comment Utility
0
 
LVL 11

Expert Comment

by:calinutz
Comment Utility
0
 
LVL 1

Author Comment

by:mahdiparak
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 10

Expert Comment

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

Author Comment

by:mahdiparak
Comment Utility
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
Comment Utility
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
Comment Utility
very thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now