You can still use SetWindowPos.
You just need to get the handle to the message box. FindWindow will get you this handle.
The best way would be to install a shell hook using SetWindowsHookEx which will then give you a notification when the message box pops up and also its handle.
You could then use SetWindowPos on the handle to make it top most.
It is for you to decide if it is worth installing the shell hook because it will effect the entire system.
«_Superman_» I love work. It gives me something to do between weekends.
You could do your own calibration or have vendor remove dialog box. Failing that, when the calibration utility is started, you could have a thread monitor windows ans when that window pops up, either force it to the foreground or just close it yourself.
Where it gets tricky is that only the current active, foreground application can make another application the foreground and despite appearances, who is this application isn't always straightforward. To get around this for one project, I ended up writing the following (The W is the prefix for my personal, but in-the-public-domain, library:
// Load bitmaps from resource. Both m_CheckBitmap and m_UnCheckBitmap
// are member variables of CMainFrame class of type CBitmap.
// Associate bitmaps with the "Bitmap" menu item.
CMenu* mmenu = GetMenu();
CMenu* submenu = mmenu->GetSubMenu(4);
But i think my situation is more easy than example, but maybe i have problems to merge the two code parts,
please can you help me i don't think take you more time.
Thanks very much.
According to the documentation[^], the bitmaps are just used to indicate the item is selected or not. The MSDN sample shows you how to add the two bitmaps to your menu items. When you say you just want icons, do you mean without any text? If so you need to look at http://msdn.microsoft.com/en-us/library/kb145b0a.aspx[^], for the options to set up individual menu items.
CMFCPopupMenu* PopupMenuFolders = new CMFCPopupMenu();
//Mi serve controllare prima che esce il menu per eventualmente eliminare voci del menu non permesse.
PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_1, NULL, 0, _T("Item 1")));
PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_2, NULL, 1, _T("Item 2")));
PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_3, NULL, 2, _T("Item 3")));
PopupMenuFolders->Create(this, point.x, point.y, NULL);
What is a current C ( ANSI C) standard on putting <b>optional</b> parameters / attributes into function? Or is there such a thing - ANSI standard _ anymore? "Popular" microprocessor compiler does not allow such thing and "workaround" is function overloading. Which IMHO in memory limited device adding more similar functions into code does not make much sense, unless you are memory chips salesman. Cheers Vaclav