Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Howto Invisible to Visible form + bringTofront of all application windows running?


Message #1 by "bwarehouse" <bwarehouse@y...> on Mon, 27 Jan 2003 15:45:17 -0700
SUCCESS!  Pete i cant thank you enough, it worked like a charm
on the 1st cut&paste.  thanks again

in addition, thanks to techmark & Enzo for your
assistance.  tech mark take a look at the code below..
we were so close, but a "bit" to far.  now i can
call it a night and actually get at least 4 hours of
sleep in for the first time in, who knows?
mark, let me know if this helps your code.

later,
bware

-----Original Message-----
From: Peter N. Kipe [mailto:pkipe@c...]
Sent: Monday, January 27, 2003 9:36 PM
To: professional vb
Subject: [pro_vb] RE: Howto Invisible to Visible form + bringTofront of
all application windows running?


Put the following in a module:

Public Declare Function SetWindowPos Lib "user32" ( _
    ByVal hwnd As Long, _
    ByVal hWndInsertAfter As Long, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal cx As Long, _
    ByVal cy As Long, _
    ByVal wFlags As Long) As Long
    
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2

Then in your form, insert something like this:

    ' force current form to remain on top
    SetWindowPos Me.hwnd, _
        HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE

    ' allow current form to function normally
    SetWindowPos Me.hwnd, _
        HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE

Pete

-----Original Message-----
From: bwarehouse [mailto:bwarehouse@y...]
Sent: Monday, January 27, 2003 5:45 PM
To: professional vb
Subject: [pro_vb] Howto Invisible to Visible form + bringTofront of all
application windows running?


I coded an alarm with notification capabilities.

after I set the alarm, I hide the form (visible = False);
when the alarm time hits, the form unhides, goes to the center
of the screen and displays my notification;

PROBLEM: it keeps displaying behind other applications(i.e.
ms word, outlook, vb6 etc.) causing me to alt-tab to make
it show.

QUESTION: what's the code to force-it on top of every window
that's open when the alarm hits..  I tried numerous things, but no luck..

thanks
bware






  Return to Index