Multithreading and background loading forms

  • Thread starter Thread starter Alberto Silva - MVP
  • Start date Start date
A

Alberto Silva - MVP

Hi,
I'm loading some forms in the background while the user types his login &
password, however each time a form gets instanciated, the form where he is
typing his ID loses the focus and the characters that he types are
'losted'...

What can I do do prevent it?

Thanks,
Alberto Silva
 
Have you tried not to make the background form visible until the user is
done with the login form?
 
You can use SetWindowPos P/Invokes on managed forms, however you also need
to P/Invoke GetCapture, FindWindow or similar to get a window handle for
your form since these are not exposed directly by the form objects. When
www.opennetcf.org pops back into life, have a look at the Win32Window class
for a whole load of these window management P/Invokes.

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org
 
Hi,
Even with the SetWindowPos the window loses it's focus each time a new form
is instantiated in the background running thread, which causes the user to
loose the ability to type something, since the input panel doesn't send
anymore the typed characters to the appropriate textbox.

Is there another API or specific parameters in SetWindowPos that may help?

BTW, I'm testing on CE 4.2.

Best Regards,
Alberto
 
Back
Top