|
-
Jun 2nd, 2007, 08:20 PM
#1
Thread Starter
Member
[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:
Public Function Iniciar(Texto As String, Index As Integer)
If frmMain.ManualClick = False Then
Unload Me
Else
Dim WindowRect As RECT
SystemParametersInfo SPI_GETWORKAREA, 0, WindowRect, 0
taskbar = ((Screen.Height / Screen.TwipsPerPixelX) - WindowRect.PAbj) * Screen.TwipsPerPixelX
Me.Left = Screen.Width - Me.Width '<---- Line giving off the error! <----
Me.Top = Screen.Height '- Me.Height - taskbar
resto = Screen.Height - Me.Height - taskbar
a = Me.Height
lblCaption.Caption = Texto
Me.Show
Timer1.Enabled = True
SetTopMost
SetTranci
Me.Top = Screen.Height - taskbar
tmrSlideIn.Enabled = True
Me.Left = Screen.Width - Me.Width
Me.Height = 0
End If
End Function
Any ideas? This one has me stumped...
Last edited by Cbyte; Jun 3rd, 2007 at 06:44 PM.
-
Jun 3rd, 2007, 02:18 AM
#2
Re: Error 50003 Vista Only on Minimize
maybe try
vb Code:
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
-
Jun 3rd, 2007, 03:59 AM
#3
Thread Starter
Member
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.
-
Jun 3rd, 2007, 04:22 AM
#4
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
-
Jun 3rd, 2007, 11:02 AM
#5
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]
-
Jun 3rd, 2007, 08:36 PM
#6
Thread Starter
Member
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:
NoPopup = NoPopup + 1
If NoPopup < 1 Then NoPopup = 1
Set PopUp(NoPopup) = New frmReminder 'Form2
PopUp(NoPopup).Iniciar "msg here", NoPopup
If NoPopup = 3 Then NoPopup = 0
-
Jun 3rd, 2007, 10:30 PM
#7
Thread Starter
Member
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.
-
Jun 4th, 2007, 08:07 AM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|