L
liusm
Unregistered / Unconfirmed
GUEST, unregistred user!
我想做一个类似于DELPHI代码编辑器的东东代码如下:<br><br>unit lsm;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;<br><br>type<br> TForm1 = class(TForm)<br> procedure FormShow(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br>USES LIUSM;<br>{$R *.DFM}<br>procedure TForm1.FormShow(Sender: TObject);<br>var<br> Form2: TForm2;<br>begin<br>FORM2:=TFORM2.Create(APPLICATION);<br>FORM2.SHOW;<br>end;<br><br>end.<br><br>unit liusm;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> StdCtrls;<br>type<br>TForm2 = class(TForm)<br>private<br>Procedure WMMyMessage(var Message:TWMSYSCOMMAND);Message WM_SYSCOMMAND;<br>{ Private declarations }<br>public<br>{ Public declarations }<br>end;<br><br>var<br> Form2: TForm2;<br><br>implementation<br><br>uses lsm;<br><br>{$R *.DFM}<br>procedure tform2.WMMyMessage(var Message:TWMSYSCOMMAND);<br>//以下为消息控制的代码<br>VAR<br>SS:TRECT;<br>begin<br>INHERITED;<br>if (MESSAGE.CMDTYPE AND $FFF0=SC_MAXIMIZE) then<br> begin//调用先前的处理函数<br> IF GETWINDOWRECT(FORM1.HANDLE,SS)=TRUE THEN<br> BEGIN<br> if SS.Bottom<screen.height/2 then<br> SetWindowPos(HANDLE,HWND_TOP,0,ss.Bottom,SCREEN.WIDTH,screen.height-ss.Bottom,SWP_SHOWWINDOW);<br> END;<br> END;<br>END;<br>end.<br>