Discussion Locked

SetSystemModal

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Under WIN32S the API call for SetSystemModal is no longer available. I need to set a window in VB5 to System Modal. The SetWinPos call can be used to force and keep the window on top but not system modal. Any ideas?

I also have a sneaky suspiscion that Microsoft have not fixed the bug in VB where keyboard events do not trap the Win95 key. Anyone know a fix for this?

7 replies

by sakis samaras

Hi,
I 'm an average VB programmer and mostly i use VB6 for development
In VB6 the only thing you have to include into your code is:
load form
form.show 1 (stands for modal)
thet's all
PS
you can't display a non model from called by a model one.
As for the Win95 key is to be treated as a key combination of control+escape ... ( I think...) so if you trap this combination it should work fine .. :-)
Hope helps

by thomas seeger

Hello,
I found an answer from Microsoft to your problem. It is a description to block a taskswitch on WIN95, but should als work with Win98
Look for the article

HOWTO: Block CTRL+ALT+DEL and ALT+TAB in Windows 95.
Search at the microsoft DeveloperNetwork Online for Q161133.

by nicemouse

Hide the taskbar, disable ALT+TAB and CTRL+ALT+DEL, maximize your window, make your window always on top. You'll get a System modal window.

You can disable ALT+TAB by
using SystemParametersInfo(SPI_FASTTASKSWITCH, False)

and disable CTRL+ALT+DEL with
SystemParametersInfo(SPI_SCREENSAVERUNNING, True)

I can't recall the above API function correctly. Should be something like SystemPArametersInfo or SystemsParameterInfo. Search at Win32 Programmers REference.

You can get the handle toWindows Taskbar with FindWindow('Shell_TrayWnd',''). and issuing HideWindow(TrayWndHandle, SW_HIDE) will hide it.

Be sure to set your window to TOPMOST and maximized it.

This will create illusion that your application is System Modal.

This discussion is closed to new replies.