Files
HeidiSQL/source/queryprogress.pas
Ansgar Becker edb7fb0da8 Turn the query progress window not to be "always on top". It is already modal as set by the callers so that ensures no internal windows can cover this window.
I see no obvious reason why this status window should cover windows of other applications. And it can be annoying if you have a slow query running and want to work with other applications in the meantime. I asked the original developer for the initial reason for that change, but got no reply yet. Likely I won't get an answer ever.
2007-08-06 20:18:46 +00:00

76 lines
1.7 KiB
ObjectPascal

unit queryprogress;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,MysqlQuery,MysqlQueryThread, ExtCtrls, communication;
type
TfrmQueryProgress = class(TForm)
btnAbort: TButton;
lblStatusMsg: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btnAbortClick(Sender: TObject);
private
procedure HandleQueryNotificationMsg(var AMessage : TMessage); message WM_MYSQL_THREAD_NOTIFY;
public
end;
var
frmQueryProgress: TfrmQueryProgress;
implementation
uses
ChildWin,
helpers;
{$R *.dfm}
procedure TfrmQueryProgress.btnAbortClick(Sender: TObject);
begin
Close();
// todo: implement connection killing !!
end;
procedure TfrmQueryProgress.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
end;
{***
Handles the TMysqlQueryThread notification messages.
@param TMessage Message structure containing
* LParam: Event type
* WParam: MysqlQuery object containing status + resultset
}
procedure TfrmQueryProgress.HandleQueryNotificationMsg(var AMessage: TMessage);
begin
debug(Format('qry: Progress form received WM_MYSQL_THREAD_NOTIFY message with status %d', [AMessage.LParam]));
case AMessage.LParam of
MQE_INITED:
begin
debug('qry: Setting running flag to ''true''.');
end;
MQE_STARTED:
begin
end;
MQE_FINISHED:
begin
debug('qry: Setting running flag to ''false'' and closing dialog.');
Close();
end;
MQE_FREED:;
end;
end;
end.