Page 1 of 1

SetActiveWindow() applying to ALL windows

Posted: Mon Feb 07, 2011 5:19 pm
by Primus
I discovered a simple way to set focus on a window, even if other programs have focus. As you know, the SetActiveWindow() function doesn't work in this situation.

Code: Select all

Procedure SetActiveWindowAdvanced(WindowNumber)
  StickyWindow(WindowNumber,1)
  StickyWindow(WindowNumber,0)
EndProcedure
Maybe this method has been mentioned before and I just didn't find it, but who cares.

Enjoy!

Re: SetActiveWindow() applying to ALL windows

Posted: Mon Feb 07, 2011 5:47 pm
by ts-soft
You have misunderstood the PB Funktion.

Code: Select all

SetActiveWindow() <> SetForegroundWindow_()
But thx for the nice tipp.

Re: SetActiveWindow() applying to ALL windows

Posted: Mon Feb 07, 2011 6:41 pm
by skywalk
Thanks for the tip. :)
Question?
How do we know the API commands used behind the native PB commands?
For example:

Code: Select all

; Windows XP or greater...
SetActiveWindow(#Window) <> SetForegroundWindow_(hWnd)
HideWindow(#Window,0)    =  ?
; etc...

Re: SetActiveWindow() applying to ALL windows

Posted: Mon Feb 07, 2011 7:49 pm
by Frarth
Maybe you should call the procedure SetForegroundWindow() instead. Makes more sense. And thanks for the tip. I have no need for it now, but it is always good to know!