Jesse Houwing said:
* Kerem Gumrukcu wrote, On 29-6-2007 6:46:
Hi All,
I want to force a window ( form, handle ) become foreground, I use:
FindWindow
and
SetForegroundWindow
but, sometimes, it is still in the taskbar, it should be minimize
status, how can I force it become maximize ?
Thanks a lot!
Best regards,
Boki.
Hi Boki,
you should send Window Messages to be 100% sure that the window
will be in maximized state. Use the native Windows API "SendMessage"
with the WM_SIZE Message and SIZE_MAXIMIZED Parameter. You can
do nearly anything with "SendMessage" Api and Window Messages to
Windows regarding Window Operations. Take a closer look at it. Since
you know that Windows and the Window Manager is a Event Driven Part
of the OS, you really can do so many things with SendMessage and
APIs like "CallWindowProc". You can even inject Assembler Coder to
your application with Apis like "CallWindowProc",...really!
Be very careful with this API under Windows Vista. It's no longer
allowed to send window messages from one application to another.
Jesse
Hi Jessi,
what do you recommend us to communicate with other applications?
Sure you will have problems with sendmessage on vista because of
User Interface Privilege Isolation (UIPI) and UAC but you can work
around:
Found in another post from Frank Dzaebel:
[ChangeWindowMessageFilter Function]
http://msdn2.microsoft.com/en-us/library/ms632675.aspx
[UIPI (GUI- Teil der Benutzerkontenkontrolle)]
http://www.microsoft.com/germany/msdn/library/windows/windowsvista/Wi...
[Developer Best Practices and Guidelines for Applications in a Least
Privileged Environment]
http://msdn2.microsoft.com/en-us/library/aa480150.aspx
(s. User Interface Privilege Isolation Overview)
[What is User Interface Privilege Isolation (UIPI) on Vista]
http://blogs.msdn.com/vishalsi/archive/2006/11/30/what-is-user-interf...
[Understanding and Working in Protected Mode Internet Explorer]
http://msdn2.microsoft.com/en-us/library/bb250462.aspx
There are endless ways to communicate with other applications, even with
injecting code and processes and manipulating application memory
directly.
Its up to you. But a easy way and also "mannaged" would be a use of the
NativeWindow-Class.
But i am interessted in what Jessi recommends,...