Click here to Skip to main content
15,894,106 members
Home / Discussions / C#
   

C#

 
AnswerRe: create application in .net where dll is on server and application on some client machine Pin
Pravin Patil, Mumbai23-Jan-11 20:54
Pravin Patil, Mumbai23-Jan-11 20:54 
AnswerRe: create application in .net where dll is on server and application on some client machine Pin
Mycroft Holmes23-Jan-11 21:07
professionalMycroft Holmes23-Jan-11 21:07 
AnswerRe: create application in .net where dll is on server and application on some client machine Pin
Pete O'Hanlon23-Jan-11 22:26
mvePete O'Hanlon23-Jan-11 22:26 
GeneralRe: create application in .net where dll is on server and application on some client machine Pin
S.Aijaz25-Jan-11 0:28
S.Aijaz25-Jan-11 0:28 
AnswerRe: create application in .net where dll is on server and application on some client machine Pin
PIEBALDconsult24-Jan-11 1:58
mvePIEBALDconsult24-Jan-11 1:58 
QuestionGetting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
HalliHaida23-Jan-11 17:38
HalliHaida23-Jan-11 17:38 
AnswerRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
Eddy Vluggen24-Jan-11 4:59
professionalEddy Vluggen24-Jan-11 4:59 
GeneralRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
HalliHaida24-Jan-11 21:24
HalliHaida24-Jan-11 21:24 
Well, let me give some more details. I am preparing a POC (proof of conecpt). To meet the actual requirement, the POC should have the following funtionalities,
1) System tray icon is the only UI of the application and it will have a option to exit the application.
2) The application should not appear in taskbar or Alt + Tab menu.
3) When an event is received from an external source, application should display a form, having a text box control and enter button, should appear and user should be able to type something and hit enter.
4) As soon as the user hits enter, the form should disappear.
5) Steps 3 and 4 could be repeated.

To achieve this, I have done the following,
1) Created a system tray icon with exit option in a window application
2) This main thread spawns a thread which will create a form having TextBox and button control and which will be hidden. To make it not appear in the Alt + Tab or taskbar have done the following,
this.Opacity = 0.0;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.ShowInTaskbar = false;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Visible = true;
3) This worker thread spawns another thread which will create a TCP listner to receive the events from external source.
4) When the event is received, I am doing the following to display the form so that user can enter some text.
this.WindowState = FormWindowState.Maximized;
this.Activate();

This is not working for me Frown | :( The form is not getting the focus so that user can enter the text. The Activate() method is not working fine.

I tried setting the form as topmost before activating ans resetting it after activating like below
thi.TopMost = true;
this.Activate();
this.TopMost = false;

But this worked once or twice, but most of the time it fails. When it worked, if we shift the focus to some other application, then on receiving the next event the form fails to get the focus back.
All I need here is to display the form and make sure that it has the focus so that user can type. I tried setting the focus to the control like below,
<textBox>.Focus();

Any help is really appreciated.
GeneralRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
Eddy Vluggen25-Jan-11 8:25
professionalEddy Vluggen25-Jan-11 8:25 
GeneralRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
HalliHaida27-Jan-11 1:08
HalliHaida27-Jan-11 1:08 
GeneralRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
Eddy Vluggen27-Jan-11 9:06
professionalEddy Vluggen27-Jan-11 9:06 
GeneralRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
HalliHaida27-Jan-11 18:08
HalliHaida27-Jan-11 18:08 
GeneralRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
Eddy Vluggen27-Jan-11 20:36
professionalEddy Vluggen27-Jan-11 20:36 
GeneralRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
HalliHaida30-Jan-11 18:21
HalliHaida30-Jan-11 18:21 
GeneralRe: Getting focus to a form that doesn't show in taskbar and Alt + Tab menu Pin
Eddy Vluggen31-Jan-11 6:51
professionalEddy Vluggen31-Jan-11 6:51 
Questioni have this code, i need it in class Pin
Gali197823-Jan-11 9:02
Gali197823-Jan-11 9:02 
AnswerRe: i have this code, i need it in class Pin
Pete O'Hanlon23-Jan-11 9:12
mvePete O'Hanlon23-Jan-11 9:12 
AnswerRe: i have this code, i need it in class Pin
Manfred Rudolf Bihy23-Jan-11 9:26
professionalManfred Rudolf Bihy23-Jan-11 9:26 
AnswerRe: i have this code, i need it in class Pin
fjdiewornncalwe23-Jan-11 10:20
professionalfjdiewornncalwe23-Jan-11 10:20 
AnswerRe: i have this code, i need it in class Pin
Luc Pattyn23-Jan-11 10:39
sitebuilderLuc Pattyn23-Jan-11 10:39 
AnswerRe: i have this code, i need it in class Pin
Abhinav S23-Jan-11 17:38
Abhinav S23-Jan-11 17:38 
AnswerRe: i have this code, i need it in class Pin
Thomas Krojer24-Jan-11 0:16
Thomas Krojer24-Jan-11 0:16 
QuestionHow to hosting custom deisgner ? Pin
hdv21223-Jan-11 8:51
hdv21223-Jan-11 8:51 
AnswerRe: How to hosting custom deisgner ? Pin
Henry Minute23-Jan-11 10:18
Henry Minute23-Jan-11 10:18 
GeneralRe: How to hosting custom deisgner ? Pin
hdv21223-Jan-11 10:41
hdv21223-Jan-11 10:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.