DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: how to make program on top

  1. #1
    basicOfbasic Guest

    how to make program on top


    Any code to add so that can make my program floating on top and no other key
    can interrupt(even cannot click on Start button), unless sending some special
    keys.

    cause I want to write a security control for a internet case.

    Thank you for any help

  2. #2
    Mark Taylor Guest

    Re: how to make program on top

    Try something like this....

    Option Explicit

    Private 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

    Private Const SWP_NOMOVE = &H2
    Private Const SWP_NOSIZE = &H1

    Private Const HWND_TOPMOST = -1

    Private Sub Form_Load()

    SetWindowPos me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE

    End Sub

    ---
    Hope this helps,
    Mark


    basicOfbasic wrote:

    > Any code to add so that can make my program floating on top and no other key
    > can interrupt(even cannot click on Start button), unless sending some special
    > keys.
    >
    > cause I want to write a security control for a internet case.
    >
    > Thank you for any help



  3. #3
    Mark Taylor Guest

    Re: how to make program on top

    Try something like this....

    Option Explicit

    Private 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

    Private Const SWP_NOMOVE = &H2
    Private Const SWP_NOSIZE = &H1

    Private Const HWND_TOPMOST = -1

    Private Sub Form_Load()

    SetWindowPos me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE

    End Sub

    ---
    Hope this helps,
    Mark


    basicOfbasic wrote:

    > Any code to add so that can make my program floating on top and no other key
    > can interrupt(even cannot click on Start button), unless sending some special
    > keys.
    >
    > cause I want to write a security control for a internet case.
    >
    > Thank you for any help



  4. #4
    Sachin Guest

    Re: how to make program on top


    hmmm...though the following code will a window always on top but it won't
    stop the user from clicking Start button or working with any other application
    all that this code will do is it will make your window float harmlessly always
    on top much like Find window in Word.To stop user from working with other
    windows until she dismisses your form you can make your window SystemModal
    cheers,
    Sachin
    Mark Taylor <mark.taylor@infinity-insurance.com> wrote:
    >Try something like this....
    >
    >Option Explicit
    >
    >Private 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
    >
    >Private Const SWP_NOMOVE = &H2
    >Private Const SWP_NOSIZE = &H1
    >
    >Private Const HWND_TOPMOST = -1
    >
    >Private Sub Form_Load()
    >
    > SetWindowPos me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
    >
    >End Sub
    >
    >---
    >Hope this helps,
    >Mark
    >
    >
    >basicOfbasic wrote:
    >
    >> Any code to add so that can make my program floating on top and no other

    key
    >> can interrupt(even cannot click on Start button), unless sending some

    special
    >> keys.
    >>
    >> cause I want to write a security control for a internet case.
    >>
    >> Thank you for any help

    >



  5. #5
    Sachin Guest

    Re: how to make program on top


    hmmm...though the following code will a window always on top but it won't
    stop the user from clicking Start button or working with any other application
    all that this code will do is it will make your window float harmlessly always
    on top much like Find window in Word.To stop user from working with other
    windows until she dismisses your form you can make your window SystemModal
    cheers,
    Sachin
    Mark Taylor <mark.taylor@infinity-insurance.com> wrote:
    >Try something like this....
    >
    >Option Explicit
    >
    >Private 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
    >
    >Private Const SWP_NOMOVE = &H2
    >Private Const SWP_NOSIZE = &H1
    >
    >Private Const HWND_TOPMOST = -1
    >
    >Private Sub Form_Load()
    >
    > SetWindowPos me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
    >
    >End Sub
    >
    >---
    >Hope this helps,
    >Mark
    >
    >
    >basicOfbasic wrote:
    >
    >> Any code to add so that can make my program floating on top and no other

    key
    >> can interrupt(even cannot click on Start button), unless sending some

    special
    >> keys.
    >>
    >> cause I want to write a security control for a internet case.
    >>
    >> Thank you for any help

    >



  6. #6
    Jeremy Guest

    Re: how to make program on top

    How would you create a SystemModal window. The SetSysModalWindow api is
    obsolete for 32bit platforms, is there another way?

    Jeremy

    "Sachin" <sachin_nigam@yahoo.com> wrote in message
    news:3a0a39e8$1@news.devx.com...
    >
    > hmmm...though the following code will a window always on top but it won't
    > stop the user from clicking Start button or working with any other

    application
    > all that this code will do is it will make your window float harmlessly

    always
    > on top much like Find window in Word.To stop user from working with other
    > windows until she dismisses your form you can make your window SystemModal
    > cheers,
    > Sachin
    > Mark Taylor <mark.taylor@infinity-insurance.com> wrote:
    > >Try something like this....
    > >
    > >Option Explicit
    > >
    > >Private 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
    > >
    > >Private Const SWP_NOMOVE = &H2
    > >Private Const SWP_NOSIZE = &H1
    > >
    > >Private Const HWND_TOPMOST = -1
    > >
    > >Private Sub Form_Load()
    > >
    > > SetWindowPos me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE +

    SWP_NOSIZE
    > >
    > >End Sub
    > >
    > >---
    > >Hope this helps,
    > >Mark
    > >
    > >
    > >basicOfbasic wrote:
    > >
    > >> Any code to add so that can make my program floating on top and no

    other
    > key
    > >> can interrupt(even cannot click on Start button), unless sending some

    > special
    > >> keys.
    > >>
    > >> cause I want to write a security control for a internet case.
    > >>
    > >> Thank you for any help

    > >

    >




  7. #7
    Jeremy Guest

    Re: how to make program on top

    How would you create a SystemModal window. The SetSysModalWindow api is
    obsolete for 32bit platforms, is there another way?

    Jeremy

    "Sachin" <sachin_nigam@yahoo.com> wrote in message
    news:3a0a39e8$1@news.devx.com...
    >
    > hmmm...though the following code will a window always on top but it won't
    > stop the user from clicking Start button or working with any other

    application
    > all that this code will do is it will make your window float harmlessly

    always
    > on top much like Find window in Word.To stop user from working with other
    > windows until she dismisses your form you can make your window SystemModal
    > cheers,
    > Sachin
    > Mark Taylor <mark.taylor@infinity-insurance.com> wrote:
    > >Try something like this....
    > >
    > >Option Explicit
    > >
    > >Private 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
    > >
    > >Private Const SWP_NOMOVE = &H2
    > >Private Const SWP_NOSIZE = &H1
    > >
    > >Private Const HWND_TOPMOST = -1
    > >
    > >Private Sub Form_Load()
    > >
    > > SetWindowPos me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE +

    SWP_NOSIZE
    > >
    > >End Sub
    > >
    > >---
    > >Hope this helps,
    > >Mark
    > >
    > >
    > >basicOfbasic wrote:
    > >
    > >> Any code to add so that can make my program floating on top and no

    other
    > key
    > >> can interrupt(even cannot click on Start button), unless sending some

    > special
    > >> keys.
    > >>
    > >> cause I want to write a security control for a internet case.
    > >>
    > >> Thank you for any help

    > >

    >




  8. #8
    Sachin Guest

    Re: how to make program on top


    Honestly i dunno but I feel there shud be some way
    Sachin
    "Jeremy" <jeremy11@mediaone.net> wrote:
    >How would you create a SystemModal window. The SetSysModalWindow api is
    >obsolete for 32bit platforms, is there another way?
    >
    >Jeremy
    >
    >"Sachin" <sachin_nigam@yahoo.com> wrote in message
    >news:3a0a39e8$1@news.devx.com...
    >>
    >> hmmm...though the following code will a window always on top but it won't
    >> stop the user from clicking Start button or working with any other

    >application
    >> all that this code will do is it will make your window float harmlessly

    >always
    >> on top much like Find window in Word.To stop user from working with other
    >> windows until she dismisses your form you can make your window SystemModal
    >> cheers,
    >> Sachin



  9. #9
    Sachin Guest

    Re: how to make program on top


    Honestly i dunno but I feel there shud be some way
    Sachin
    "Jeremy" <jeremy11@mediaone.net> wrote:
    >How would you create a SystemModal window. The SetSysModalWindow api is
    >obsolete for 32bit platforms, is there another way?
    >
    >Jeremy
    >
    >"Sachin" <sachin_nigam@yahoo.com> wrote in message
    >news:3a0a39e8$1@news.devx.com...
    >>
    >> hmmm...though the following code will a window always on top but it won't
    >> stop the user from clicking Start button or working with any other

    >application
    >> all that this code will do is it will make your window float harmlessly

    >always
    >> on top much like Find window in Word.To stop user from working with other
    >> windows until she dismisses your form you can make your window SystemModal
    >> cheers,
    >> Sachin



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center