now, the good idea is to add icons support
Office-style menus
Updated the code in my first post (also put it between a single code-block for easier copy-pasting).
Added: Icon support! Add icons to menu items with:
Only native icons for now, will add support later for other image types. (See the "Tools"-menu for an example on how they look).
Added: Check marks. See "File"-menu for example.
Still to do:
- There's some slight flickering, I'll hopefully get rid of that by using memdc's.
- Fix code for Win98. Hard to do, since I don't have Win98 available right now, but I'll try anyway. The problems with the code and W98 is that previous Windows-versions had globally shared menu resources, which were very particular about what you did to them. W2K is probably the same. I'll see if I can find a fix though.
- Better icon support, different image formats and so on. Also, disabled icon states.
- Fix edit control (string gadget) context menus.
- Better coloring and color management.
- Slap the whole thing on a rebar, so we can get a menu identical to the ones in MS Office -products.
That's it for now, let me know if you find more bugs.
Added: Icon support! Add icons to menu items with:
Code: Select all
OfficeMenuSetIcon ( MenuID , ItemID , IconID )Added: Check marks. See "File"-menu for example.
Still to do:
- There's some slight flickering, I'll hopefully get rid of that by using memdc's.
- Fix code for Win98. Hard to do, since I don't have Win98 available right now, but I'll try anyway. The problems with the code and W98 is that previous Windows-versions had globally shared menu resources, which were very particular about what you did to them. W2K is probably the same. I'll see if I can find a fix though.
- Better icon support, different image formats and so on. Also, disabled icon states.
- Fix edit control (string gadget) context menus.
- Better coloring and color management.
- Slap the whole thing on a rebar, so we can get a menu identical to the ones in MS Office -products.
That's it for now, let me know if you find more bugs.
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
On Vista the chr(9) stuff to put the keyboard shortcut on the right (right justified) just seems to do a regular tab. Haven't looked on anything other than Vista, maybe the same on others?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- electrochrisso
- Addict

- Posts: 989
- Joined: Mon May 14, 2007 2:13 am
- Location: Darling River
@Tranquil
change this line to If OSVersion ( ) => #PB_OS_Windows_98
change this line to If OSVersion ( ) => #PB_OS_Windows_98
Code: Select all
Procedure InitOffice ( Window )
If OSVersion ( ) => #PB_OS_Windows_98 ; #PB_OS_Windows_XP
If Not GetProp_ ( WindowID ( Window ) , "OfficeMenuHook" )
SetProp_ ( WindowID ( Window ) , "WindowProc" , SetWindowLong_ ( WindowID ( Window ) , #GWL_WNDPROC , @OfficeWindowCallback ( ) ) )
SetProp_ ( WindowID ( Window ) , "OfficeMenuHook" , SetWindowsHookEx_ ( #WH_CALLWNDPROC , @OfficeHook ( ) , #Null , GetWindowThreadProcessId_ ( WindowID ( Window ) , #Null ) ) )
ProcedureReturn #True
EndIf
EndIf
ProcedureReturn #Null
EndProcedure-
techjunkie
- Addict

- Posts: 1126
- Joined: Wed Oct 15, 2003 12:40 am
- Location: Sweden
- Contact:
@eesau : again no run on Win98
Code: Select all
Procedure InitOffice ( Window )
If OSVersion ( ) > #PB_OS_Windows_98
If Not GetProp_ ( WindowID ( Window ) , "OfficeMenuHook" )
SetProp_ ( WindowID ( Window ) , "WindowProc" , SetWindowLong_ ( WindowID ( Window ) , #GWL_WNDPROC , @OfficeWindowCallback ( ) ) )
SetProp_ ( WindowID ( Window ) , "OfficeMenuHook" , SetWindowsHookEx_ ( #WH_CALLWNDPROC , @OfficeHook ( ) , #Null , GetWindowThreadProcessId_ ( WindowID ( Window ) , #Null ) ) )
ProcedureReturn #True
EndIf
EndIf
ProcedureReturn #Null
EndProcedure
Forgot to remove thatABBKlaus wrote:@eesau : again no run on Win98![]()
Code: Select all
If OSVersion ( ) > #PB_OS_Windows_98
It *should* run on Win98, but I'll have to test some more.


