I'm not 100% sure of what you want exactly.
Do you want to have a popup window that can't be focused?
Do you want to show the popup window in the background and keep the focus on other apps?
Anyway, in your case I would make the tests with the MiniBrowser demo because it's ready to handle popup windows created by CEF. The FMX demo is not ready and it uses the OSR mode and your app uses normal mode.
This is an alternative way to move a window to the background :
https://stackoverflow.com/questions/268 ... other-form
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
How not to set focus if we open popup
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
- danicarla2
- Posts: 19
- Joined: Mon Oct 01, 2018 6:01 pm
- Location: Brazil
Re: How not to set focus if we open popup
Hi guys.. I believe that my doubt is a little similar
My html open a popup attributing a name to it.. example:
But if minimize Pop-up and click on another link.. it opens the page in the open window without giving the focus..
Is there a way to assign focus that way?
My html open a popup attributing a name to it.. example:
Code: Select all
<script>
function NewWindow(page,name,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(page,name,settings);
}
</script>
<a href="test.html" onclick="NewWindow(this.href,'NameWindow','800','550','yes');return false">test</a>
Is there a way to assign focus that way?
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How not to set focus if we open popup
Set the TCEFWindowParent.TabStop := TRUE and TCEFWindowParent.TabOrder := 0;
If TCEFWindowParent is a child of other Delphi components make sure they also have the same value for the TabStop property to be sure TCEFWindowParent is the first component to have the focus when your app runs.
If TCEFWindowParent is a child of other Delphi components make sure they also have the same value for the TabStop property to be sure TCEFWindowParent is the first component to have the focus when your app runs.
- danicarla2
- Posts: 19
- Joined: Mon Oct 01, 2018 6:01 pm
- Location: Brazil
Re: How not to set focus if we open popup
Something like? im usin the Mini Browser demo


- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How not to set focus if we open popup
Yes. I tested what you said with a popup window in the minibrowser and, if I understood correctly, those properties fix this problem.
I also added an INPUT element with "autofocus" in the web pages to see the blinking cursor when I clicked the last link.
I also added an INPUT element with "autofocus" in the web pages to see the blinking cursor when I clicked the last link.
- danicarla2
- Posts: 19
- Joined: Mon Oct 01, 2018 6:01 pm
- Location: Brazil
Re: How not to set focus if we open popup
Strange... for me it did not work..
I tried putting the focus through HTML and it also did not work
I tried putting the focus through HTML and it also did not work