|
-
Oct 10th, 2014, 02:42 AM
#1
Re: [VB6] TaskDialogIndirect: Complete class implementation of Vista+ Task Dialogs
 Originally Posted by fafalone
Is there a simple way I'm not seeing?
Sorry, but I'm not aware of any. I believe, however, that it's better to use dialog units because it is a device-independent measurement. The task dialog will be able to retain its proportions regardless of the current screen DPI.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Oct 10th, 2014, 08:13 AM
#2
Re: [VB6] TaskDialogIndirect: Complete class implementation of Vista+ Task Dialogs
 Originally Posted by Bonnie West
I believe, however, that it's better to use dialog units because it is a device-independent measurement...
I can see fafaone's issue. If offering dialog units as a measurement, you don't know what those units are beforehand as they are dependent on the dialog's font. If TaskDialog uses the system font, then it's easy enough with GetDialogBaseUnits API. However, per msdn, most dialogs define their own font & there is no guarantee that the same font will be used from O/S to O/S.
A simple idea if wanting to provide users a property for pixels & simple enough to test:
During the dialog's creation, a couple of notifications are received: tdn_created & tdn_dialog_constructed.
When seeing one of those, maybe a simple call to SetWindowPos API would do the trick.
Of course the dialog structure's width member would need to be cached & not passed to TaskDialog API. The cached value used for SetWindowPos
Note. That the structure's width member is not only intended to be dialog units, but also client area only
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|