Board index » cppbuilder » Is it possible in particular conditions don't lose the focus for a window?

Is it possible in particular conditions don't lose the focus for a window?


2003-12-10 12:12:27 AM
cppbuilder9
Is it possible in particular conditions don't lose the focus for a window?
i have 2 windows, i want to click on a button inside the second or just move
the second window without lose the focus of the first one?
 
 

Re:Is it possible in particular conditions don't lose the focus for a window?

"gif" < XXXX@XXXXX.COM >wrote in message
Quote
i have 2 windows, i want to click on a button inside the second
or just move the second window without lose the focus of the first one?
Can't be done. The Windows OS only allows one windowed control to have the
input focus at any one time. In order to click on a button, for example,
focus must shift to the button (and the form it resides on) before it can
receive the mouse and keyboard events. That means shifting the focus away
from another window/control first, if one is already focused at the time.
Gambit
 

Re:Is it possible in particular conditions don't lose the focus for a window?

No, what i means to tell is lose a focus, that is if i click on a 2°window
normally i lose the focus at the first one and it pass at the second.
Ok, i don't want that it happen.
before the second one get the focus i want override it and so lose the
focus, is it possible?
But can i anyway click for example on its button?
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >ha scritto nel
messaggio news:3fd63432$ XXXX@XXXXX.COM ...
Quote

"gif" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>i have 2 windows, i want to click on a button inside the second
>or just move the second window without lose the focus of the first one?

Can't be done. The Windows OS only allows one windowed control to have
the
input focus at any one time. In order to click on a button, for example,
focus must shift to the button (and the form it resides on) before it can
receive the mouse and keyboard events. That means shifting the focus away
from another window/control first, if one is already focused at the time.


Gambit


 

{smallsort}

Re:Is it possible in particular conditions don't lose the focus for a window?

"gif" < XXXX@XXXXX.COM >a écrit dans le message de news:
XXXX@XXXXX.COM ...
Quote
No, what i means to tell is lose a focus, that is if i click on a 2°window
normally i lose the focus at the first one and it pass at the second.
Ok, i don't want that it happen.
before the second one get the focus i want override it and so lose the
focus, is it possible?
But can i anyway click for example on its button?


Remy said no you can not because the OS force the window that holds the
button to take the focus when you click the button; and there can not have 2
windows that have the focus simultaneously; so your first window must loose
the focus when you click the button on the second form.
Maybe what you can do is to give the focus to the first window when the
button click is finished (not tested):
TForm2::Button1Click(TObject* Sender)
{
//your treatment
Form1->SetFocus();
}
Quote
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >ha scritto nel
messaggio news:3fd63432$ XXXX@XXXXX.COM ...
>
>"gif" < XXXX@XXXXX.COM >wrote in message
>news: XXXX@XXXXX.COM ...
>
>>i have 2 windows, i want to click on a button inside the second
>>or just move the second window without lose the focus of the first
one?
>
>Can't be done. The Windows OS only allows one windowed control to have
the
>input focus at any one time. In order to click on a button, for
example,
>focus must shift to the button (and the form it resides on) before it
can
>receive the mouse and keyboard events. That means shifting the focus
away
>from another window/control first, if one is already focused at the
time.
>
>
>Gambit
>
>


 

Re:Is it possible in particular conditions don't lose the focus for a window?

Quote
Maybe what you can do is to give the focus to the first window when the
button click is finished (not tested):

TForm2::Button1Click(TObject* Sender)
{
//your treatment
Form1->SetFocus();
}
This is not a new discover ^__^
what i mean to do is have two windows use hooks or whatever thing to
override the message used to set the focus at the second window if i click
over it or i call it but pass immediatly the focus atthe first!
I think it is really possible...
 

Re:Is it possible in particular conditions don't lose the focus for a window?

some suggestion?
 

Re:Is it possible in particular conditions don't lose the focus for a window?

"gif" < XXXX@XXXXX.COM >wrote in message
Quote
some suggestion?
I can't give you all the details of I what I had to do,
but it was an imitation of a temp{*word*203}lost of window's
focus: you just monitor where the focus goes to right
before your window looses it; then you let the focused
window process its input only messages and take the focus
back by force. For a user, it looks like the focus has
never been lost by your window (for very slow videocards,
I had to paint NC area of my window manually during this
swap). There was a serious problem with the tasks written
with an assumption that user io is slow enough so they've
got plenty of time to process it: in that case I had to
boost up my priority, and sometimes even to jump to ring0
and CLI against the drivers written with the same belief.
Boba
 

Re:Is it possible in particular conditions don't lose the focus for a window?

What is the best internet resource about messages queues and handling
(borland builder users).
 

Re:Is it possible in particular conditions don't lose the focus for a window?

"gif" < XXXX@XXXXX.COM >wrote in message
Quote
What is the best internet resource about messages queues and handling
(borland builder users).
I use MSDN and Borland-specific source code.