Results 1 to 8 of 8

Thread: [RESOLVED] Error 50003 Vista Only on Minimize

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    37

    Resolved [RESOLVED] Error 50003 Vista Only on Minimize

    Hi, I have a strange unexpected error coming up with my app only on Vista! I have tracked down the bug, when my main form is minimized a MSN Messenger style popup appears (frmReminder) to give the user a reminder message, the process giving off the error is below, the specific line is (Me.Left = Screen.Width - Me.Width).

    VB Code:
    1. Public Function Iniciar(Texto As String, Index As Integer)
    2.     If frmMain.ManualClick = False Then
    3.         Unload Me
    4.     Else
    5.        
    6.      
    7.         Dim WindowRect As RECT
    8.         SystemParametersInfo SPI_GETWORKAREA, 0, WindowRect, 0
    9.        
    10.         taskbar = ((Screen.Height / Screen.TwipsPerPixelX) - WindowRect.PAbj) * Screen.TwipsPerPixelX
    11.        
    12.        
    13.         Me.Left = Screen.Width - Me.Width '<---- Line giving off the error!  <----
    14.         Me.Top = Screen.Height '- Me.Height - taskbar
    15.         resto = Screen.Height - Me.Height - taskbar
    16.      
    17.         a = Me.Height
    18.         lblCaption.Caption = Texto
    19.        
    20.    
    21.        
    22.         Me.Show
    23.         Timer1.Enabled = True
    24.        
    25.        
    26.         SetTopMost
    27.         SetTranci
    28.         Me.Top = Screen.Height - taskbar
    29.         tmrSlideIn.Enabled = True
    30.         Me.Left = Screen.Width - Me.Width
    31.         Me.Height = 0
    32.     End If
    33. End Function

    Any ideas? This one has me stumped...
    Last edited by Cbyte; Jun 3rd, 2007 at 06:44 PM.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Error 50003 Vista Only on Minimize

    maybe try
    vb Code:
    1. if not me.windowstate = vbminimized then Me.Left = Screen.Width - Me.Width
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    37

    Re: Error 50003 Vista Only on Minimize

    hey thanks for the suggestion I am on my laptop and will try it when I get home. By the way how do I make my code vb6 formatted, i tried the code option and it just put it in a box, tried the vbcode option didnt do anything. Will give an update on the error.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Error 50003 Vista Only on Minimize

    as far as i could tell, you can only use vbcode tags in quick reply, not advanced
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Error 50003 Vista Only on Minimize

    In the "advanced" editor the VBCode button asks you which language to use - which is: VB
    (you can enter various others, such as C, PHP, SQL, ....)

    If you use the VBCode button in the Quick Reply, it will not ask you.. if you "Post Quick Reply" the VB is automatically added, but if you "Go Advanced" it isn't - so you need to add it manually.

    The way the tags should look is like this:
    [HIGHLIGHT=vb] code here [/HIGHLIGHT]

  6. #6

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    37

    Re: Error 50003 Vista Only on Minimize

    I tried the suggestion it didnt work, it seems vista gives the error the moment i try do anything to the form. I even tried at the start of the routine msgbox me.windowstate..crash... msgbox me.left... crash.... msgbox me.top crash....

    Just in case here is the code from frmMain (resize event) which then calls this code to show the alert on frmReminder...

    vb Code:
    1. NoPopup = NoPopup + 1
    2.             If NoPopup < 1 Then NoPopup = 1
    3.             Set PopUp(NoPopup) = New frmReminder 'Form2
    4.             PopUp(NoPopup).Iniciar "msg here", NoPopup
    5.             If NoPopup = 3 Then NoPopup = 0

  7. #7

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    37

    Re: Error 50003 Vista Only on Minimize

    Well, I fixed it... But I am not able to tell anyone what was wrong with the code because I dont know!

    All I did was scrap all existing alert code and replaced with some new fresh msn style alert code from pscode.com... That did the trick.

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [RESOLVED] Error 50003 Vista Only on Minimize

    even in XP i have had problems when using new forms, after calling a new from i was unable to open a msgbox until all the code finished and control passed back to the user
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width