Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    Samueldo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Meh
    Posts
    1,023
    Reputation
    29
    Thanks
    348
    My Mood
    Inspired
    Quote Originally Posted by FLAMESABER View Post
    Why you edited the code ?? I think the problem is occurring coz of editing. Send me the edited code, or use the code I sent in its original form.
    I did use the code in it's original form, but it gave me tons of errors... that's why I edited.

    Wait, what VB do you use, 05, 08 or 10?
    Quote Originally Posted by Grim View Post
    glad to be an inspiration
    Minions rule. /endof

    InjectPlz Refresh - download v1.0 now!

  2. #17
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Samueldo View Post
    I did use the code in it's original form, but it gave me tons of errors... that's why I edited.

    Wait, what VB do you use, 05, 08 or 10?
    08 and 10 both. This one is made in 08.

  3. #18
    Samueldo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Meh
    Posts
    1,023
    Reputation
    29
    Thanks
    348
    My Mood
    Inspired
    Quote Originally Posted by FLAMESABER View Post
    08 and 10 both. This one is made in 08.
    OK, just checking because I thought the problem could be a different framework.
    Quote Originally Posted by Grim View Post
    glad to be an inspiration
    Minions rule. /endof

    InjectPlz Refresh - download v1.0 now!

  4. #19
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Samueldo View Post
    OK, just checking because I thought the problem could be a different framework.
    Can't you just post the edited code ???

  5. #20
    Samueldo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Meh
    Posts
    1,023
    Reputation
    29
    Thanks
    348
    My Mood
    Inspired
    Code:
    Imports System
    Imports System.Drawing
    Imports System.Runtime.InteropServices
    Public Class ExtractIcon
        Private Enum SHGFI
            Flags
            SmallIcon = &H1
            LargeIcon = &H0
            Icon = &H100
            DisplayName = &H200
            Typename = &H400
            SysIconIndex = &H4000
            UseFileAttributes = &H10
        End Enum
        Public Enum IconType
            SmallIcon = True
            LargeIcon = False
        End Enum
    StructLayout(LayoutKind.Sequential)
        Private Structure SHFILEINFO
            Public hIcon As IntPtr
            Public iIcon As Integer
            Public dwAttributes As Integer
            MarshalAs(UnmanagedType.LPStr,SizeConst = 260)
            Public szDisplayName As String
            MarshalAs(UnmanagedType.LPStr,SizeConst = 80)
            Public szTypeName As String
            Public Sub New(ByVal B As Boolean)
                hIcon = IntPtr.Zero
                iIcon = 0
                dwAttributes = 0
                szDisplayName = vbNullString
                szTypeName = vbNullString
            End Sub
        End Structure
        Private Declare Auto Function SHGetFileInfo Lib "shell32" (ByVal pszPath As String, ByVal dwFileAttributes As Integer, ByRef psfi As SHFILEINFO, ByVal cbFileInfo As Integer, ByVal uFlagsn As SHGFI) As Integer
        Public Function GetIcon(ByVal Path As String, Optional ByVal Ico As IconType = True) As Icon
            Dim info As New SHFILEINFO(True)
            Dim cbSizeInfo As Integer = Marshal.SizeOf(info)
            Dim flags As SHGFI = SHGFI.Icon Or SHGFI.UseFileAttributes
            If Ico = True Then
                flags += SHGFI.SmallIcon
            Else
                flags += SHGFI.LargeIcon
            End If
            SHGetFileInfo(Path, 256, info, cbSizeInfo, flags)
            Return Icon.FromHandle(info.hIcon)
        End Function
    End Class
    Quote Originally Posted by Grim View Post
    glad to be an inspiration
    Minions rule. /endof

    InjectPlz Refresh - download v1.0 now!

  6. #21
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Samueldo View Post
    Code:
    Imports System
    Imports System.Drawing
    Imports System.Runtime.InteropServices
    Public Class ExtractIcon
        Private Enum SHGFI
            Flags
            SmallIcon = &H1
            LargeIcon = &H0
            Icon = &H100
            DisplayName = &H200
            Typename = &H400
            SysIconIndex = &H4000
            UseFileAttributes = &H10
        End Enum
        Public Enum IconType
            SmallIcon = True
            LargeIcon = False
        End Enum
    StructLayout(LayoutKind.Sequential)
        Private Structure SHFILEINFO
            Public hIcon As IntPtr
            Public iIcon As Integer
            Public dwAttributes As Integer
            MarshalAs(UnmanagedType.LPStr,SizeConst = 260)
            Public szDisplayName As String
            MarshalAs(UnmanagedType.LPStr,SizeConst = 80)
            Public szTypeName As String
            Public Sub New(ByVal B As Boolean)
                hIcon = IntPtr.Zero
                iIcon = 0
                dwAttributes = 0
                szDisplayName = vbNullString
                szTypeName = vbNullString
            End Sub
        End Structure
        Private Declare Auto Function SHGetFileInfo Lib "shell32" (ByVal pszPath As String, ByVal dwFileAttributes As Integer, ByRef psfi As SHFILEINFO, ByVal cbFileInfo As Integer, ByVal uFlagsn As SHGFI) As Integer
        Public Function GetIcon(ByVal Path As String, Optional ByVal Ico As IconType = True) As Icon
            Dim info As New SHFILEINFO(True)
            Dim cbSizeInfo As Integer = Marshal.SizeOf(info)
            Dim flags As SHGFI = SHGFI.Icon Or SHGFI.UseFileAttributes
            If Ico = True Then
                flags += SHGFI.SmallIcon
            Else
                flags += SHGFI.LargeIcon
            End If
            SHGetFileInfo(Path, 256, info, cbSizeInfo, flags)
            Return Icon.FromHandle(info.hIcon)
        End Function
    End Class
    Replace "Flag" in 6th line with this:

    [php]<Flags()> Private Enum SHGFI[/php]

  7. The Following User Says Thank You to Hassan For This Useful Post:

    Samueldo (05-31-2010)

  8. #22
    Samueldo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Meh
    Posts
    1,023
    Reputation
    29
    Thanks
    348
    My Mood
    Inspired
    Quote Originally Posted by FLAMESABER View Post
    Replace "Flag" in 6th line with this:

    [php]<Flags()> Private Enum SHGFI[/php]
    Okay, I did that with the other error lines too, see if I got anywhere, and it worked... almost.

    On the MarshalAs lines, I got an error saying "SizeConst is not declared".
    Quote Originally Posted by Grim View Post
    glad to be an inspiration
    Minions rule. /endof

    InjectPlz Refresh - download v1.0 now!

  9. #23
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Samueldo View Post
    Okay, I did that with the other error lines too, see if I got anywhere, and it worked... almost.

    On the MarshalAs lines, I got an error saying "SizeConst is not declared".
    MarshalAs(UnmanagedType.LPStr,SizeConst := 260)
    Public szDisplayName As String
    MarshalAs(UnmanagedType.LPStr,SizeConst :=80)

    'You need to add ' : ' before '=' ...

  10. The Following User Says Thank You to Hassan For This Useful Post:

    Samueldo (05-31-2010)

  11. #24
    Samueldo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Meh
    Posts
    1,023
    Reputation
    29
    Thanks
    348
    My Mood
    Inspired
    Quote Originally Posted by FLAMESABER View Post
    MarshalAs(UnmanagedType.LPStr,SizeConst := 260)
    Public szDisplayName As String
    MarshalAs(UnmanagedType.LPStr,SizeConst :=80)

    'You need to add ' : ' before '=' ...
    So basically it looks like half a dick sign. XD Testing now
    Quote Originally Posted by Grim View Post
    glad to be an inspiration
    Minions rule. /endof

    InjectPlz Refresh - download v1.0 now!

  12. #25
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Samueldo View Post
    So basically it looks like half a dick sign. XD Testing now
    xD...Seems so... Let me know if it works !!

  13. The Following User Says Thank You to Hassan For This Useful Post:

    Samueldo (05-31-2010)

  14. #26
    Samueldo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Meh
    Posts
    1,023
    Reputation
    29
    Thanks
    348
    My Mood
    Inspired
    Okay, it isn't working

    I did edit the main form code however. It's supposed to check if the process (written into a textbox called ProcessBox) is running, and if it is show up in the picture box (ProcessIcon).

    [php]Dim ExtractionX As New ExtractIcon
    Dim procList() As Process = Process.GetProcesses()
    For Each Proc In procList
    Try
    If Proc.ProcessName.ToString = ProcessBox.Text Then
    ProcessLogo.BackgroundImage = ExtractionX.GetIcon(Proc.ToString).ToBitmap
    End If
    Catch ex As Exception
    Continue For
    End Try
    Next[/php]
    Quote Originally Posted by Grim View Post
    glad to be an inspiration
    Minions rule. /endof

    InjectPlz Refresh - download v1.0 now!

  15. #27
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Samueldo View Post
    Okay, it isn't working

    I did edit the main form code however. It's supposed to check if the process (written into a textbox called ProcessBox) is running, and if it is show up in the picture box (ProcessIcon).

    [php]Dim ExtractionX As New ExtractIcon
    Dim procList() As Process = Process.GetProcesses()
    For Each Proc In procList
    Try
    If Proc.ProcessName.ToString = ProcessBox.Text Then
    ProcessLogo.BackgroundImage = ExtractionX.GetIcon(Proc.ToString).ToBitmap
    End If
    Catch ex As Exception
    Continue For
    End Try
    Next[/php]
    *Sigh*. Do you have team viewer ??? I guess it will be better to help you in teamviewer, as the problem is minor but you can't get it.

  16. The Following User Says Thank You to Hassan For This Useful Post:

    Samueldo (05-31-2010)

  17. #28
    Samueldo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Meh
    Posts
    1,023
    Reputation
    29
    Thanks
    348
    My Mood
    Inspired
    Quote Originally Posted by FLAMESABER View Post
    *Sigh*. Do you have team viewer ??? I guess it will be better to help you in teamviewer, as the problem is minor but you can't get it.
    XD It must be minor to slip from me, I can fix major problems but not the tiny ones LOL

    My MSN is theblackberry@live.co.uk, I'll give you my TV from there.
    Quote Originally Posted by Grim View Post
    glad to be an inspiration
    Minions rule. /endof

    InjectPlz Refresh - download v1.0 now!

  18. #29
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Samueldo View Post
    XD It must be minor to slip from me, I can fix major problems but not the tiny ones LOL

    My MSN is theblackberry@live.co.uk, I'll give you my TV from there.
    I think your problem is solved... Call it when Injecting... ok ? xD

  19. The Following User Says Thank You to Hassan For This Useful Post:

    Samueldo (05-31-2010)

  20. #30
    Samueldo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Meh
    Posts
    1,023
    Reputation
    29
    Thanks
    348
    My Mood
    Inspired
    Thanks
    Quote Originally Posted by Grim View Post
    glad to be an inspiration
    Minions rule. /endof

    InjectPlz Refresh - download v1.0 now!

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Solved] Help Getting Rs to run on google Chrome
    By Steele Duke in forum Runescape Help
    Replies: 4
    Last Post: 10-26-2011, 07:56 AM
  2. [Help]Getting Location of a running process.
    By nathanael890 in forum Visual Basic Programming
    Replies: 3
    Last Post: 09-20-2010, 09:07 AM
  3. [HELP] Get Process By ID
    By GameTrainerMaker in forum Visual Basic Programming
    Replies: 5
    Last Post: 06-23-2010, 01:29 AM
  4. [TUT] Get running processes and kill them ~~
    By Zoom in forum Visual Basic Programming
    Replies: 2
    Last Post: 11-09-2009, 08:34 AM
  5. Getting the path of a running process?
    By *Marneus901* in forum C++/C Programming
    Replies: 0
    Last Post: 12-08-2008, 01:51 PM