I want my SDI application to have always the same size and position on screen. Resizing and Moving is disabled by the code below; which is inserted in OnCreate of main frame CMenu* pTopMenu = GetSystemMenu(FALSE); if(pTopMenu != NULL) { pTopMenu -> RemoveMenu(SC_SIZE, MF_BYCOMMAND); //No ReSize pTopMenu -> RemoveMenu(SC_MOVE, MF_BYCOMMAND); //No Move } for Resize and move above code works fine! BUT for size let us look at PreCreatewindow of Mainframe BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style &= ~FWS_ADDTOTITLE; cs.x = 0; cs.y = 77; cs.cx = 1000; cs.cy = 500; return TRUE; } the above code didn't work; if i change one value in the structure the other is automatically changed/ignored, gives unexpected positioning. May be some sort of aspect ratio problem which windows might be maintaining internally. Another soloution is to use Move in the initinstance but i want to avoid it since it first shows main frame at the 0,0 position and then moves it to required postion, with a slight but observable delay. Please help to solve the above problem.
kriaz
Posts
-
SDI Main Frame positioning? -
Window Styleuse following code: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (BaseClass::OnCreate(lpCreateStruct) == -1) return -1; // Do something // Remove positions of menu CMenu* pTopMenu = GetSystemMenu(FALSE); if(pTopMenu != NULL) { pTopMenu -> RemoveMenu(SC_SIZE, MF_BYCOMMAND); //remove resizeing pTopMenu -> RemoveMenu(SC_MOVE, MF_BYCOMMAND); //remove Moveing pTopMenu -> RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND); //remove Maximizing } return 0; }
-
vc++Right click on dialog select properties; from the general tab select the font size you want.:)
-
Z Order of controls on Dialog?How can we control the Z Order of controls on a Dialog? kriaz.
-
Difference between class and Runtime ClassThank You for reply.
-
where to start ?I believe that for beginner VC++ 6 by sams publisher is best. later on shift to MSDN. (I know nothing about .NETness)
-
Difference between class and Runtime ClassA class is a template of an object, but what is a Runtime class?
-
sorry David CrowI was away from net for a week; checked today and found remarks from ur fans well, I did't mean any thing by that title of thread, simply typed without any anything; perhaps an on forum sorry is needed. sorry:rose: kriaz
-
DavidCrow does't know this any one knows this?I want to remove Close button "X" from the right corner of Dialog, but still want to keep the system menu at the left corner. Unchecking the system menu option from dialog properties also removes the menu at left. Plz Help.:confused: kriaz.
-
difference between Hotkeys and ShortKeysShort cut keys are the "key" or "key combinations" that can be used instead of actual action e.g."Alt+F+P" prints a document in word; the acual action is clicking file menu and then selecting print option. (they are short cut to an action) Hotkeys are related to what we see at screen (not in menus) a character within a text with an underline, pressing that character activates thet particular action. They are single character. kriaz.:)
-
How to remove CLOSE Button from right top corner?I want to remove Close button "X" from the right corner of Dialog, but still want to keep the system menu at the left corner. Unchecking the system menu option from dialog properties also removes the menu at left. Plz Help.:confused: kriaz.
-
Armature ProgrammingArmature Programming or Amateur Programming?