Results 1 to 8 of 8

Thread: Change "Type" from vb6 to vb9

  1. #1

    Thread Starter
    Hyperactive Member Skatebone's Avatar
    Join Date
    Jan 2009
    Location
    Malta
    Posts
    279

    Smile 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
    Life runs on code

  2. #2
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: Change "Type" from vb6 to vb9

    VB 2005, Win Xp Pro sp2

  3. #3
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    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

  4. #4

    Thread Starter
    Hyperactive Member Skatebone's Avatar
    Join Date
    Jan 2009
    Location
    Malta
    Posts
    279

    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
    Life runs on code

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: Change "Type" from vb6 to vb9

    Type should be Class, in this case.
    My usual boring signature: Nothing

  6. #6

    Thread Starter
    Hyperactive Member Skatebone's Avatar
    Join Date
    Jan 2009
    Location
    Malta
    Posts
    279

    Re: Change "Type" from vb6 to vb9

    Tnx half btw
    Life runs on code

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    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.
    My usual boring signature: Nothing

  8. #8

    Thread Starter
    Hyperactive Member Skatebone's Avatar
    Join Date
    Jan 2009
    Location
    Malta
    Posts
    279

    Re: Change "Type" from vb6 to vb9

    Got it Tnx Shaggy
    Life runs on code

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