• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 135
  • Last Modified:

form that takes over the screen

How can I make my form float above all other applications including the windows start menu??

Much like a screen saver.

I have disabled the use of CTR-ALT-DEL keys etc with help from experts exchange! :)

I now just need to make the application run above and over the desktop.

I am writing a simple locking screen application - so users should not be able to gain access to other applications.

Thanks!
0
yiorgos010998
Asked:
yiorgos010998
1 Solution
 
JuiletteCommented:
'to make form stay on top
'put this in a bas 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

Global Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2

'=============================================
'
'put this in events click or load or whatever
'or hardcopy
'To set Form1 as a TopMost form, do the following:

res& = SetWindowPos (Form1.hWnd, HWND_TOPMOST, _
0, 0, 0, 0, FLAGS)
'if res&=0, there is an error

'To turn off topmost (make the form act normal again):

res& = SetWindowPos (Form1.hWnd, HWND_NOTOPMOST, _
0, 0, 0, 0, FLAGS)
0
 
Erick37Commented:
"HOWTO: Cover the Taskbar with a Window in Visual Basic"

http://support.microsoft.com/support/kb/articles/Q197/5/85.ASP
0
 
KDivadCommented:
My 2 cents:

Juliette's code to set a window on-top, your code to disable Ctrl-Alt-Del (and Alt-Tab, by the way) and:

Sub Form_Load()

    Me.Move 0, 0, Screen.Width, Screen.Height

End Sub

This should make your app completely cover the screen and not allow the user to get to anything else. Not foolproof of course, since certain API's can be easily used to create a shortcut that will destroy the currently active process, but...
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now