Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to use constructors?? Pin
Guffa25-Mar-06 0:55
Guffa25-Mar-06 0:55 
QuestionTAPI Pin
hafz24-Mar-06 21:39
hafz24-Mar-06 21:39 
Answercan you help me out Pin
mrkeivan25-Mar-06 0:34
mrkeivan25-Mar-06 0:34 
GeneralRe: can you help me out Pin
RizwanSharp25-Mar-06 3:09
RizwanSharp25-Mar-06 3:09 
GeneralRe: can you help me out Pin
cfsego7-May-06 21:05
cfsego7-May-06 21:05 
GeneralRe: can you help me out Pin
mrkeivan8-May-06 3:58
mrkeivan8-May-06 3:58 
QuestionCan We detect Sql Servers on Network using c# Pin
Jax_qqq24-Mar-06 19:37
Jax_qqq24-Mar-06 19:37 
QuestionHow to change textBox contents using ActiveX Pin
wajih2k24-Mar-06 19:04
wajih2k24-Mar-06 19:04 
Hi, I am trying to develop an ActiveX control in C# that changes the text of the textboxes on the client machine...for this purpose...i got the code, that closes a window using the window name and the class name in a WINDOWS FORM.

class Win32{
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;

[DllImport("user32.dll")]
public static extern int FindWindow(
string lpClassName, // class name
string lpWindowName // window name
);
[DllImport("user32.dll")]
public static extern int SendMessage(
int hWnd, // handle to destination window
uint Msg, // message
int wParam, // first message parameter
int lParam // second message parameter
);
}
// Determine the handle to the Calculator window.
int i=Win32.FindWindow(txtClsNm.Text ,txtWndNm.Text);
// Post a message to Calc to end its existence.
int j=Win32.SendMessage(i, Win32.WM_SYSCOMMAND, Win32.SC_CLOSE, 0);



However, when i tried to use the same in an activex control, it gave me a security exception...



************** Exception Text **************
System.Security.SecurityException: System.Security.Permissions.SecurityPermission
at ActiveXDotNet.myControl.button2_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The Zone of the assembly that failed was:
MyComputer


Can anyone tell me how to solve this problem...ideally tell me the API call that helps me CHANGE the text box contents at the client machine...
just in case ,it helps, to develop an activex control in .NET, i created a "Class Library" project and put a "User control" over it...

PLEASE help!! Confused | :confused:
thanx
Wajih
QuestionDll's Pin
Navaneeth.K.N24-Mar-06 18:58
Navaneeth.K.N24-Mar-06 18:58 
AnswerRe: Dll's Pin
HakunaMatada24-Mar-06 21:56
HakunaMatada24-Mar-06 21:56 
QuestionUnique Registration Key Pin
Navaneeth.K.N24-Mar-06 18:56
Navaneeth.K.N24-Mar-06 18:56 
AnswerRe: Unique Registration Key Pin
HakunaMatada24-Mar-06 22:02
HakunaMatada24-Mar-06 22:02 
QuestionByte to bits conversion Pin
eggie524-Mar-06 18:55
eggie524-Mar-06 18:55 
AnswerRe: Byte to bits conversion Pin
Robert Rohde24-Mar-06 20:04
Robert Rohde24-Mar-06 20:04 
GeneralRe: Byte to bits conversion Pin
eggie524-Mar-06 20:08
eggie524-Mar-06 20:08 
GeneralRe: Byte to bits conversion Pin
Robert Rohde24-Mar-06 20:12
Robert Rohde24-Mar-06 20:12 
AnswerRe: Byte to bits conversion Pin
leppie24-Mar-06 21:46
leppie24-Mar-06 21:46 
QuestionAnyBody Hep Me !!!!!! Pin
AnhTin24-Mar-06 17:16
AnhTin24-Mar-06 17:16 
AnswerRe: AnyBody Hep Me !!!!!! Pin
Robert Rohde24-Mar-06 20:06
Robert Rohde24-Mar-06 20:06 
QuestionInput video to my background form Pin
youssef24-Mar-06 9:18
youssef24-Mar-06 9:18 
AnswerRe: Input video to my background form Pin
Ed.Poore24-Mar-06 11:07
Ed.Poore24-Mar-06 11:07 
QuestionExpanded Remote Registry Editing Issues Pin
Joshua Lunsford24-Mar-06 9:03
Joshua Lunsford24-Mar-06 9:03 
AnswerRe: Expanded Remote Registry Editing Issues Pin
Dave Kreskowiak24-Mar-06 9:35
mveDave Kreskowiak24-Mar-06 9:35 
GeneralRe: Expanded Remote Registry Editing Issues Pin
Joshua Lunsford24-Mar-06 9:54
Joshua Lunsford24-Mar-06 9:54 
GeneralRe: Expanded Remote Registry Editing Issues Pin
Dave Kreskowiak24-Mar-06 12:42
mveDave Kreskowiak24-Mar-06 12:42 

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.