Home > Back-end >  How can a set-top and activate the pop-up window, and can't click on any other window
How can a set-top and activate the pop-up window, and can't click on any other window

Time:10-30

If inscribe

I points less, please your help!!!!!!

CodePudding user response:

Using Windows API function:

SetForegroundWindow (window handle);

SetActiveWindow (window handle);

CodePudding user response:

Had tried it, no matter with...

CodePudding user response:

Is not success every time

CodePudding user response:

You can get the handle?
Send WM_SETFOCUS message or directly setfocus feasible?

CodePudding user response:

Still won't do, perhaps because of my program is smaller on the right side of the taskbar...

CodePudding user response:

What kind of pop-up window? Direct ShowModal doesn't work

CodePudding user response:

General TFrom, but the words behind the ShowModal language can not run anymore...

CodePudding user response:

You asked 'can't click on any other window again and again to go down, seems to be some contradictions

CodePudding user response:

To clear up your own business first, looking at how technology implementation,

CodePudding user response:

The unit Unit1;

Interface

USES the
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls ExtCtrls;

Type
TForm1=class (TForm)
For: TButton;
Timer1: TTimer;
Procedure Button1Click (Sender: TObject);
Procedure FormClose (Sender: TObject; Var Action: TCloseAction);
Procedure Timer1Timer (Sender: TObject);

Private
{Private declarations}

Public

{Public declarations}
end;

Var
Form1: TForm1;
F: TForm;

Implementation

{$R *. DFM}


Procedure TForm1. Button1Click (Sender: TObject);
Var
Fr: TRect;
The begin
F:=TForm. Create (Application);
F.F ormStyle:=fsStayOnTop;
F.B orderStyle:=bsDialog;
Timer1. Enabled:=true;
F.O nClose:=OnClose;
F.S howModal;

end;

Procedure TForm1. FormClose (Sender: TObject; Var Action: TCloseAction);
The begin
Timer1. Enabled:=False;
ClipCursor (0);
end;

Procedure TForm1. Timer1Timer (Sender: TObject);
Var
Fr: TRect;
The begin
Fr:=f.B oundsRect;
MapWindowPoints (0, 0, fr, 2);
Clipcursor (@ fr);
end;

End.

==don't know whether this meet

CodePudding user response:

Use the timer control that can handle, have tried

CodePudding user response:

Do you want to be the original poster is like a MessageBox blocking threads window

CodePudding user response:

"Can't click on any other window
"
Is the process of other Windows, or all the other window?
The window activation after set-top, limit the scope of mouse activity in this window, this way I don't know whether to conform to the requirements of the building Lord??

CodePudding user response:

Same as above, learning!
  • Related