|
-
Jan 10th, 2000, 04:07 AM
#1
Thread Starter
Hyperactive Member
I need to disable a control on another program. I can call the window and retrieve its handle. How would I get the specific control's handle? Would I then use sendmessage?
Thanks in advance,
Wade
-
Jan 10th, 2000, 04:34 AM
#2
Addicted Member
I hope I can help.
I found a really neat page today ( the code has a few erros) But if you play with it, it will work. This , After edited will print out every handle of the Window, and all the other Info.
Try this.. http://support.microsoft.com/support.../Q147/6/59.asp
And I dont Know the sendmessage command to disable a window.. but I hope that helps some
-
Jan 10th, 2000, 04:36 AM
#3
Addicted Member
I hope I can help.
I found a really neat page today ( the code has a few erros) But if you play with it, it will work. This , After edited will print out every handle of the Window, and all the other Info.
Try this.. http://support.microsoft.com/support.../Q147/6/59.asp
And I dont Know the sendmessage command to disable a window.. but I hope that helps some
-
Jan 10th, 2000, 05:27 AM
#4
Thread Starter
Hyperactive Member
The article is for window handles which I already have. I need to get the control handle.
Anyone else know?
Thanks.
-
Jan 10th, 2000, 05:34 AM
#5
The Control is just a Child Window, so you need the Child Windows Handle, you could get this using the FindWindowEx API and look for the specific controls Class, it's really going to be application specific.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 10th, 2000, 05:51 AM
#6
Thread Starter
Hyperactive Member
Aaron,
If I renum all of the windows and pop a messagebox, I can see all of the class names. Is there anything you can tell me that I should look for when looking for a particular control? Would spy++ be helpful?
Thanks,
Wade
-
Jan 10th, 2000, 05:53 AM
#7
Spy++ would be very useful, it's not much use my giving you a Class name as the App you're looking at could use an entirely different class altogether.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 10th, 2000, 06:22 AM
#8
Thread Starter
Hyperactive Member
Ok, I have the class name thru Spy++, so I can get the control handle. Can I use SendMessage to disable the control?
Thanks.
-
Jan 10th, 2000, 07:34 AM
#9
Hyperactive Member
-
Jan 10th, 2000, 10:31 PM
#10
Thread Starter
Hyperactive Member
The control is for the username on a login screen. I need to prevent the user from attempting to login with someone else's name.
So can I use SendMessage to disable it? Could someone share the syntax?
Thanks so much,
Wade
-
Jan 11th, 2000, 05:33 AM
#11
Once you have the Controls Window Handle you can use the EnableWindow() API, ie.
Call EnableWindow(lCtrlHwnd, 0) 'Disable Control
Or..
Call EnableWindow(lCtrlHwnd, 1) 'Enable Control
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 11th, 2000, 05:45 AM
#12
Thread Starter
Hyperactive Member
Thanks for the EnableWindow api. I ran Spy++ to get the control's class and it turns out that 2 controls share the same class. Although they have different text values, Spy++ says they both have "" for the caption. What can I do to differentiate the 2 controls?
Thanks,
Wade
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|