Don't matter, I found a way to access all the neccecary DLLs thanks to the Menus from CrashX
Requires the DarkSide DesktopDLL for the MenuBar but the right click menuwill still work
Sync On : Sync Rate 0
Set Window On
Set Display Mode 1024,768,32
gosub SetupMenus
do
CLS -1
MenuID = UpdateMenuBar()
If MouseClick() = 2 Then MenuID = OpenMenu(mTools,0,0)
If MenuID <> 0 Then n = MenuID
Text 100,100,Str$(n)
sync : loop
SetupMenus:
` For the Menu Bar
Type MenuBar_Type
Name As String
Menu As Integer
EndType
Dim MenuBar(0) As MenuBar_Type
` Constants used for AppendMenuA
#CONSTANT MENU_MF_BYCOMMAND 0
#CONSTANT MENU_MF_BYPOSITION 1024
#CONSTANT MENU_MF_SEPARATOR 2048
#CONSTANT MENU_MF_ENABLED 0
#CONSTANT MENU_MF_GRAYED 1
#CONSTANT MENU_MF_DISABLED 2
#CONSTANT MENU_MF_UNCHECKED 0
#CONSTANT MENU_MF_CHECKED 8
#CONSTANT MENU_MF_USECHECKBITMAPS 512
#CONSTANT MENU_MF_STRING 0
#CONSTANT MENU_MF_BITMAP 4
#CONSTANT MENU_MF_OWNERDRAW 256
#CONSTANT MENU_MF_POPUP 16
#CONSTANT MENU_MF_MENUBARBREAK 32
#CONSTANT MENU_MF_MENUBREAK 64
#CONSTANT MENU_MF_UNHILITE 0
#CONSTANT MENU_MF_HILITE 128
` Constants used for TrackPopupMenu
#CONSTANT MENU_TPM_LEFTBUTTON 0
#CONSTANT MENU_TPM_RIGHTBUTTON 2
#CONSTANT MENU_TPM_LEFTALIGN 0
#CONSTANT MENU_TPM_CENTERALIGN 4
#CONSTANT MENU_TPM_RIGHTALIGN 8
#CONSTANT MENU_TPM_RECURSE 1
#CONSTANT MENU_TPM_HORPOSANIMATION 1024
#CONSTANT MENU_TPM_HORNEGANIMATION 2048
#CONSTANT MENU_TPM_VERPOSANIMATION 4096
#CONSTANT MENU_TPM_VERNEGANIMATION 8192
` WINVER >= 0x0400
#CONSTANT MENU_TPM_TOPALIGN 0
#CONSTANT MENU_TPM_VCENTERALIGN 16
#CONSTANT MENU_TPM_BOTTOMALIGN 32
#CONSTANT MENU_TPM_HORIZONTAL 0
#CONSTANT MENU_TPM_VERTICAL 64
#CONSTANT MENU_TPM_NONOTIFY 128
#CONSTANT MENU_TPM_RETURNCMD 256
` Program Constants
#CONSTANT MENU_USER32_DLL_ID 200
#CONSTANT MENU_MEMBLOCK_1_ID 200
#CONSTANT MENU_BOOLEAN_FALSE 0
#CONSTANT MENU_BOOLEAN_TRUE 1
#CONSTANT MENU_MAX 100
#CONSTANT MENU_BAR_WIDTH 4
#CONSTANT MENU_BAR_HEIGHT 27
` Program Varaibles
GLOBAL MENU_hWnd AS INTEGER
GLOBAL MENU_hMenu AS INTEGER
GLOBAL MENU_msgPtr AS DWORD
GLOBAL MENU_menu_count AS INTEGER
GLOBAL MENU_mainMenu_count AS INTEGER
GLOBAL MENU_Mouse_hMenu AS INTEGER
type MenuType
menuId AS INTEGER
menuCaption AS STRING
hMenu AS INTEGER
disabled AS BOOLEAN
endtype
type MainMenuType
menuArrayIndex AS INTEGER
endtype
GLOBAL DIM MENU_menu(MENU_MAX) AS MenuType
GLOBAL DIM MENU_mainMenu(MENU_MAX) AS MainMenuType
` My Menu Constants
#Constant mFile 1
#Constant mOpen 2
#Constant mReopen 3
#Constant mReopen1 4
#Constant mReopen2 5
#Constant mReopen3 6
#Constant mReopen4 7
#Constant mReopen5 8
#Constant mReopen6 9
#Constant mReopen7 10
#Constant mReopen8 11
#Constant mReopen9 12
#Constant mReopen10 13
#Constant mSave 14
#Constant mSaveAs 15
#Constant mExport 16
#Constant mPreview 17
#Constant mPrint 18
#Constant mExit 19
#Constant mInsert 20
#Constant mNewLayer 21
#Constant mImportImage 22
#Constant mImportText 23
#Constant mTools 24
#Constant mSelect 25
#Constant mClone 26
#Constant mMove 27
#Constant mRotate 28
#Constant mEditText 29
#Constant mFlip 30
#Constant mMirror 31
#Constant mDelete 32
#Constant mEditBackImg 33
#Constant mBringToFront 34
#Constant mSendToBack 35
#Constant mView 36
#Constant mZoom 61
#Constant mZoomWidth 62
#Constant mZoomHeight 63
#Constant mZoomFit 64
#Constant mZoom10 65
#Constant mZoom20 66
#Constant mZoom30 67
#Constant mZoom40 68
#Constant mZoom50 69
#Constant mZoom60 70
#Constant mZoom70 71
#Constant mZoom80 72
#Constant mZoom90 73
#Constant mZoom100 74
#Constant mZoom150 75
#Constant mZoom200 76
#Constant mMouseGuide 37
#Constant mGuides 38
#Constant mMargins 39
#Constant mLayerBorders 40
#Constant mRuler 41
#Constant mDataTabs 42
#Constant mStatusBar 43
#Constant mWinColorSelect 44
#Constant mWindow 45
#Constant mChangeRez 46
#Constant mRez1024x768 47
#Constant mRez1280x1024 48
#Constant mChangeTitleBar 49
#Constant mDefaultTitlebar 50
#Constant mVista1 51
#Constant mVista2 52
#Constant mVista3 53
#Constant mVista4 54
#Constant mHelp 55
#Constant mAbout 56
#Constant mExportList 57
#Constant mBitmap 58
#Constant mBlitzBasic 59
#Constant mDarkBasic 60
MENU_Init()
` Create MenuBar
MENU_CreateMenu(mFile ,"File" ) : AddMenuBarItem("File" ,mFile )
MENU_CreateMenu(mInsert,"Insert") : AddMenuBarItem("Insert",mInsert)
MENU_CreateMenu(mTools ,"Tools" ) : AddMenuBarItem("Tools" ,mTools )
MENU_CreateMenu(mView ,"View" ) : AddMenuBarItem("View" ,mView )
MENU_CreateMenu(mWindow,"Window") : AddMenuBarItem("Window",mWindow)
MENU_CreateMenu(mHelp ,"Help" ) : AddMenuBarItem("Help" ,mHelp )
` Build Menus
MENU_AddMenuItem(mFile,mOpen,"Open")
MENU_CreateMenu(mReopen,"Reopen") : MENU_AddSubMenu(mFile,mReopen)
MENU_AddMenuItem(mReopen,mReopen1 ,"Item 1" )
MENU_AddMenuItem(mReopen,mReopen2 ,"Item 2" )
MENU_AddMenuItem(mReopen,mReopen3 ,"Item 3" )
MENU_AddMenuItem(mReopen,mReopen4 ,"Item 4" )
MENU_AddMenuItem(mReopen,mReopen5 ,"Item 5" )
MENU_AddMenuItem(mReopen,mReopen6 ,"Item 6" )
MENU_AddMenuItem(mReopen,mReopen7 ,"Item 7" )
MENU_AddMenuItem(mReopen,mReopen8 ,"Item 8" )
MENU_AddMenuItem(mReopen,mReopen9 ,"Item 9" )
MENU_AddMenuItem(mReopen,mReopen10,"Item 10")
MENU_AddMenuItemSeparator(mFile)
MENU_AddMenuItem(mFile,mSave,"Save")
MENU_AddMenuItem(mFile,mSaveAs,"Save As")
MENU_AddMenuItemSeparator(mFile)
MENU_CreateMenu(mExport,"Export") : MENU_AddSubMenu(mFile,mExport)
MENU_AddMenuItem(mExport,mBitmap ,"Bitmap" )
MENU_AddMenuItem(mExport,mBlitzBasic,"Blitz Basic")
MENU_AddMenuItem(mExport,mDarkBasic ,"Dark Basic" )
MENU_AddMenuItem(mFile,mPreview,"Preview")
MENU_AddMenuItem(mFile,mPreview,"Print")
MENU_AddMenuItemSeparator(mFile)
MENU_AddMenuItem(mFile,mExit,"Exit")
MENU_AddMenuItem(mInsert,mNewLayer,"New Layer")
MENU_AddMenuItemSeparator(mInsert)
MENU_AddMenuItem(mInsert,mImportImage,"Import Image")
MENU_AddMenuItem(mInsert,mImportText ,"Import Text" )
MENU_AddMenuItem(mTools,mSelect,"Select")
MENU_AddMenuItem(mTools,mClone ,"Clone" )
MENU_AddMenuItem(mTools,mMove ,"Move" )
MENU_AddMenuItem(mTools,mRotate,"Rotate")
MENU_AddMenuItemSeparator(mTools)
MENU_AddMenuItem(mTools,mEditText,"Edit Text")
MENU_AddMenuItemSeparator(mTools)
MENU_AddMenuItem(mTools,mFlip,"Flip")
MENU_AddMenuItem(mTools,mMirror,"Mirror")
MENU_AddMenuItemSeparator(mTools)
MENU_AddMenuItem(mTools,mDelete,"Delete")
MENU_AddMenuItemSeparator(mTools)
MENU_AddMenuItem(mTools,mEditBack,"Edit Background Image")
MENU_AddMenuItemSeparator(mTools)
MENU_AddMenuItem(mTools,mBrintToFront,"Brint To Front")
MENU_AddMenuItem(mTools,mSendToBack,"Send To Back")
MENU_CreateMenu(mZoom,"Zoom") : MENU_AddSubMenu(mView,mZoom)
MENU_AddMenuItem(mZoom,mZoomWidth,"Screen Width")
MENU_AddMenuItem(mZoom,mZoomHeight,"Screen Height")
MENU_AddMenuItem(mZoom,mZoomFit,"Fit To Screen")
MENU_AddMenuItemSeparator(mZoom)
MENU_AddMenuItem(mZoom,mZoom200,"200%")
MENU_AddMenuItem(mZoom,mZoom150,"150%")
MENU_AddMenuItem(mZoom,mZoom100,"100%")
MENU_AddMenuItem(mZoom,mZoom90,"90%")
MENU_AddMenuItem(mZoom,mZoom80,"80%")
MENU_AddMenuItem(mZoom,mZoom70,"70%")
MENU_AddMenuItem(mZoom,mZoom60,"60%")
MENU_AddMenuItem(mZoom,mZoom50,"50%")
MENU_AddMenuItem(mZoom,mZoom40,"40%")
MENU_AddMenuItem(mZoom,mZoom30,"30%")
MENU_AddMenuItem(mZoom,mZoom20,"20%")
MENU_AddMenuItem(mZoom,mZoom10,"10%")
MENU_AddMenuItemSeparator(mView)
MENU_AddMenuItem(mView,mMouseGuide,"Show Mouse Guide" ) : MENU_CheckMenuItem(mView,mMouseGuide)
MENU_AddMenuItem(mView,mGuides ,"Show Guides" ) : MENU_CheckMenuItem(mView,mGuides )
MENU_AddMenuItem(mView,mMargins ,"Show Margins" ) : MENU_CheckMenuItem(mView,mMargins )
MENU_AddMenuItem(mView,mBorders ,"Show Layer Borders") : MENU_CheckMenuItem(mView,mBorders )
MENU_AddMenuItem(mView,mRuler ,"Show Ruler" ) : MENU_CheckMenuItem(mView,mRuler )
MENU_AddMenuItem(mView,mDataTabs ,"Show Data Tabs" ) : MENU_CheckMenuItem(mView,mDataTabs )
MENU_AddMenuItem(mView,mStatusbar ,"Show Statusbar" ) : MENU_CheckMenuItem(mView,mStatusbar )
MENU_AddMenuItemSeparator(mView)
MENU_AddMenuItem(mView,mWindowsColorSelector,"Windows Color Selector")
MENU_CreateMenu(mChangeRez,"Change Resolution") : MENU_AddSubMenu(mWindow,mChangeRez)
MENU_AddMenuItem(mChangeRez,mRez1024x768,"1024 x 768")
MENU_AddMenuItem(mChangeRez,mRez1280x1024,"1280 x 1024")
MENU_AddMenuItemSeparator(mWindow)
MENU_CreateMenu(mChangeTitleBar,"Change TitleBar") : MENU_AddSubMenu(mWindow,mChangeTitleBar)
MENU_AddMenuItem(mChangeTitleBar,mDefaultTitlebar,"Windows Default")
MENU_AddMenuItemSeparator(mChangeTitleBar)
MENU_AddMenuItem(mChangeTitleBar,mVista1,"Vista")
MENU_AddMenuItem(mChangeTitleBar,mVista2,"Vista White")
MENU_AddMenuItemSeparator(mChangeTitleBar)
MENU_AddMenuItem(mChangeTitleBar,mVista3,"Vista Twist")
MENU_AddMenuItem(mChangeTitleBar,mVista4,"Vista Twist White")
MENU_CheckMenuRadioItem(mChangeTitleBar,mDefaultTitlebar,mVista4,mVista1)
MENU_AddMenuItem(mHelp,mAbout,"About")
` Update All Menus
MENU_Refresh()
Return
` --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Function AddMenuBarItem(Name$,MenuID)
Add To Stack MenuBar()
n = Array Count(MenuBar())-1
MenuBar(n).Name = Name$
MenuBar(n).Menu = MenuID
EndFunction
Function UpdateMenuBar()
Ink RGB(255,255,255),0 : Box 0,TitlebarHeight,Screen Width(),Text Height("|")+TitlebarHeight
For n = 0 to Array Count(MenuBar())-1
Inc x,10
If ClickText(x,TitlebarHeight,MenuBar(n).Name) = 1 And MouseClick() = 1 then MenuID = OpenMenu(MenuBar(n).Menu,x,Text Height("|")+TitlebarHeight)
Inc x,Text Width(MenuBar(n).Name)
Next n
Ink 0,0
line 0,0,0,Screen Height()
line Screen Width()-1,0,Screen Width()-1,Screen Height()
line 0,Screen Height()-1,Screen Width()-1,Screen Height()-1
EndFunction MenuID
Function OpenMenu(MenuID,x,y)
` This Sprite stops the screen flickering when the menu is Exited
in = FreeImgNum() : Get Image in,0,0,Screen Width(),Screen Height(),1
sn = FreeSprNum() : Sprite sn,0,0,in : Sync
` Set the Menu you want
MENU_AttachMouseMenu(MenuID)
` Required Values
menuIdSelected = 0
If x <> 0 and y <> 0
x = DesktopMouseX()-MouseX()+x
y = DesktopMouseY()-MouseY()+y
MenuPopupX = x+MENU_BAR_WIDTH : CursorX = x
MenuPopupY = y+MENU_BAR_HEIGHT : CursorY = y
EndIf
If x = 0 or y = 0
CALL DLL MENU_USER32_DLL_ID,"GetWindowRect",MENU_hWnd,GET MEMBLOCK PTR( MENU_MEMBLOCK_1_ID )
menuPopupX = MEMBLOCK WORD( MENU_MEMBLOCK_1_ID, 0 ) + MENU_BAR_WIDTH
menuPopupY = MEMBLOCK WORD( MENU_MEMBLOCK_1_ID, 4 ) + MENU_BAR_HEIGHT
CALL DLL MENU_USER32_DLL_ID,"GetCursorPos",GET MEMBLOCK PTR( MENU_MEMBLOCK_1_ID )
cursorX = MEMBLOCK WORD( MENU_MEMBLOCK_1_ID, 0 )
cursorY = MEMBLOCK WORD( MENU_MEMBLOCK_1_ID, 4 )
EndIf
` Open the Selected Menu
menuIdSelected = CALL DLL(MENU_USER32_DLL_ID,"TrackPopupMenu",MENU_Mouse_hMenu,MENU_TPM_VERPOSANIMATION OR MENU_TPM_RETURNCMD,cursorX,cursorY,0,MENU_hWnd,0)
` Cleanup
wait 250
Delete Sprite sn
Delete Image in
EndFunction menuIdSelected
` --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function MENU_Init()
LOAD DLL "user32.dll", MENU_USER32_DLL_ID
MENU_hWnd = CALL DLL( MENU_USER32_DLL_ID,"GetActiveWindow" )
MENU_hMenu = CALL DLL(MENU_USER32_DLL_ID,"CreateMenu" )
CALL DLL MENU_USER32_DLL_ID,"SetMenu", MENU_hWnd, MENU_hMenu
MENU_menu_count = 0;
mainMenu_count = 0;
MENU_msgPtr = MAKE MEMORY( 28 )
MAKE MEMBLOCK MENU_MEMBLOCK_1_ID,16
endfunction
function MENU_CreateMenu( menuId AS INTEGER, menuCaption AS STRING )
MENU_menu_count = MENU_menu_count + 1
MENU_menu( MENU_menu_count ).menuId = menuId
MENU_menu( MENU_menu_count ).menuCaption = menuCaption
MENU_menu( MENU_menu_count ).hMenu = CALL DLL(MENU_USER32_DLL_ID,"CreatePopupMenu" )
MENU_menu( MENU_menu_count ).disabled = MENU_BOOLEAN_FALSE
endfunction
function MENU_FindMenuArrayIndex( menuId )
index = 1
while MENU_menu_count + 1 > index AND MENU_menu( index ).menuId <> menuId
index = index + 1
endwhile
endfunction index
function MENU_AttachToMainMenu( menuId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
CALL DLL MENU_USER32_DLL_ID, "AppendMenuA", MENU_hMenu, MENU_MF_STRING, menuId, MENU_menu( count ).menuCaption
MENU_mainMenu_count = MENU_mainMenu_count + 1
MENU_mainMenu( MENU_mainMenu_count ).menuArrayIndex = count
endif
endfunction
function MENU_AddSubMenu( menuId1 AS INTEGER, menuId2 AS INTEGER )
index1 = MENU_FindMenuArrayIndex( menuId1 )
index2 = MENU_FindMenuArrayIndex( menuId2 )
CALL DLL MENU_USER32_DLL_ID,"AppendMenuA",MENU_menu( index1 ).hMenu,MENU_MF_POPUP,MENU_menu( index2 ).hMenu,MENU_menu( index2 ).menuCaption
endfunction
function MENU_AddMenuItem( menuId AS INTEGER, menuItemId AS INTEGER, menuItemCaption AS STRING )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
CALL DLL MENU_USER32_DLL_ID,"AppendMenuA",MENU_menu( count ).hMenu,MENU_MENU_MF_STRING,menuItemId,menuItemCaption
endif
endfunction
function MENU_AddMenuItemSeparator( menuId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
CALL DLL MENU_USER32_DLL_ID,"AppendMenuA",MENU_menu( count ).hMenu,MENU_MF_SEPARATOR,0,""
endif
endfunction
function MENU_AttachMouseMenu( menuId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
MENU_Mouse_hMenu = MENU_menu( count ).hMenu
endif
endfunction
function MENU_GetMenuId()
` Get Required Data
menuIdSelected = 0
CALL DLL MENU_USER32_DLL_ID,"GetWindowRect",MENU_hWnd,GET MEMBLOCK PTR( MENU_MEMBLOCK_1_ID )
` If MouseClick() <> 1 then exitfunction 0
menuPopupX = MEMBLOCK WORD( MENU_MEMBLOCK_1_ID, 0 ) + MENU_BAR_WIDTH
menuPopupY = MEMBLOCK WORD( MENU_MEMBLOCK_1_ID, 4 ) + MENU_BAR_HEIGHT
` EndIf
CALL DLL MENU_USER32_DLL_ID,"GetCursorPos",GET MEMBLOCK PTR( MENU_MEMBLOCK_1_ID )
cursorX = MEMBLOCK WORD( MENU_MEMBLOCK_1_ID, 0 )
cursorY = MEMBLOCK WORD( MENU_MEMBLOCK_1_ID, 4 )
` Search MenuBar
menuHeight = 22
if ( cursorY > menuPopupY ) AND ( cursorY < menuPopupY + menuHeight )
count = 1
while MENU_mainMenu_count + 1 > count
menuArrayIndex = MENU_mainMenu( count ).menuArrayIndex
menuWidth = TEXT WIDTH( MENU_menu( menuArrayIndex ).menuCaption )
if cursorX > menuPopupX AND cursorX < menuPopupX + menuWidth AND MENU_menu( menuArrayIndex ).disabled = MENU_BOOLEAN_FALSE
MENU_HiliteMainMenu( MENU_menu( menuArrayIndex ).menuId )
menuIdSelected = CALL DLL( MENU_USER32_DLL_ID,"TrackPopupMenu", MENU_menu( menuArrayIndex ).hMenu, MENU_TPM_VERPOSANIMATION OR MENU_TPM_RETURNCMD OR MENU_TPM_LEFTBUTTON,menuPopupX, menuPopupY+menuHeight,0,MENU_hWnd,0)
MENU_UnHiliteMainMenu( MENU_menu( menuArrayIndex ).menuId )
EXIT : endif
menuPopupX = menuPopupX + menuWidth
count = count + 1
endwhile : endif
` Auto Right Click Menu
if MOUSECLICK()=2 AND MENU_Mouse_hMenu <> 0 AND cursorY > menuPopupY + menuHeight
menuIdSelected = CALL DLL(MENU_USER32_DLL_ID,"TrackPopupMenu",MENU_Mouse_hMenu,MENU_TPM_VERPOSANIMATION OR MENU_TPM_RETURNCMD,cursorX,cursorY,0,MENU_hWnd,0)
endif
endfunction menuIdSelected
function MENU_CheckMenuRadioItem( menuId AS INTEGER, menuItemStartId AS INTEGER, menuItemEndId AS INTEGER, menuItemSelectedId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
CALL DLL MENU_USER32_DLL_ID,"CheckMenuRadioItem",MENU_menu( count ).hMenu,menuItemStartId,menuItemEndId,menuItemSelectedId,MF_BYCOMMAND
endif
endfunction
function MENU_DisableMenuItem( menuId AS INTEGER, menuItemId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
CALL DLL MENU_USER32_DLL_ID,"EnableMenuItem",MENU_menu( count ).hMenu,menuItemId, MENU_MF_BYCOMMAND OR MENU_MF_GRAYED
endif
endfunction
function MENU_EnableMenuItem( menuId AS INTEGER, menuItemId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
CALL DLL MENU_USER32_DLL_ID,"EnableMenuItem",MENU_menu( count ).hMenu, menuItemId, MENU_MF_BYCOMMAND OR MENU_MF_ENABLED
endif
endfunction
function MENU_CheckMenuItem( menuId AS INTEGER, menuItemId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
CALL DLL MENU_USER32_DLL_ID,"CheckMenuItem",MENU_menu( count ).hMenu,menuItemId, MENU_MF_BYCOMMAND OR MENU_MF_CHECKED
endif
endfunction
function MENU_UnCheckMenuItem( menuId AS INTEGER, menuItemId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
if MENU_menu_count + 1 > count
CALL DLL MENU_USER32_DLL_ID,"CheckMenuItem",MENU_menu( count ).hMenu, menuItemId, MENU_MF_BYCOMMAND OR MENU_MF_UNCHECKED
endif
endfunction
function MENU_DisableMainMenu( menuId AS INTEGER )
count = 1
while MENU_mainMenu_count + 1 > count
menuArrayIndex = MENU_mainMenu( count ).menuArrayIndex
if MENU_menu( menuArrayIndex ).menuId = menuId
MENU_menu( menuArrayIndex ).disabled = MENU_BOOLEAN_TRUE
CALL DLL MENU_USER32_DLL_ID,"EnableMenuItem", MENU_hMenu, menuId, MENU_MF_BYCOMMAND OR MENU_MF_GRAYED
EXIT : endif
count = count + 1
endwhile
endfunction
function MENU_EnableMainMenu( menuId AS INTEGER )
count = 1
while MENU_mainMenu_count + 1 > count
menuArrayIndex = MENU_mainMenu( count ).menuArrayIndex
if MENU_menu( menuArrayIndex ).menuId = menuId
MENU_menu( menuArrayIndex ).disabled = MENU_BOOLEAN_FALSE
CALL DLL MENU_USER32_DLL_ID,"EnableMenuItem", MENU_hMenu, menuId, MENU_MF_BYCOMMAND OR MENU_MF_ENABLED
EXIT : endif
count = count + 1
endwhile
endfunction
function MENU_HiliteMainMenu( menuId AS INTEGER )
CALL DLL MENU_USER32_DLL_ID,"HiliteMenuItem", MENU_hWnd, MENU_hMenu, menuId, MENU_MF_BYCOMMAND OR MENU_MF_HILITE
endfunction
function MENU_UnHiliteMainMenu( menuId AS INTEGER )
CALL DLL MENU_USER32_DLL_ID,"HiliteMenuItem", MENU_hWnd, MENU_hMenu, menuId, MENU_MF_BYCOMMAND OR MENU_MF_UNHILITE
endfunction
function MENU_Refresh()
CALL DLL MENU_USER32_DLL_ID,"DrawMenuBar", MENU_hWnd
endfunction
function MENU_DestroyMenu( menuId AS INTEGER )
count = MENU_FindMenuArrayIndex( menuId )
CALL DLL MENU_USER32_DLL_ID,"DestroyMenu",MENU_menu( count ).hMenu
endfunction
function MENU_Destroy()
CALL DLL MENU_USER32_DLL_ID,"DestroyMenu",MENU_Mouse_hMenu
CALL DLL MENU_USER32_DLL_ID,"DestroyMenu",MENU_hWnd
DELETE DLL MENU_USER32_DLL_ID
DELETE MEMBLOCK MENU_MEMBLOCK_1_ID
endfunction
` --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Function ClickText(x,y,s$)
If MouseX()>x And MouseX()<x+Text Width(s$) and MouseY()>y And MouseY()<y+Text Height(s$) Then v = 1
If v = 1 Then Ink RGB(200,0,0),0
If v = 0 Then Ink RGB( 1,1,1),0
Text x,y,s$
EndFunction v
Function FreeImgNum()
n = 1 : Repeat : Inc n,1 : Until Image Exist(n) = 0
EndFunction n
Function FreeSprNum()
n = 1 : Repeat : Inc n,1 : Until Sprite Exist(n) = 0
EndFunction n
` These 2 are DarkSide Commands --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Function DesktopMouseX() : ` Returns the real x mouse position on your desktop.
n = DarkSide_Get_Desktop_MouseX()
EndFunction n
Function DesktopMouseY() : ` Returns the real y mouse position on your desktop.
n = DarkSide_Get_Desktop_MouseY()
EndFunction n
` --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I changed the MenuBar and added the following Function
OpenMenu(MenuID,x,y)
If x+y = 0 Then it will open like a right cilck menu, Else x+y = Menu Position