By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,335 Members | 1,902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,335 IT Pros & Developers. It's quick & easy.

Help with dialog focus

P: 1

Ok I got 2 programs > Server > Client/Remote

When I first run the server it will check for remote sites which have ip/rs232 devices listening, that are configured in the server database. for each entry in the site database it opens 1 dialog box per connection, with info about each connection. Also Remote client programs that are running at the time will attempt to connect, which could be any amount, and at anytime. Which also brings up dialogs. During start up, however on the server side. If you want to be able to edit any configurations you will need to login. The problem is when the program is making new client connections and you're trying to type in your id/password, it sets focus to the new boxes that come up, as they come up, even if the connection dialogs are optionally set to hidden. Im wondering if there is a way I can force the focus on the login box, until you have logged in. Currently have the connection box and the login box are forced to Always on top, so even if you minimize the program you can still monitor the connections. The reason these connections need to be made before logging in, is because it is an automated system, and must restart incase of a power failure.

Any help would be appreicated.
Thanks :)
Nov 16 '06 #1
Share this Question
Share on Google+
1 Reply

P: 142

To set the focus to the control you can use
Expand|Select|Wrap|Line Numbers
To set the focus to the dialog you want to use
Expand|Select|Wrap|Line Numbers
  1. SetForegroundWindow(HANDLE_OF_THE_DIALOG_WINDOW)
Nov 17 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.