Click here to Skip to main content
15,904,153 members
Home / Discussions / C#
   

C#

 
GeneralRe: XML Databases Pin
ptr2void21-Apr-08 17:50
ptr2void21-Apr-08 17:50 
QuestionDateTime: UTC vs Local Pin
ptr2void21-Apr-08 2:59
ptr2void21-Apr-08 2:59 
GeneralRe: DateTime: UTC vs Local Pin
Colin Angus Mackay21-Apr-08 3:11
Colin Angus Mackay21-Apr-08 3:11 
GeneralRe: DateTime: UTC vs Local Pin
ptr2void21-Apr-08 3:21
ptr2void21-Apr-08 3:21 
GeneralRe: DateTime: UTC vs Local Pin
J4amieC21-Apr-08 3:31
J4amieC21-Apr-08 3:31 
GeneralRe: DateTime: UTC vs Local Pin
ptr2void21-Apr-08 3:51
ptr2void21-Apr-08 3:51 
AnswerRe: DateTime: UTC vs Local Pin
Simon P Stevens21-Apr-08 3:16
Simon P Stevens21-Apr-08 3:16 
GeneralRe: DateTime: UTC vs Local Pin
ptr2void21-Apr-08 3:45
ptr2void21-Apr-08 3:45 
GeneralRe: DateTime: UTC vs Local Pin
ptr2void21-Apr-08 3:46
ptr2void21-Apr-08 3:46 
GeneralRe: DateTime: UTC vs Local Pin
J4amieC21-Apr-08 3:17
J4amieC21-Apr-08 3:17 
GeneralRe: DateTime: UTC vs Local [modified] Pin
ptr2void21-Apr-08 3:44
ptr2void21-Apr-08 3:44 
GeneralRe: DateTime: UTC vs Local Pin
Colin Angus Mackay21-Apr-08 5:57
Colin Angus Mackay21-Apr-08 5:57 
GeneralRe: DateTime: UTC vs Local Pin
J4amieC21-Apr-08 6:57
J4amieC21-Apr-08 6:57 
GeneralRe: DateTime: UTC vs Local Pin
Colin Angus Mackay21-Apr-08 7:21
Colin Angus Mackay21-Apr-08 7:21 
GeneralRe: DateTime: UTC vs Local Pin
ptr2void21-Apr-08 17:49
ptr2void21-Apr-08 17:49 
GeneralRe: DateTime: UTC vs Local Pin
ptr2void21-Apr-08 17:53
ptr2void21-Apr-08 17:53 
Questionc# Pin
veronika8921-Apr-08 2:45
veronika8921-Apr-08 2:45 
GeneralRe: c# Pin
Pete O'Hanlon21-Apr-08 2:49
mvePete O'Hanlon21-Apr-08 2:49 
GeneralRe: c# Pin
Vikram A Punathambekar21-Apr-08 2:53
Vikram A Punathambekar21-Apr-08 2:53 
GeneralRe: c# Pin
CPallini21-Apr-08 3:31
mveCPallini21-Apr-08 3:31 
AnswerRe: c# Pin
V.22-Apr-08 1:56
professionalV.22-Apr-08 1:56 
Generalcontrolling controls with handles Pin
V.21-Apr-08 2:36
professionalV.21-Apr-08 2:36 
Guys,

Check out the following

private void btn_disable_Click(object sender, EventArgs e) {
    IntPtr handle = FindWindow(null, "windowtitle");
    Form.FromHandle(handle);
    IntPtr chandle = GetDlgItem(handle, Convert.ToInt32(txtbox_controlid.Text));
    Control.FromHandle(chandle);
    string text = "";
    GetWindowText(handle, text, 10);
    MessageBox.Show(text);
}

[DllImport(@"user32.dll", EntryPoint="GetDlgItem")]
public static extern IntPtr GetDlgItem(IntPtr DialogHandle, int ControlId);

[DllImport(@"user32.dll", EntryPoint="FindWindow")]
public static extern IntPtr FindWindow(string ClassName, string DialogTitle);

[DllImport(@"user32.dll", EntryPoint="GetWindowText")]
public static extern int GetWindowText(IntPtr Hwnd, string text, int length);


both handle as chandle give back an IntPtr different from zero. Yet my MessageBox will stay empty.
If I try to create a Control (Control.FromHandle(chandle);) I get back a null value.

I did find an article that uses SendMessage to manipulate controls, but I was wondering if I couldn't plug in into the control via a reference or something. (like TextBox.FromHandle(found_handle)). [EDIT]Goal is to get hold of the properties and methods of the control like backColor, ForeColor, GetWindowtext, SetWindowText, Enable, Visible, ...[/EDIT]

Am I on the wrong path here or did I just miss a detail?

thanks !!

V.

Stop smoking so you can: Enjoy longer the money you save.
Moviereview Archive

GeneralRe: controlling controls with handles Pin
carbon_golem21-Apr-08 7:01
carbon_golem21-Apr-08 7:01 
GeneralRe: controlling controls with handles Pin
V.22-Apr-08 1:48
professionalV.22-Apr-08 1:48 
GeneralRe: controlling controls with handles Pin
carbon_golem22-Apr-08 2:37
carbon_golem22-Apr-08 2:37 

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.