Page 2 of 2

Posted: Tue Jan 29, 2008 1:03 pm
by Baslo
rsts wrote:Ok - several months back in an semi-major code update, forcefore stopped working the way I needed it to.

Here's the routine I ended up using as a replacement, after quite a bit of trial and error. It may be somewhat unique to my circumstance that this works where forcefore didn't. I'm not trying to fault forcefore at all. It worked fine for me before I made the changes.

Code: Select all

ShowWindow_(WindowID(#window_0),#SW_SHOWNORMAL|	#SW_RESTORE)
SetWindowPos_(Handle, #HWND_TOPMOST, 0,0,0,0,  #SWP_SHOWWINDOW |#SWP_NOMOVE | #SWP_NOSIZE)
  Sleep_(250)
  SetWindowPos_(Handle,-2,0,0,0,0,#SWP_NOSIZE|#SWP_NOMOVE)
cheers
That doesnt seem to work for me. The window stays in the back. And as you mentioned, the ForceFore() solution also doesnt work. Any other solutions?

Posted: Tue Jan 29, 2008 1:12 pm
by netmaestro

Posted: Tue Jan 29, 2008 1:37 pm
by Inf0Byt3
I used this to restore windows:

Code: Select all

       SendMessage_(Hwnd,#SW_SHOWNORMAL,0,0) 
       ShowWindow_(Hwnd,#SW_RESTORE)
       ShowWindow_(Hwnd,#SW_SHOW)
       SetForegroundWindow_(Hwnd)

Bringing Window to the Front (BRINGTOFRONT)

Posted: Fri Apr 24, 2009 2:15 pm
by rdority
Thanks Info0Byt3, This is beautifully simply and simply beautiful (works)!

I was looking for SW_BRINGTOFRONT (or something like that) but then I found these 4 lines of code that you provided.

:P

Much appreciated,
Roark