home *** CD-ROM | disk | FTP | other *** search
- EXTPROC CEnvi
- //**********************************************************
- //*** NearLock - Lockup desktop ALMOST. That is lockup ***
- //*** ver.1 except if printer message shows through ***
- //*** allow a message there. ***
- //**********************************************************
-
- #include <WinTools.lib>
-
- // Lockup system
- system(`start "Lockup Desktop" /C /WIN /B DeskLock LOCK`);
- suspend(4000);
- LockWindow = WinQuerySysModalWindow();
-
- while ( True ) { // run forever
-
- // check every second, waiting for the printer message
- // window to show up or until lock window is gone
- do {
- suspend(1000);
- if ( !IsWindow(LockWindow) )
- exit(0);
- } while ( !(PrintWindow = GetWindowHandle("Printer")) );
-
- // The printer window is showing, so make the printer
- // window be modal and minimize the lockup window
- WinSetSysModalWindow(PrintWindow);
-
- // stay here until the print window is done
- while ( PrintWindow == WinQuerySysModalWindow() ) {
- PutWindowOnTop(PrintWindow);
- WinSetFocus(PrintWindow);
- suspend(500);
- }
- }
-
-
- // A couple of utilities called above
-
- WinQuerySysModalWindow()
- {
- #define ORD_WIN32QUERYSYSMODALWINDOW 827
- return PMDynamicLink("PMWIN",ORD_WIN32QUERYSYSMODALWINDOW,
- BIT32,CDECL,HWND_DESKTOP);
- }
-
- WinSetSysModalWindow(pHwnd)
- {
- #define ORD_WIN32SETSYSMODALWINDOW 872
- return PMDynamicLink("PMWIN",ORD_WIN32SETSYSMODALWINDOW,
- BIT32,CDECL,HWND_DESKTOP,pHwnd);
- }
-
- PutWindowOnTop(pHwnd)
- {
- #define HWND_TOP 3
- #define SWP_ZORDER 4
- #define ORD_WIN32SETWINDOWPOS 875
- DynamicLink("PMWIN",ORD_WIN32SETWINDOWPOS,BIT32,CDECL,
- pHwnd,HWND_TOP,0,0,0,0,SWP_ZORDER);
- }
-
- WinSetFocus(pHwnd)
- {
- #define ORD_WIN32SETFOCUS 860
- DynamicLink("PMWIN",ORD_WIN32SETFOCUS,BIT32,CDECL,
- HWND_DESKTOP,pHwnd);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-