Forum | | | | Detlef Jagolski | Hello Community! ,
I Subclasse the Editcontrol, see supra around the Context menu To change.
Klappt too very well. CompileMarkSeparation but with the new function SubClassProc Klappt not. CompileMarkSeparation What do I do wrong,?
Greeting
Detlef |
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 06/02/08 ▲ |
| |
| | | | | | | |
| | Detlef Jagolski | Hello If,
The Procedures ConTextMenu, MeasureItem and DrawItem are with both same.
Nochwas, if I the hwnd Menu Subclasse functions too without Problems.
As I said code 1 functions without Problems The others not CompileMarkSeparation $P+
Set(ErrorLevel,0)
Set(FastMode,1)
*** GlobalStatements der Form
$H C:PROGRAMMEXPROFAN10INCLUDEWINDOWS.PH
$H C:PROGRAMMEXPROFAN10INCLUDEMESSAGES.PH
$H C:PROGRAMMEXPROFAN10INCLUDESHELLAPI.PH
$H C:PROGRAMMEXPROFAN10INCLUDESTRUCTS.PH
$H C:PROGRAMMEXPROFAN10INCLUDECOMMCTRL.PH
$H C:PROGRAMMEXPROFAN10INCLUDEWIND.PH
$I C:PROGRAMMEPRFELLOWLIBXPMENU.INC
Def EnableMenuItem(3) !USER32,EnableMenuItem
var hOldFont& = Create(FONT,Arial,14,0,0,0,0)
Proc EditProc
Parameters Edit&, Message&, wParam&, lParam&
Select Message&
CaseOf ~WM_CONTEXTMENU
ConTextMenu LoWord(lParam&), HiWord(lParam&)
CaseOf ~WM_MEASUREITEM
MeasureItem Edit&, lParam&
CaseOf ~WM_DRAWITEM
DrawItem lParam&
EndSelect
Return ~CallWindowProc(OldEdit&Proc&, Edit&&, Message&, wParam&, lParam&)
EndProc
Declare appexit%
Declare Edit&
Set(TrueColor,1)
WindowStyle $003F
WindowTitle DesignForm
Window %maxX + 5,114 - 498,415
Cls ~GetSysColor(15)
UseFont MS Sans Serif,13,0,0,0,0
CreateImageList ICONXP32.DLL
SetMenuBitmap SP32.DLL, FSSP
SetCheckedImage 116
SetMenuStandardColors
var Rueckgaengig$ = Rückgängig
var Ausschneiden$ = Ausschneiden
var Kopieren$ = Kopieren
var Einfuegen$ = Einfügen
var Loeschen$ = Löschen
var AllesMarkieren$ = Alles markieren
var hConTextMenu& = ~CreatePopupMenu()
~AppendMenu(hConTextMenu&, ~MF_STRING,1000,Addr(Rueckgaengig$))
~AppendMenu(hConTextMenu&, ~MF_SEPARATOR,101,0)
~AppendMenu(hConTextMenu&, ~MF_STRING,1002,Addr(Ausschneiden$))
~AppendMenu(hConTextMenu&, ~MF_STRING,1003,Addr(Kopieren$))
~AppendMenu(hConTextMenu&, ~MF_STRING,1004,Addr(Einfuegen$))
~AppendMenu(hConTextMenu&, ~MF_STRING,1005,Addr(Loeschen$))
~AppendMenu(hConTextMenu&, ~MF_SEPARATOR,106,0)
~AppendMenu(hConTextMenu&, ~MF_STRING,1007,Addr(AllesMarkieren$))
ChangeMenuItem hConTextMenu&,0,3,hOldFont&
ChangeMenuItem hConTextMenu&,1,-1,-1
ChangeMenuItem hConTextMenu&,2,0,hOldFont&
ChangeMenuItem hConTextMenu&,3,1,hOldFont&
ChangeMenuItem hConTextMenu&,4,2,hOldFont&
ChangeMenuItem hConTextMenu&,5,5,hOldFont&
ChangeMenuItem hConTextMenu&,6,-1,-1
ChangeMenuItem hConTextMenu&,7,-1,hOldFont&
Edit&=CreateEdit(%hwnd,,125,90,121,21)
OldEdit&Proc& = ~SetWindowLong(Edit&,~GWL_WNDPROC,ProcAddr(EditProc,4))
SetWindowPos %hwnd = 207,114 - 498,415;0
WhileNot appexit%
WaitInput
If %key = 2
appexit%=1
ElseIf GetFocus(Edit1&)
ElseIf %key = 4
Fenstergröße
ElseIf %key = 5
Hilfe
EndIf
Wend
CompileMarkSeparation $P+
Set(ErrorLevel,0)
*** GlobalStatements the shape
$H C:PROGRAMMEXPROFAN10INCLUDEWINDOWS.PH
$H C:PROGRAMMEXPROFAN10INCLUDEMESSAGES.PH
$H C:PROGRAMMEXPROFAN10INCLUDESHELLAPI.PH
$H C:PROGRAMMEXPROFAN10INCLUDESTRUCTS.PH
$H C:PROGRAMMEXPROFAN10INCLUDECOMMCTRL.PH
$H C:PROGRAMMEXPROFAN10INCLUDEWIND.PH
$I C:PROGRAMMEPRFELLOWLIBXPMENU.INC
Def EnableMenuItem(3) !USER32,EnableMenuItem
var hOldFont& = Create(FONT,Arial,14,0,0,0,0)
SubClassProc
If SubClassMessage(Edit&, ~WM_CONTEXTMENU)
ConTextMenu LoWord(&sLParam), HiWord(&sLParam)
ElseIf SubClassMessage(Edit&, ~WM_MEASUREITEM)
MeasureItem Edit&, &sLParam
ElseIf SubClassMessage(Edit&, ~WM_DRAWITEM)
DrawItem &sLParam
EndIf
ENDPROC
Declare appexit%
Declare Edit&
Set(TrueColor,1)
Window Style $003F
Window Title DesignForm
Window %maxX + 5,114 - 498,415
Cls ~GetSysColor(15)
UseFont MS Sans Serif,13,0,0,0,0
CreateImageList ICONXP32.DLL
SetMenuBitmap SP32.DLL, FSSP
SetCheckedImage 116
SetMenuStandardColors
var Rueckgaengig$ = Rückgängig
var cut out$ = cut out
var copy$ = copy
var Einfuegen$ = Insert
var Remove$ = Delete
var AllesMarkieren$ = everything Mark
var hConTextMenu& = ~CreatePopupMenu()
~AppendMenu(hConTextMenu&, ~MF_STRING,1000,Addr(Rueckgaengig$))
~AppendMenu(hConTextMenu&, ~MF_SEPARATOR,101,0)
~AppendMenu(hConTextMenu&, ~MF_STRING,1002,Addr(cut out$))
~AppendMenu(hConTextMenu&, ~MF_STRING,1003,Addr(copy$))
~AppendMenu(hConTextMenu&, ~MF_STRING,1004,Addr(Einfuegen$))
~AppendMenu(hConTextMenu&, ~MF_STRING,1005,Addr(Remove$))
~AppendMenu(hConTextMenu&, ~MF_SEPARATOR,106,0)
~AppendMenu(hConTextMenu&, ~MF_STRING,1007,Addr(AllesMarkieren$))
ChangeMenuItem hConTextMenu&,0,3,hOldFont&
ChangeMenuItem hConTextMenu&,1,-1,-1
ChangeMenuItem hConTextMenu&,2,0,hOldFont&
ChangeMenuItem hConTextMenu&,3,1,hOldFont&
ChangeMenuItem hConTextMenu&,4,2,hOldFont&
ChangeMenuItem hConTextMenu&,5,5,hOldFont&
ChangeMenuItem hConTextMenu&,6,-1,-1
ChangeMenuItem hConTextMenu&,7,-1,hOldFont&
Edit&=CreateEdit(%hwnd,,125,90,121,21)
SubClass Edit&, 1
SetWindowPos %hwnd = 207,114 - 498,415;0
WhileNot appexit%
WaitInput
If %key = 2
appexit%=1
ElseIf GetFocus(Edit1&)
ElseIf %key = 4
Fenstergröße
ElseIf %key = 5
Help
EndIf
Wend
SubClass Edit&, 0
Greeting
Detlef |
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 06/02/08 ▲ |
| |
| | RGH | Hi, such a long time You do not z.B. too The XPMENU.INC and others Files, The not to that Lieferumfang of XProfan 10 belong, here mitlieferst, becomes nobody your Sourcecode testing and on Fehlersuche weg can. with unvollständigen Beispielcodes can nobody something begin.
Greeting Roland |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 06/02/08 ▲ |
| |
| | Detlef Jagolski | thanks all! Klappt now SUPER
Besondern Thanks on RGH and Andreas Miethe
Greeting
Detlef |
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 06/11/08 ▲ |
| |
| | Jörg Sellmeyer | sees very professional and so none profane from! |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 06/11/08 ▲ |
| |
| | Detlef Jagolski | | | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 06/12/08 ▲ |
| |
| | | Mach for one new Topic on. |
| | | | |
| | Jac de Lad | and with welchem code functions the now?? |
| | | Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 07/08/08 ▲ |
| |
| | Detlef Jagolski | Hello Jac,
the has RGH yet changed:
New in Subscriptionsversion RC7: ================================ ACHTUNG: ÄNDERUNGEN BEIM SUBCLASSING - After thorough Tests get some smaller ones Changes necessary:
- The function @SubClassMessage() changed whom status, whether The ursprüngliche Windowsprozedur called becomes or not, not any more! should tappt im dunkeln not called go, is always integrally aware Set(WinProc, 0) einzufügen. Defaultmäßig becomes, if nothing other indicated becomes, The ursprüngliche Windowsprozedur in the Connection on SubClassProc called (How yet) - Bislang sorgt a interne request for, that a Message, The during the SubClassProc called becomes, not anew The SubClassProc aufruft, there this in rare Make To Problemen lead can. In this case becomes The Message naturally not verschluckt, separate on The ursprüngliche Windowsprozedur weitergeleitet. These request can now with @Set(SubClassMode, 1) übergangen go. The abgesicherte mode can with @Set(SubClassMode, 0) tuned go. - TrackMenu and @TrackMenu() count in the senses the SubClassings too as WaitInput.
Greeting
Detlef |
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 07/08/08 ▲ |
| |
| | Jac de Lad | Ah understand, the supra named Source should now means weg. |
| | | Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 07/08/08 ▲ |
| |
| | Sato Pinto | Hello Detlef
Can The XPMENU.INC somewhere loading? is with these INC too The Tortengraphic machbar as in your Program plan-Calc standing?
greeting
Sato |
| | | | |
|
AnswerThemeninformationenthis Topic has 6 subscriber: |