winapi - VB6 How to Make a Floating Window TOP Most -


i wondered how google input tool windows running.. while dragging little google popup window (which gives language suggestions), notepad won't lost focus...

i tried same style of window which,

  • floats on top on other windows.
  • applied drop shadow.
  • gets text caret position window , moved dynamically cursor.

now problem is, when click , drag window, notepad / application loses focus , current focus on little popup window.

but google input tool , while dragging it, notepad won't loses focus..

here, want achieve floating popup window must not have focus .. , target application should not lose focus while touching popup window..

what windows vb6 api used achieve this..

thank watching.... :-)

here windows api code (put in module)

  option explicit   public const swp_nomove = 2   public const swp_nosize = 1   public const flags = swp_nomove or swp_nosize   public const hwnd_topmost = -1   public const hwnd_notopmost = -2    declare function setwindowpos lib "user32" alias "setwindowpos"  _         (byval hwnd long, _         byval hwndinsertafter long, _         byval x long, _         byval y long, _         byval cx long, _         byval cy long, _         byval wflags long  ) long    public function settopmostwindow(hwnd long, topmost boolean) _      long       if topmost = true 'make window topmost         settopmostwindow = setwindowpos(hwnd, hwnd_topmost, 0, 0, 0, _            0, flags)      else         settopmostwindow = setwindowpos(hwnd, hwnd_notopmost, 0, 0, _            0, 0,flags)         settopmostwindow = false      end if   end function 

in usage, set form1 topmost:

settopmostwindow form1.hwnd, true  

(from first result when googling vb6 window topmost, http://support.microsoft.com/kb/184297)


Comments