Click here to Skip to main content
15,918,109 members

Comments by shivanikat (Top 3 by date)

shivanikat 5-Dec-11 7:48am View    
Hi,

Yes i made sure that i am only ommiting calling the base, this is the code i am using:

protected override void WndProc(ref Message m)
{
try
{
if (m.Msg == WM_WTSSESSION_CHANGE)
{
int value = m.WParam.ToInt32();
switch (value)
{
case WTS_SESSION_LOCK:
OnMachineLocked(EventArgs.Empty);
break;
case WTS_SESSION_UNLOCK:
OnMachineUnlocked(EventArgs.Empty);
break;
default:
base.WndProc(ref m);
break;
}
}
}
}
shivanikat 5-Dec-11 6:18am View    
Hi Addy Tas,
Thanks for the suggestion.
I have tried ommiting the code base.WinProc(ref m) from my code, but it has started giving win32 exception "Error Creating Windows handle" in some other class.
The Scenario for my application is that this code is present in a windows form 'MainForm' which in turn is called by a AppController Class; On starting the application the AppController class calls the MainForm by using this code
CodeApplication.Run(App.UI.MainForm);
When i omit Codebase.WinProc(ref m) from WndProc method in MainForm and start my application, i am getting the exception on this line:
CodeApplication.Run(App.UI.MainForm)
Kindly suggest any solution to the problem. I am not able to resolve the issue as i am not able to understand the dependency with this code.
In Case you need furthur information, please let me know.
shivanikat 5-Dec-11 6:14am View    
Deleted
Hi Addy Tas, Thanks for the suggestion. I have tried ommiting the code base.WinProc(ref m) from my code, but it has started giving win32 exception "Error Creating Windows handle" in some other class. The Scenario for my application is that this code is present in a windows form 'MainForm' which in turn is called by a AppController Class; On starting the application the AppController class calls the MainForm by using this code CodeApplication.Run(App.UI.MainForm); When i omit Codebase.WinProc(ref m) from WndProc method in MainForm and start my application, i am getting the exception on this line: CodeApplication.Run(App.UI.MainForm) Kindly suggest any solution to the problem. I am not able to resolve the issue as i am not able to understand the dependency with this code. In Case you need furthur information, please let me know.