|
|
|
date: Fri, 4 Jul 2008 01:01:21 -0700 (PDT),
group: microsoft.public.win32.programmer.ui
back
Re: Restore a window WITHOUT activation
On Jul 4, 2:25 am, asperama...@gmail.com wrote:
> Ok, I found a trick:
>
> GetForegroundWindow
> ShowWindow
> SetForegroundWindow
>
> Not elegant, but it works for me.
> If anyone has a better idea, please post it!
>
> Robert
Hi,
First get the handle of the foreground window:
GetForegroundWindow()
Then restore the minimized window:
SendMessage(hWnd, WM_SYSCOMMAND,..........);
Or,
SetWindowPlacement()
Then activate and display the foreground window:
SetforegroundWindow()
http://msdn.microsoft.com/en-us/library/ms646360(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms633544(VS.85).aspx
Kellie.
date: Fri, 4 Jul 2008 14:38:06 -0700 (PDT)
author: Kellie Fitton
Re: Restore a window WITHOUT activation
Kellie Fitton wrote:
> On Jul 4, 2:25 am, asperama...@gmail.com wrote:
>> Ok, I found a trick:
>>
>> GetForegroundWindow
>> ShowWindow
>> SetForegroundWindow
>>
>> Not elegant, but it works for me.
>> If anyone has a better idea, please post it!
>>
>> Robert
>
>
>
> Hi,
>
> First get the handle of the foreground window:
>
> GetForegroundWindow()
>
> Then restore the minimized window:
>
> SendMessage(hWnd, WM_SYSCOMMAND,..........);
> Or,
> SetWindowPlacement()
>
> Then activate and display the foreground window:
>
> SetforegroundWindow()
>
> http://msdn.microsoft.com/en-us/library/ms646360(VS.85).aspx
>
> http://msdn.microsoft.com/en-us/library/ms633544(VS.85).aspx
Shame you have to do this as windows is supposed to make it difficult to
take focus...
--
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team
iCode Systems
date: Mon, 07 Jul 2008 10:17:57 +0100
author: Dean Earley
Re: Restore a window WITHOUT activation
On Fri, 4 Jul 2008 01:01:21 -0700 (PDT), asperamanca@gmail.com wrote:
>Hi all,
>
>I need to restore a window from the minimized position without
>restoring it (i.e. the window that currently has the focus should
>retain it).
The SetFocus function returns a handle to the window that had focus.
Have you tried keeping that value and then calling SetFocus on it? As
in:
HWND hWndOld = ::SetFocus( hWndWant );
::SetFocus( hWndOld );
>
>The window shows a virtual keyboard that should help the user enter
>text without taking away the focus from the window he's currently
>working with. It's in a separate process (=no easy subclassing).
Separate process may be a problem, but I don't remember details
offhand.
>
>All calls that restore a window also seem to activate it.
>
>Any ideas?
>
>Thanks!
>
>Robert
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com
date: Mon, 07 Jul 2008 08:59:05 -0400
author: unknown
Re: Restore a window WITHOUT activation
Not quite the same question, but you might check a current thread
called "Set focus programmatically without raising to foreground?" in
this newsgroup.
On Fri, 4 Jul 2008 01:01:21 -0700 (PDT), asperamanca@gmail.com wrote:
>Hi all,
>
>I need to restore a window from the minimized position without
>restoring it (i.e. the window that currently has the focus should
>retain it).
>
>The window shows a virtual keyboard that should help the user enter
>text without taking away the focus from the window he's currently
>working with. It's in a separate process (=no easy subclassing).
>
>All calls that restore a window also seem to activate it.
>
>Any ideas?
>
>Thanks!
>
>Robert
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com
date: Wed, 16 Jul 2008 11:22:51 -0400
author: unknown
|
|