I have basic knowledge of winform, but I don't know how to connect API between winform and photoshop2021 to make a small software for my school, main task is to manage student's card photo I want to make a function that can run on jsx file, can anyone help me how to connect and a small code for a button to run on jsx file so that I can understand and follow...thanks
There a just a handful of Photoshop script experts that participate here. I only hack at Photoshop scripting I'm not an expert. Hopefully an expert will answer. Its easy to run a script from a shortcut. To add a button to Photoshop you would need the create a Photoshop extension. Script normally have menu items in menu File>Scripts>Script Name or, menu File>Automate>Script Name... . Photoshop Plug-in script are added to menu File>Automate>Script Name ... they can be recorded in action and they will not display their Dialog when you play the Action. The action will pass the setting record in the action step by the plug-in when the step was recorded. Thar action can be batched.
I assume by Winform you allude to something included in the .Net platform or Windows ecosystem to create a UI based application(not looked into Win programming for years now so pardon me if I am outdated.), if yes then I can safely conclude that you are on a Win machine. Now the option that you have is to use the COM interface of PS and write your code using the language you use in your project which in my guess would be C#. I found an example of doing this using Python, see the following article
So in your case, you will have to find a library that allows you to load the COM objects and you should be good to go. See one such library that I could find, it seems to be a paid library but it will guide you in the right direction in case you need to find a free one.
This isn't an answer to your question, but it's just a small point that might be useful to know. I have seen people spend time on projects built around Adobe apps, only to find later they can't do the job, so this could save time to know. This may not be relevant to your situation at all.
If you make an app that uses Photoshop, everyone who uses the app needs a subscription for Photoshop. Their own subscription in their own name, because it can't be shared. So you could not, for example, make an app for students to use, or for a shared computer in a school office. If you make an app for named administrators to use, they would each need a Photoshop subscription.