D
DraguVaso
Hi,
My application has some interaction with an other application. I sometimes
need to put the other application to the front. The problem is that I'm not
able to get a nice solution to work in every case. I tryed two ways: one way
it disn't maximazi the Windowd when it was Minimized, in the other way it
resized the application when it was maximzed.
First I take a Handle to the other Window with the
"Process.GetProcessesByName("EXTRA")" and with the "Dim handle As IntPtr =
Process.MainWindowHandle"
First 'solution':
SetForegroundWindow(handle)
This gives me the problem with Mimized Window that gets the focus, but
Second 'solution':
ShowWindow(handle, SW_RESTORE) 'SW_RESTORE = 9
SetForegroundWindow(handle)
This gives me the problem with the Maximized Window that is suddenly
resized.
What I actually need is a solution that works always:
When the Windowd is Maximized, it has to keep Maximized. When it is Resized
it has to stay Resized. When it is Minimized it should be Restored (to the
last Status: Maxmimized or Resized).
I found some stuff about the IsIconic-API, but it didn't seem to work.
Does anybody knows a solution for my problem? I'm really stuck with it :-/
thanks a lot in advance,
Pieter
My application has some interaction with an other application. I sometimes
need to put the other application to the front. The problem is that I'm not
able to get a nice solution to work in every case. I tryed two ways: one way
it disn't maximazi the Windowd when it was Minimized, in the other way it
resized the application when it was maximzed.
First I take a Handle to the other Window with the
"Process.GetProcessesByName("EXTRA")" and with the "Dim handle As IntPtr =
Process.MainWindowHandle"
First 'solution':
SetForegroundWindow(handle)
This gives me the problem with Mimized Window that gets the focus, but
Second 'solution':
ShowWindow(handle, SW_RESTORE) 'SW_RESTORE = 9
SetForegroundWindow(handle)
This gives me the problem with the Maximized Window that is suddenly
resized.
What I actually need is a solution that works always:
When the Windowd is Maximized, it has to keep Maximized. When it is Resized
it has to stay Resized. When it is Minimized it should be Restored (to the
last Status: Maxmimized or Resized).
I found some stuff about the IsIconic-API, but it didn't seem to work.
Does anybody knows a solution for my problem? I'm really stuck with it :-/
thanks a lot in advance,
Pieter