Bugs and vermeintliche | | | | Detlef Jagolski | Hello Roland,
have a Dll for Owner Draw Menüs, under XProfan 11 there were no Problems. with XProfan 11.2 have now one Anwendungsfehler. have You one Tipp for me, How I the again hinbekomme the it again runs?
Greeting Detlef CompileMarkSeparation $P+
Set(ErrorLevel,0)
$H WINDOWS.PH
$H MESSAGES.PH
$H SHELLAPI.PH
$H STRUCTS.PH
$H COMMCTRL.PH
$I XPSTILDLL32.INC
Declare appexit%
Declare Edit1&
var hMenuFont1& = Create(FONT,Arial,14,0,0,0,0)
var hMenuFont2& = Create(FONT,Arial,14,0,0,1,0)
var hMenuFont3& = Create(FONT,Arial,16,0,1,1,0)
SubClassProc
If SubClassMessage(%hwnd, ~WM_MEASUREITEM)
MeasureItem (&sWnd, &sLParam)
Set(WinProc,1)
ElseIf SubClassMessage(%hwnd, ~WM_DRAWITEM)
DrawItem (&sLParam, hImageList1&, hImageList2&)
Set(WinProc,1)
ElseIf SubClassMessage(Edit1&, ~WM_CONTEXTMENU)
ConTextMenu (Edit1&, hConTextMenu&, LoWord(&sLParam), HiWord(&sLParam))
Set(WinProc, 0)
ElseIf SubClassMessage(Edit1&, ~WM_MEASUREITEM)
MeasureItem (Edit1&, &sLParam)
Set(WinProc, 0)
ElseIf SubClassMessage(Edit1&, ~WM_DRAWITEM)
DrawItem (&sLParam, hImageList1&, hImageList2&)
Set(WinProc, 0)
ElseIf SubClassMessage(Edit1&, ~WM_COMMAND)
WMCommand (Edit1&, &sWParam)
Set(WinProc, 0)
EndIf
EndProc
Proc CreateMainMenu
Popup &Datei
AppendMenu 1,&Neu... Strg+N
AppendMenu 2,&Öffnen... Strg+O
AppendMenu 3,S&chließen
Separator
AppendMenu 5,&Speichern Strg+S
AppendMenu 6,Speichern &unter...
Separator
AppendMenu 8,Seiten&ansicht
AppendMenu 9,&Drucken... Strg+P
Separator
AppendMenu 11,&Beenden
Popup &Bearbeiten
AppendMenu 12,A&usschneiden Strg+X
AppendMenu 13,&Kopieren Strg+C
AppendMenu 14,E&infügen Strg+V
Separator
AppendMenu 16,&Suchen... Strg+F
SubPopup &Gehe zu
AppendMenu 17,&Erster
AppendMenu 18,&Letzter
AppendMenu 19,&Nähster
AppendMenu 20,&Vorheriger
EndSub
EndProc
Set(TrueColor,1)
WindowStyle $003F
WindowTitle Menü
Window %maxX + 5,114 - 742,528
Cls ~GetSysColor(15)
CreateMainMenu
UseFont MS Sans Serif,13,0,0,0,0
SetDialogFont 1
var IconDll$ = XPStilDll32.Dll
var hImageList1& = CreateImageList(Addr(IconDll$))
var hImageList2& = CreateImageListGray(Addr(IconDll$))
SetCheckedImage(116)
SetMenuStandardColors()
SetMenuColors (RGB(230,0,0),RGB(100,0,0),RGB(10,100,20),RGB(255,253,191),RGB(230,0,0),RGB(255,208,251))
SetMenuBitmap (SP32.DLL, MICKI)
var hConTextMenu& = SetConTextMenuEdit(hMenuFont1&,-1,3,0,1,2,5,-1)
var hMenu& = ~GetMenu(%hwnd)
var hSubMenu& = ~GetSubMenu(hMenu&,0)
SetColorXPMenu hMenu&, RGB(187,212,247)
ChangeMenuItem (hSubMenu&,0,45,hMenuFont2&,RGB(230,0,0))
ChangeMenuItem (hSubMenu&,1,7,hMenuFont1&,RGB(230,0,0))
ChangeMenuItem (hSubMenu&,2,-1,hMenuFont2&,RGB(230,0,0))
ChangeMenuItem (hSubMenu&,3,-1,-1,-1)
ChangeMenuItem (hSubMenu&,4,16,hMenuFont3&,RGB(230,0,0))
ChangeMenuItem (hSubMenu&,5,-1,hMenuFont1&,RGB(70,75,210))
ChangeMenuItem (hSubMenu&,6,-1,-1,-1)
ChangeMenuItem (hSubMenu&,7,8,hMenuFont1&,RGB(70,75,210))
ChangeMenuItem (hSubMenu&,8,12,hMenuFont1&,RGB(70,75,210))
ChangeMenuItem (hSubMenu&,9,-1,-1,-1)
ChangeMenuItem (hSubMenu&,10,-1,hMenuFont1&,RGB(70,75,210))
hSubMenu& = ~GetSubMenu(hMenu&,1)
ChangeMenuItem (hSubMenu&,0,0,hMenuFont1&,RGB(70,75,210))
ChangeMenuItem (hSubMenu&,1,1,hMenuFont1&,RGB(70,75,210))
ChangeMenuItem (hSubMenu&,2,2,hMenuFont1&,RGB(70,75,210))
ChangeMenuItem (hSubMenu&,3,-1,-1,-1)
ChangeMenuItem (hSubMenu&,4,11,hMenuFont2&,RGB(0,53,99))
ChangeMenuItem (hSubMenu&,5,-1,hMenuFont1&,-1)
var hSubPopMenu& = ~GetSubMenu(hSubMenu&,5)
ChangeMenuItem (hSubPopMenu&,0,117,hMenuFont1&,-1)
ChangeMenuItem (hSubPopMenu&,1,119,hMenuFont1&,-1)
ChangeMenuItem (hSubPopMenu&,2,113,hMenuFont1&,-1)
ChangeMenuItem (hSubPopMenu&,3,114,hMenuFont1&,-1)
Edit1&=Create(Edit,%hwnd,,112,153,121,21)
Set(SubClassMode,1)
SubClass %hwnd,1
SubClass Edit1&,1
SetWindowPos %hwnd = 207,114 - 742,528;0
WhileNot appexit%
WaitInput
If %key = 2
appexit%=1
ElseIf Clicked(Edit1&)
ElseIf Clicked(ChoiceBox1&)
ElseIf %key = 4
Fenstergröße
ElseIf %key = 5
Hilfe
EndIf
Wend
SubClass %hwnd,0
SubClass Edit1&,0
|
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 04/06/09 ▲ |
| |
| | RGH | Hi,
first of all I get with Your code whom Error Definition in the Header missing: MENUINFO. In which Headerdatei is with you these Definition drin? (then can I tappt im dunkeln by me nachtragen.)
to that others: with WM_DRAWITEM and WM_MEASUREITEM setting You WinProc on 1, d.h. it'll means subsequently The Windowsprozedur called. there XProfan 11.2 Own erweiterte Menüs anbietet, reacted these then means on these Messages. i know now not, what ChangeMenuItem very power, but presumably give You whom Menu-Einträgen whom Style MF_OWNERDRAW. (otherwise would these Messages Yes not created go.) there You but presumably whom Datenwert (last Parameter with AppendMenu in the entrapment of MF_OWNERDRAW) differently uses as i, must it here zwangsläufig bang, because my routines for these both Messages Yes not your Inhalten calculate.
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 | 04/06/09 ▲ |
| |
| | Detlef Jagolski | Sorry MenuInfo standing in structs.ph CompileMarkSeparationMENUINFO = cbSize&,fMask&,dwStyle&,cyMax&,hbrBack&,dwContextHelpID&,dwMenuData&; > ChangeMenuItem setting MF_OWNERDRAW, Icon, Font Type and Schriftfarbe.
Greeting
Detlef |
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 04/06/09 ▲ |
| |
| | Detlef Jagolski | Hello Roland,
have now Set(WinProc, 1) on Set(WinProc, 0) staid, and It's all right.
super and thanks |
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 04/06/09 ▲ |
| |
|
AnswerThemeninformationenthis Topic has 2 subscriber: |