Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetDesktopWindow()
Message
De
03/10/2001 15:57:26
 
 
À
03/10/2001 15:23:29
Mike Keithley
North Instruments Inc.
Cleveland, Ohio, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
Fonctions API de Windows
Divers
Thread ID:
00563637
Message ID:
00563844
Vues:
20
>>>I am getting Overflow error message while running GetDesktopWindow.
>>>
>>>Private Declare Function GetDesktopWindow Lib "user32" () As Long
>>>
>>> Function StartDoc(DocName As String) As Integer
>>> Dim Scr_hDC As Integer
>>> Scr_hDC = GetDesktopWindow()
>>> StartDoc = ShellExecute(20, "Open", DocName, "", "C:\", SW_SHOWNORMAL)
>>> End Function
>>>
>>>It works if I comment it out, but sometimes act strange.
>>>Please help!
>>
>>Wait, shouldn't Scr_hDC be a Long type also?
>
>Thank you , it was dumb!
>But now I ran into different problem.
>I run all this focuments form ListView.
>
>Private Sub lvFileList_ItemClick(ByVal Item As MSComctlLib.ListItem)
> Dim sFileName As String
> Dim r As Long, msg As String
> sFileName = Item.Text
> r = StartDoc(sFileName)
> If r<=32 Then
> 'Error
> Else
> 'Ok
> End If
>End Sub
>
>It opens a document. No problem there. When I come back to the listview file icon so to speak "attached" to my cursor. So when I move a cursor everything is ListView moves. It's very odd. It doesn't happend every time but often, and every time I am running Word or Excell document after Notepad document.
>Is anything I need to realease after running the document? Any idea?

Not sure what the problem might be here. You could try using the LockWindowUpdate API to prevent form repainting while some processing is being done.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform