Change "Type" from vb6 to vb9
Hey guys I have this code which i used to use in vb6 to flash a window i need to convert it for vb9. Tnx for your help ;)
Code:
Private Const FLASHW_STOP = 0
Private Const FLASHW_CAPTION = &H1
Private Const FLASHW_TRAY = &H2
Private Const FLASHW_ALL = (FLASHW_CAPTION Or FLASHW_TRAY)
Private Const FLASHW_TIMER = &H4
Private Const FLASHW_TIMERNOFG = &HC
Private Type FLASHWINFO
cbSize As Long
hwnd As Long
dwFlags As Long
uCount As Long
dwTimeout As Long
End Type
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
Private Declare Function FlashWindowEx Lib "user32" (pfwi As FLASHWINFO) As Boolean
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Dim FlashInfo As FLASHWINFO
Dim iHwnd As Integer
'Dim iHwndChild As Integer
Private Sub Command1_Click()
iHwnd = FindWindow("notepad", vbNullString)
'iHwndChild = FindWindowEx(iHwnd, 0, "Edit", vbNullString)
With FlashInfo
.cbSize = Len(FlashInfo)
.dwFlags = FLASHW_ALL Or FLASHW_TIMER
.dwTimeout = 0
.hwnd = iHwnd
.uCount = 0
End With
FlashWindowEx FlashInfo
End Sub
Re: Change "Type" from vb6 to vb9
Re: Change "Type" from vb6 to vb9
So whats the problem exactly, or do you mean you have this code you want someone else to convert for you;)
Re: Change "Type" from vb6 to vb9
I need somone to convert cause im kinda convused... u have to use structure? or just declare the stuff?
Tnx :)
Re: Change "Type" from vb6 to vb9
Type should be Class, in this case.
Re: Change "Type" from vb6 to vb9
Re: Change "Type" from vb6 to vb9
Ah, we crossed up. Since you want to be passing a pointer to an object of the correct type, I think a class would make most sense, as it is a reference type. The Longs should be changed to Integer, since the Long was 32 bits in VB6, while the Integer is 32 bits in .NET.
Re: Change "Type" from vb6 to vb9