Procedure

MarkFormAsStayOnTop

Module

uFormMonitor

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

procedure MarkFormAsStayOnTop(Form: TForm; IsStayOnTop: Boolean);

Called-By Hierarchy


                    MarkFormAsStayOnTop
 TfrmGraphs.mnuPopGraphStayOnTopClick┘ 
               TfrmGraphs.StayOnTop┤   
              TfrmGraphs.FormShow┤ │   
TfrmGraphs.btnChangeSettingsClick┘ │   
 TfrmReports.btnChangeViewClick┘   │   
   TfrmGraphs.mnuPopGraphPrintClick┘   
         TfrmReports.RequestPrint┘     
    TfrmFrame.mnuFilePrintClick┤       
        TfrmReports.Print1Click┤       
        TfrmReports.Print2Click┘       

Called-By

Name Declaration Comments
TfrmGraphs.mnuPopGraphStayOnTopClick procedure mnuPopGraphStayOnTopClick(Sender: TObject); -


Source

139   procedure MarkFormAsStayOnTop(Form: TForm; IsStayOnTop: Boolean);
140   var
141     Data: Longint;
142   begin
143     Data := GetWindowLong(Form.Handle, GWL_USERDATA);
144     if(IsStayOnTop) then
145     begin
146       Data := Data or STAY_ON_TOP;
147       SetWindowPos(Form.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
148     end
149     else
150     begin
151       Data := Data and NORMAL_FORM;
152       SetWindowPos(Form.Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
153     end;
154     SetWindowLong(Form.Handle, GWL_USERDATA, Data);
155   end;