Making my startup-app keep the focus/interference from other startup-apps 
Author Message
 Making my startup-app keep the focus/interference from other startup-apps

I've written a program which is run using the "run=" entry in win.ini.
I'm using WFW 3.11. The program asks for a username and password and then
connects network drives and printers based on the username and
computername. The program works fine except for one problem:

The user must of course enter his username and password before doing
anything else so I want my app to have the focus when this is supposed to
happen (the user should not have to click the username or password
textboxes). Therefore I made my program stay on top and system modal
using the SetWindowPos and SetSysModalWindow API calls. Despite this,
programs in the startup group can interfere with this, e.g. Calendar. The
end result is that my app sits on the top, seems to be the active one
(its title bar is blue, indicating this) but it still does not seem to
have the focus, calendar has "stolen" it (but the user can't do anything
there because my app is system modal). So the user must click the
username or password editbox with the mouse. Of course I did a
password.SetFocus in my program (in the form's Activate event handler).

Is there any way I can get around this ? I could use a timer to set the
focus to my app 2-3 times per second (I tried that) but that looks
"hacky" to me and so much is happening at startup (Calendar, clock etc
starting) that the user can't do anything for several seconds in this
case (even the timer seems to be remarkably CPU-intensive). Can the
execution order of programs in "run=" (win.ini) and the Startup group be
specified? Can I start my program before any other startup-program ?
Anyone have any ideas ?


Sun, 02 Nov 1997 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. trapping drive availability errors at app startup

2. Startup Macros are killing my app.

3. Slow app startup

4. Logon when I startup a VB app

5. Put my app in the startup group

6. Add App to Startup

7. VB app at startup ?

8. How do I minimise other apps on startup?

9. use VB to monitor startup of other apps.

10. VB apps in Startup group - oops!

11. VB app crashes while startup

12. Making databases R/W to my app, R/O to others


Powered by phpBB® Forum Software