Hi Daniel,
Daniel Garcia-Gil wrote:this gdi object is created only one time to build 2007 menu effect... dont worry about that...
But I am worried about, because I made more tests with FWH 11.01. And everytime a POPUP MENU is called there is 1 unreleased gdi object more. So if my customers start my app, work some hours with it and call a POPUP MENU e.g. about 100 times, there are about 100 unreleased gdi objects. This is not acceptable.
Code: Select all
//----------------------------------------------------------------------------//
FUNCTION MAIN()
LOCAL oWnd
SetResDebug()
DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 ;
TITLE "Test";
MENU BuildMenu()
ACTIVATE WINDOW oWnd;
ON RIGHT CLICK ShortMainMenu(oWnd)
FERASE("CHECKRES.TXT")
CHECKRES()
winExec("notepad .\checkres.txt")
return(0)
//----------------------------------------------------------------------------//
function ShortMainMenu(oWnd)
local oMenu, aPos
aPos := ScreenToClient( oWnd:hWnd, GetCursorPos() )
MENU oMenu POPUP 2007
MENUITEM "Item 1"
ENDMENU
activate popup oMenu of oWnd at aPos[1], aPos[2]
return oMenu
function BuildMenu()
local oMenu
MENU oMenu 2007
MENUITEM "Item 1"
ENDMENU
return oMenu
//----------------------------------------------------------------------------//
If I call the popup menu with right click e.g. 5 times, I get this:
Code: Select all
03/17/11 23:14:30: BMP,1568,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->SHOWWINDOW(0)->TWINDOW:ACTIVATE(975)->MAIN(17)
03/17/11 23:14:30: BMP,2160,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->TRACKPOPUP(0)->TMENU:ACTIVATE(470)->SHORTMAINMENU(39)->(b)MAIN(17)->TWINDOW:RBUTTONDOWN(1907)->TWINDOW:HANDLEEVENT(0)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(17)
03/17/11 23:14:30: BMP,2532,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->TRACKPOPUP(0)->TMENU:ACTIVATE(470)->SHORTMAINMENU(39)->(b)MAIN(17)->TWINDOW:RBUTTONDOWN(1907)->TWINDOW:HANDLEEVENT(0)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(17)
03/17/11 23:14:30: BMP,2880,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->TRACKPOPUP(0)->TMENU:ACTIVATE(470)->SHORTMAINMENU(39)->(b)MAIN(17)->TWINDOW:RBUTTONDOWN(1907)->TWINDOW:HANDLEEVENT(0)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(17)
03/17/11 23:14:30: BMP,3140,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->TRACKPOPUP(0)->TMENU:ACTIVATE(470)->SHORTMAINMENU(39)->(b)MAIN(17)->TWINDOW:RBUTTONDOWN(1907)->TWINDOW:HANDLEEVENT(0)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(17)
03/17/11 23:14:30: ====================================================================================================