Im having problem displaying pop-up menu i only get the beginning of a menu and submenus i did screenshoots of that but i cant post them so i'll use ASCII like this: ╔╗ || || || || ╔--------╗ || |submenu| || ╚--------╝ || || ╚╝ (that vertical rectangle loks like border between splitter windows and between it and the submenu is the exact amount of space as it should be for text "menu 3" to fit) where it should be like this: ╔-------╗ |menu 1| |-------| |menu 2| |-------|╔--------╗ |menu 3>|submenu| |-------|╚--------╝ |menu 4| ╚-------╝ first i load menu in CMenu in OnInitialUpdate(): m_popUpMenu.LoadMenu(IDR_POP_UP_MENU); then i use pop up OnRightclick() m_popUpMenu.TrackPopupMenu(TPM_LEFTALIGN, point.x, point.y, this); any help will do thank you
l00p1n6
Posts
-
pop-up menu problem, inside splitter, using doc/view -
How to get all file name in a folderCString theFileNamePath; CString extension("*.txt"); CString filePath("C://"); CString completeFilePath; HANDLE handleToFind; WIN32_FIND_DATA FindInfo; WIN32_FIND_DATA *FindInfoPoint = &FindInfo; completeFilePath.SetString(filePath+ extension); handleToFind = FindFirstFile(completeFilePath,FindInfoPoint); while(handleToFind != NULL) { theFileNamePath = completeFilePath+ FindInfo.cFileName; //....SOMETHING.... if (FindNextFile(handleToFind,FindInfoPoint) == 0) break; }//while FindClose(handleToFind); hope that'll do:)
-
Make articles and threads available for download!there are lots of them and reading them is useful but online time (money) consuming sometning like monthly or yearly compilation
-
MFC->How to create different-shaped buttons in runtime?problem: i need different-shaped buttons to be placed in client area in runtime. for example: rightclick in client area opens context menu with options: round button triangle button by clicking on one of the above appropriate button shoud be drawn in client area. this button (like all others created this way) should have all standard properties of a button (CButton) my experiment: i've tried with SetWindowRgn but id doesn't work then i used "common" CreateWindow with BUTTON as parametar and got a nice round button but my program wouldn't accept any further rightclicks (no context menu) this is my method wich creates squared flat button (i could create many buttons) void CpaintView::OnFalseCircle() { CPoint point; GetCursorPos(&point); ScreenToClient(&point); CButton *cir = new CButton(); cir->Create("tri",BS_FLAT, CRect(point,CPoint (point.x+20,point.y+20)),AfxGetMainWnd(),1); cir->ShowWindow(SW_SHOWNORMAL); } and non-working method wich creates one circle and stucks void CpaintView::OnCircle() { CPoint point; GetCursorPos(&point); ScreenToClient(&point); CRect rect(point, CPoint(point.x+50, point.y+50)); CRgn rgn; Circle *cr = new Circle(); rgn.CreateEllipticRgnIndirect(rect); SetWindowRgn(rgn,true); CreateWindow("BUTTON","",WS_CHILD | WS_VISIBLE, point.x-10,point.y- 10,70, 70, *this,(HMENU)101,0,0); } thanks