From: David Andrs on 3 Dec 2007 12:56 Hi! I generated a simple MFC application (single document w/o document/ view architecture) with status bar using MFC AppWizard (eVC 4.0). I made it HiDPI aware including CEUX resource, #including shguim.h, #including uihelper.h, calling HiDPI_InitScaling in InitInstance. If I start this application on VGA device, the status bar is positioned off the window (its lower half is covered by the menu bar). If I enter About dialog (also generated by the wizard) and close it, the status bar is repositioned and shown correctly. This does not happen on QVGA devices (I tried it in WM5 emulator). It is also ok (on VGA and QVGA), if there is no CEUX resource. At very first begining, I thought, that the height of the status bar is calculated incorrectly, but after some hours I found out that its height is ok and the source of this problem is the incorrect size of main window (CMainFrame). Note: I was playing with RecalcLayout() which did not work for me - of course, because the problem is somewhere else. So, I ended up with SetWindowPos called for the main window in CMainFrame::OnCreate. For calculating the height of the main window, I'm using the <screen height> - GetSystemMetrics(SM_CYMENU) - some value. The value depends on the OS type (I was testing on PPC2003SE and WM5 - emulator and I had to distinguish between them). Is this problem known (I was searching the groups but with no success)? Is there a better solution how to fix this? I really do not like the hack with distinguishing the device OS and using magic numbers for correct window hight. Regards, -- David
|
Pages: 1 Prev: error 0x80070002 mobile development - camera Next: SIP Input Method |