Split Menu In PowerBuilder


1 2 3 4 5 6 7 8 |
//Declare Local Functions Function UInt GetMenu ( UInt WindowHandle ) Library "USER32.DLL" Function Integer ModifyMenu ( UInt MenuHandle, Int Position, UInt Flags, Int NewItemID, Ref String NewItem ) Library "USER32.DLL" Alias For "ModifyMenuA;Ansi" Function Long GetMenuItemID ( UInt MenuHandle, Int Position ) Library "USER32.DLL" Subroutine DrawMenuBar ( UInt WindowHandle ) Library "USER32.DLL" Function Integer InsertMenu ( UInt MenuHandle, Int Position, UInt Flags, Int NewItemID, Ref String NewItem ) Library "USER32.DLL" Alias For "InsertMenu;Ansi" Function Integer GetMenuString ( UInt MenuHandle, UInt ItemID, Ref String MenuText, Int MaxLen, UInt Flag ) Library "USER32.DLL" Alias For "GetMenuStringA;Ansi" function ulong GetSubMenu ( ulong menuhandle, int itempos ) Library "user32.dll" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
//==================================================================== // Function: of_split() //-------------------------------------------------------------------- // Description: Split Menu In PowerBuilder //-------------------------------------------------------------------- // Arguments: // value Window aw_parent // value menu am_menu // value integer ai_numrow // value integer ai_flags //-------------------------------------------------------------------- // Returns: (none) //-------------------------------------------------------------------- // Usage: of_split() //-------------------------------------------------------------------- // Modify History: // //==================================================================== //Declare local variables integer li_result, li_newitem, li_length = 144 string ls_newitem = Space ( li_length ) uint lui_menu_handle, lui_pop_handle, lui_window_handle lui_window_handle = Handle ( aw_parent ) //Get the handle of the menu lui_menu_handle = GetMenu ( lui_window_handle ) //Get the handle for the popup menu lui_pop_handle = GetSubMenu ( lui_menu_handle, ai_pos1 ) //Get the menuid for the item we want to change li_newitem = GetMenuItemID ( lui_pop_handle, ai_numrow ) //Get the test for that menu item li_result = GetMenuString ( lui_menu_handle, li_newitem, ls_newitem, li_length, 0 ) //Modify the menu li_result = ModifyMenu ( lui_menu_handle, li_newitem, ai_flags, li_newitem, ls_newitem ) //Redraw the menu DrawMenuBar ( lui_window_handle ) |
Find Projects On Github click here
Good Luck!
Subscribe
Login
0 Comments
Oldest