|
-
Aug 16th, 2001, 09:37 PM
#1
Thread Starter
Frenzied Member
Textbox Style
How can I change the style of a textbox from Spy++ or by writing my own application? Take a look at my Spy++ screenshot to see what it is I'm trying to change.
-
Aug 16th, 2001, 09:52 PM
#2
Thread Starter
Frenzied Member
Nobody knows? Not even megatron?
-
Aug 16th, 2001, 09:53 PM
#3
Member
I saw the screenshot, but what does the Style represent? The border of the textbox?
-
Aug 16th, 2001, 09:54 PM
#4
Member
It's also kinda late in the night.
-
Aug 16th, 2001, 09:56 PM
#5
Thread Starter
Frenzied Member
The style is the different propertys and stuph, I'm trying to change the locked property and I know the style for a non-locked textbox and for a locked text box.
-
Aug 17th, 2001, 04:00 AM
#6
PowerPoster
Originally posted by numtel
Nobody knows? Not even megatron?
Aarghhh. Pls try not to be so presumptious. I am sure that megatron would hate u saying this as much as other programmers on this site. Probably the reason that noone has answered is becos we (well at least I) have no idea what u are talking about. Do u want to change the style as in colours? 3d look? what? U mentioned the locked property. Do u want locked boxes to appear diff to non locked ones?
Pls rephrase qtn so that ppl can help... and who knows u may even get blessed by a *guru* visiting ur thread.
Regards
Stuart
-
Aug 17th, 2001, 04:09 AM
#7
Fanatic Member
If you want to get/change the style bits of a window, you use the GetWindowLong or SetWindowLong functions with the constant GWL_STYLE, or GWL_EXSTYLE for extended styles (you need the latter for things like determining if a window is an 'on top' one).
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Aug 17th, 2001, 04:15 AM
#8
PowerPoster
Originally posted by beachbum
..and who knows u may even get blessed by a *guru* visiting ur thread.
See, one just did. Hold on i didnt mean to say that... can't control fingers. Am typing "Kaverin is a genius".... arrrghhhh.... hhhheeeelppppppp mmmmeeeeeeeeeee
-
Aug 17th, 2001, 04:26 AM
#9
Well, the reason why I haven't answered yet is because I've never seen this thread before...
Use SetWindowLong. Here's an example that locks or unlocks an edit control (same thing as a textbox). EditHwnd is the handle ( or hWnd) if the control.
VB Code:
'These are the declarations
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const ES_READONLY = &H800&
'This code locks the edit control, or textbox
Dim lStyle As Long
lStyle = GetWindowLong(EditHwnd, GWL_STYLE)
lStyle = lStyle Or ES_READONLY
SetWindowLong EditHwnd, GWL_STYLE, lStyle
'This code unlocks it
Dim lStyle As Long
lStyle = GetWindowLong(EditHwnd, GWL_STYLE)
lStyle = lStyle And Not ES_READONLY
SetWindowLong EditHwnd, GWL_STYLE, lStyle
Note: When I was testing this on a vb textbox, the property of the textbox would change as expected, but the behavior wasn't changing for some reason. Just figured I'd let you know.
-
Aug 17th, 2001, 04:27 AM
#10
wow, two posts were made in the time it took for me to make my post. Looks like I spent too much time on it..
-
Aug 17th, 2001, 04:33 AM
#11
PowerPoster
OK Maybe i am missing something here. but surely numtel would just use the Locked property of the textbox if that was what was required. I was assuming that he wanted the textbox to somehow *look* different if locked. I guess we need to wait for him to repost to clarify
Regards
Stuart
-
Aug 17th, 2001, 05:01 AM
#12
I'm guessing he wants to change it in a textbox outside his app.
-
Aug 17th, 2001, 03:36 PM
#13
Thread Starter
Frenzied Member
I just woke up... The set window long might be what I'm looking for. What I'm trying to do is unlock a Edit control in another application.
-
Aug 17th, 2001, 04:54 PM
#14
*Cough* Hacking *Cough*
Why unlock if the programmer of the program wont let you ^_^
-
Aug 17th, 2001, 07:52 PM
#15
Member
If it takes all this trouble (bruhaha?) to do what you're trying to do, it's probably because someone doesn't want you doing it...
Executive Project Director
Technosoft Enterprises
Any of my opinions stated on this or any other forums do not represent the official policy of Technosoft Enteprises, unless otherwise specified.
-
Aug 17th, 2001, 08:38 PM
#16
Re: *Cough* Hacking *Cough*
Originally posted by DaoK
Why unlock if the programmer of the program wont let you ^_^
Why does it matter? There are plenty of legitimite reasons to want to change the properties and behavior of controls on other programs.
-
Aug 18th, 2001, 11:31 AM
#17
That a smile = I dont care lol
-
Aug 18th, 2001, 11:43 AM
#18
Oh, I was wondering what that was
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
|