New topic: Timeout Splash Screen
<http://forums.realsoftware.com/viewtopic.php?t=43981> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message DaveS Post subject: Timeout Splash ScreenPosted: Sat May 12, 2012 9:56 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 3675 Location: San Diego, CA I need to be able to have my application hide all open windows and display a "splash"/"password" screen if the app has been inactive for a set period of time. This needs to be independant of any operating system screen savers. Resetting a timer every time someone does something is no problem. Detecting when the time runs out.. not a problem. But the open window(s) need to be hidden... and a password screen display. When the app is "unlocked" it needs to re-display the previous windows. One idea I had... was to simply move the "active" windows off the screen... so that they maintain state.. just not position. and reset their positions when the app is unlocked again. Any other ideas? _________________ Dave Sisemore MacPro, OSX 10.7.3 RB2011r3 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top timhare Post subject: Re: Timeout Splash ScreenPosted: Sat May 12, 2012 10:19 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 11287 Location: Portland, OR USA Maybe I'm wrong, but if you Show the password WebPage, it "hides" all other pages. The other pages retain their state unless you Close them, so if you show the password page and then show the previously active page, it will be just as it was before. I assume you tried it and it didn't work, though. What did it do? Top simulanics Post subject: Re: Timeout Splash ScreenPosted: Sat May 12, 2012 10:21 pm Joined: Sun Aug 12, 2007 10:10 am Posts: 561 Location: Boiling Springs, SC If you are using windows you can use shell and call (taskkill /f /im "explorer.exe") to hide the explorer and all windows upon creating your "splash/username/password" use one of the following API's to set the splash HWND as the TOPMOST window 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 Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Const HWND_TOPMOST = -1 '-- Bring to top and stay there Private Const HWND_NOTOPMOST = -2 '-- Put the window into a normal position Private Const SWP_NOMOVE = &H2 '-- Don't move window Private Const SWP_NOSIZE = &H1 '-- Don't size window Private Sub Command1_Click() 'Shell ("c:\windows\notepad.exe") Dim hWnd As Long '-- Find hwnd of Notepad hWnd = FindWindow("Notepad", vbNullString) '-- Set Notepad on top Call SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE) '-- Set the precious top most form after notepad Call SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE) End Sub **you will need to modify the VB code to disable ctrl+alt+delete there are a number of ways (to prevent user from bipassing your splash and/or restarting explorer.exe) Best way to disable ctrl+alt+delete is to access the windows registry HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System and set/create the key DisableTaskMgr and set it's value to 1 if your application username/password has been entered correctly..don't forget to launch a new instance of "explorer.exe" and "close" your splash window. If you need help or code would be glad to help _________________ Matthew A. Combatti Real Studio 2011 r4.3 Visit Real Studio Developer's Spot! Systems: Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8 Beta Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/ Windows Server 2011/CentOS 5.4 /ReactOS/SimOS ~All REAL Compatible~ Top doofus Post subject: Re: Timeout Splash ScreenPosted: Sat May 12, 2012 10:31 pm Joined: Thu Sep 10, 2009 2:50 am Posts: 247 Location: Santa Cruz, CA, USA DaveS wrote:One idea I had... was to simply move the "active" windows off the screen... so that they maintain state.. just not position. and reset their positions when the app is unlocked again. Flip the windows visibility and they'll stay in place. -d Top timhare Post subject: Re: Timeout Splash ScreenPosted: Sat May 12, 2012 10:44 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 11287 Location: Portland, OR USA Don't know where I got the idea this was for the web. Doofus is right, just Hide the windows and then Show them again. Top simulanics Post subject: Re: Timeout Splash ScreenPosted: Sat May 12, 2012 11:10 pm Joined: Sun Aug 12, 2007 10:10 am Posts: 561 Location: Boiling Springs, SC All good I misread it as being some sort of security app..brains fried today :-p _________________ Matthew A. Combatti Real Studio 2011 r4.3 Visit Real Studio Developer's Spot! Systems: Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8 Beta Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/ Windows Server 2011/CentOS 5.4 /ReactOS/SimOS ~All REAL Compatible~ Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 6 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
