Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Fri, 4 Jul 2008 01:01:21 -0700 (PDT),    group: microsoft.public.win32.programmer.ui        back       


Restore a window WITHOUT activation   
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
date: Fri, 4 Jul 2008 01:01:21 -0700 (PDT)   author:   unknown

Re: Restore a window WITHOUT activation   
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
date: Fri, 4 Jul 2008 02:25:22 -0700 (PDT)   author:   unknown

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   
wrote in message 
news:ccd707e7-8b5a-486f-8672-5da21a31d8fa@d77g2000hsb.googlegroups.com...
> 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?

    ShowWindow with the SW_NOACTIVATE flag.

-- 

- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
date: Tue, 15 Jul 2008 17:42:55 -0400   author:   Gary Chanson

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us