Create a Photoshop Floating Window Application

xiaoxiao2021-03-06  41

Friends who have used Photoshop must have a convenient floating panel for it. In fact, these panels are a small form, but these small forms are placed on Photoshop's main form (not existing main forms. ), Have your own title bar, minimize buttons and maximize buttons. However, they differ from the MDI program that they can drag to the main window, more importantly, all of these panel forms and main forms are at most active.

Use Spy & Capture to find out that it is not difficult to find that the Parent Window of these panel forms is the main form of Photoshop (as an example of Photoshop Cs, the main form of Handle is 001906D8, all panel Parent Window points to 001906D8) And the pealth of the form we created is for NONE.

The following code is demonstrating this Photoshop floating window:

// ... var form1: tform1; importation uses unit2; {$ r * .dfm} procedure tForm1.button1click (sender: TOBJECT); begin // change the form2's PARENT to Form1 Form2: = tform2.createparented (Form1.handle); form2.show; // Make Form2 in the activation state SendMessage (form2.handle, wm_ncactivate, ord (true), 0); end; procedure tform1.button2click (sender: TOBJECT); begin form2.close; End; procedure tform1.formdestroy (sender: TOBJECT); begin // Remember to add this sentence if form2.showing throse; end; end;

The above code can display FORM2 that is active with Form1, and then make some necessary choices for the BorderStyle and Bordericons attributes of Form2, you can achieve a more perfect effect!

转载请注明原文地址:https://www.9cbs.com/read-54576.html

New Post(0)