SendMessage_

Just starting out? Need help? Post your questions and find answers here.
EvilByte
User
User
Posts: 13
Joined: Wed Dec 15, 2010 5:21 pm
Location: Greece

SendMessage_

Post by EvilByte »

How to use this command to make an editor gadget non-readonly? (#ReadOnly flag)
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: SendMessage_

Post by netmaestro »

Assuming your editor gadget is 0:

Code: Select all

SendMessage_(GadgetID(0), #EM_SETREADONLY, 0, 0)
Pass #True for wParam to set it back to readonly.
BERESHEIT
EvilByte
User
User
Posts: 13
Joined: Wed Dec 15, 2010 5:21 pm
Location: Greece

Re: SendMessage_

Post by EvilByte »

Thanks but the editor is not a purebasic gadget.
Should i change GadgetID(0) to control id?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: SendMessage_

Post by netmaestro »

Use the hwnd of the control (large number) not the control ID (small number)
BERESHEIT
EvilByte
User
User
Posts: 13
Joined: Wed Dec 15, 2010 5:21 pm
Location: Greece

Re: SendMessage_

Post by EvilByte »

Hmm i use winspector and i found that control is named RichEdit20W & ID is 1153 but when i use the API

Code: Select all

SendMessage_(1153, #EM_SETREADONLY, 0, 0) 
nothing changes :(
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: SendMessage_

Post by netmaestro »

1153 is going to be the control id. Remember I told you you need the hwnd and that is going to be a large number, like 21593776 or such. It's the handle you want, surely Winspector provides that too.
BERESHEIT
EvilByte
User
User
Posts: 13
Joined: Wed Dec 15, 2010 5:21 pm
Location: Greece

Re: SendMessage_

Post by EvilByte »

Not sure why now works but i found 000104C4 at winspector and added a '$' in front of it.

Code: Select all

SendMessage_($000104C4, #EM_SETREADONLY, 0, 0)

works perfecty!

Thank you for your time my friend! :D
Post Reply