What are dialog units? And why on earth would they change from one computer to another? Why not just specify dialog stuff in pixels? I don't understand the theory behind this. If there any API call to retrieve information about the current settings for dialogs? Any information about the positioning of Dialog Stuff would be great, thanks! The reason I ask this is because I was placing a dialog with the WS_CHILD flag set as a control on a form. Everything went great except that on some computers everything is different sized! And it'd be a paint to go through every control in the dialog and set all their sizes manually with an API call, being that I want to have a whole ton of buttons on there... Thanks, Ben
Posted on 2000-12-10 00:59:00 by cyberben
Fonts may be different or someone not available from one computer to another one. To solve this problem, win dialog ajust their sizes according to font size (hopfully). To ensure that your form will alway have the same control size putted on it, load your choosen font in Resources and set the control(s) font with sendMessage WM_SETFONT. Another way would be to make your entire form a Dialog (if possible). If it may help defining a Dialog position after fixing a new Font, here is a routine i used for this (i don't remember if it was Font specific or not...i suppose *not*): SaveDialogUserPosition: ; MapDialog do this to BaseUnits values: ; ; left = (left * baseunitX) / 4 ; right = (right * baseunitX) / 4 ; top = (top * baseunitY) / 8 ; bottom = (bottom * baseunitY) / 8 ; ; i only want to know baseUnits. So: mov DžBaseUnitX1 4, DžBaseUnitY1 8, DžBaseUnitX2 0, DžBaseUnitY2, 0 ; <<< the api 'User32.MapDialogRect' DžAdressee BaseUnits ; <<< trick api 'User32.GetWindowRect' DžAdressee DialogBoundingRectangle ; api 'User32.GetDialogBaseUnits' ; of no need ; dialogUnitX = (pixelX * 4) / baseunitX ; dialogUnitY = (pixelY * 8) / baseunitY mov eax DžDBRX1, edx 0 shl eax 2 | div DžBaseUnitX1 mov WžDialogX ax mov eax DžDBRY1, edx 0 shl eax 3 | div DžBaseUnitY1 mov WžDialogY ax ret Bye, betov.
Posted on 2000-12-10 04:53:00 by Betov