Custom Message Box Not Working On Windows 7-VBForums
Results 1 to 4 of 4

Thread: Custom Message Box Not Working On Windows 7

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2009
    Posts
    316

    Question Custom Message Box Not Working On Windows 7

    Greetings every one.
    i am using custom message box (by using some api calls to modify the standard windows message box) to change message box icon and button text. It is working fine on windows xp. But on windows 7 custom image position is not correct/right. It's get overlapped (get under text) with text.

    please check the attached file (source + error shot)

    if any one can help, that would be great

    thanks in advance

    best regards
    Attached Files Attached Files

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: Custom Message Box Not Working On Windows 7

    According to the Standard Icons MSDN topic, dialog boxes should use 32x32 pixel icons for content area icons. Your 48x48 icon is a bit oversized, hence the "overlapping" issue.
    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)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2009
    Posts
    316

    Re: Custom Message Box Not Working On Windows 7

    Quote Originally Posted by Bonnie West View Post
    According to the Standard Icons MSDN topic, dialog boxes should use 32x32 pixel icons for content area icons. Your 48x48 icon is a bit oversized, hence the "overlapping" issue.
    thanks for your reply

    but my question is why then it's works fine on windows xp?

    thanks again..

    best regards

  4. #4
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: Custom Message Box Not Working On Windows 7

    Quote Originally Posted by Shohag_ifas View Post
    but my question is why then it's works fine on windows xp?
    Probably because XP was less strict than Win 7 when it comes to message box icon sizes. That's usually the way it is with Windows in general. What used to work in older OSs doesn't work anymore in newer ones. So, the typical solution is to detect the OS version and/or feature and adjust your code accordingly.
    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)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.