Thanks MASTER NETMAESTRO
It's exactely what i want....
You are really my favorite frog

Perhaps a day ....i can give you, a little kiss on your splendid teeth, for thanks you to all your help at KCC :roll:
And you transform in prince, like in walt disney...
And even...i'm sure you transform in better that a prince ....in
king of the programming
I have try to modify your jewel...and with it ...KCC have make a ....vulgar stone code

Because i want can stop the effect of inactive Editor.
The top of the top, is a function like this
I have again a problem, when the Edito to be active, i can write on it, but not Erase character
This is my shit
Code: Select all
Global ActiveEditor
Procedure EditorDisable(PbId, Value)
If Value
ActiveEditor = #False
SetGadgetAttribute(0, #PB_Editor_ReadOnly, #True)
Else
ActiveEditor = #True
ShowCaret_(GadgetID(0))
SetGadgetAttribute(0, #PB_Editor_ReadOnly, #False)
EndIf
EndProcedure
Procedure EditProc(hwnd, msg, wparam, lparam)
oldproc = GetProp_(hwnd, "oldproc")
Select msg
Case #WM_NCDESTROY
If Not ActiveEditor
RemoveProp_(hwnd, "oldproc")
EndIf
Case #WM_MOUSEMOVE
If Not ActiveEditor
If GetForegroundWindow_()<>WindowID(0)
SetForegroundWindow_(WindowID(0))
EndIf
If GetActiveGadget()<>GetDlgCtrlID_(hwnd)
SetActiveGadget(GetDlgCtrlID_(hwnd))
EndIf
HideCaret_(GadgetID(0))
EndIf
Case #WM_KEYDOWN, #WM_KEYUP
ProcedureReturn 0
Case #WM_RBUTTONDOWN
If Not ActiveEditor
MessageRequester("", "Hello PB, 'im active now !!")
EditorDisable(0, #False)
Else
MessageRequester("", "Hello PB, 'im inactive now !!")
EditorDisable(0, #True)
EndIf
EndSelect
ProcedureReturn CallWindowProc_(oldproc, hwnd, msg, wparam, lparam)
EndProcedure
Procedure WinProc(hwnd, msg, wparam, lparam)
result = #PB_ProcessPureBasicEvents
If Not ActiveEditor
Select msg
Case #WM_COMMAND
If lparam = GadgetID(0)
If wparam>>16 = #EN_SETFOCUS
HideCaret_(GadgetID(0))
EndIf
EndIf
EndSelect
EndIf
ProcedureReturn result
EndProcedure
OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
hwnd = EditorGadget(0, 8, 8, 306, 133, #PB_Editor_ReadOnly)
SetGadgetText(0,"Hello I'm an inactive editor gadget," + Chr(13) + "Right click To convert me in active editor !!!")
SetProp_(hwnd, "oldproc", SetWindowLongPtr_(hwnd, #GWL_WNDPROC, @EditProc()))
SetWindowCallback(@WinProc())
EditorDisable(0, #True)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow