Page 2 of 4

Re: [REQUEST] Application Hider ?

Posted: Thu Sep 29, 2011 8:41 pm
by mandai
There is no need to see XroX's code as this is fairly simple to do.

You can use this to list and hide/show windows:
Code: Select all
    <DllImport("user32.dll")> Shared Function GetWindowText(ByVal hWnd As IntPtr, ByVal lpString As StringBuilder, ByVal nMaxCount As Integer) As Integer
    End Function

    Dim windowHandles As List(Of IntPtr) = New List(Of IntPtr)

    Function del_EnumWindowsProc(ByVal hwnd As IntPtr, ByVal lParam As UInteger) As Boolean
        Dim sb As StringBuilder = New StringBuilder(255) ' MAXTITLE = 255

        GetWindowText(hwnd, sb, sb.MaxCapacity)

        Dim winTitle As String = sb.ToString()
        If winTitle.Length > 0 Then
            listWindows.Items.Add(winTitle)
            windowHandles.Add(hwnd)
        End If

        Return True
    End Function

    Delegate Function EnumWindowsProc(ByVal hWnd As IntPtr, ByVal lParam As UInteger) As Boolean

    <DllImport("user32.dll")> Shared Function EnumDesktopWindows(ByVal hDesktop As IntPtr, ByVal lpEnumCallbackFunction As [Delegate], ByVal lParam As UInteger) As Boolean
    End Function

    Private Sub btnList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnList.Click

        windowHandles.Clear()
        EnumDesktopWindows(IntPtr.Zero, New EnumWindowsProc(AddressOf del_EnumWindowsProc), 0)

    End Sub

    <DllImport("user32.dll")> Shared Function ShowWindow(ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Boolean
    End Function

    Const SW_HIDE As Integer = 0

    Private Sub btnHide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHide.Click

        If listWindows.SelectedIndex > -1 Then
            ShowWindow(windowHandles(listWindows.SelectedIndex), SW_HIDE)
        End If
    End Sub

    Const SW_NORMAL As Integer = 1

    Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click

        If listWindows.SelectedIndex > -1 Then
            ShowWindow(windowHandles(listWindows.SelectedIndex), SW_NORMAL)
        End If
    End Sub
Where listWindows is a listbox control.

Re: [REQUEST] Application Hider ?

Posted: Thu Sep 29, 2011 9:20 pm
by Axel
You probably didn't know you have to put
Code: Select all
Imports System.Runtime.InteropServices
on top

Re: [REQUEST] Application Hider ?

Posted: Fri Sep 30, 2011 9:30 am
by clanc789
Mandai how on earth did you know this then? I mean you know like EVERYTHING about MYSQL, FTP,TCP,VB.NET,C# etc etc.

Re: [REQUEST] Application Hider ?

Posted: Fri Sep 30, 2011 9:52 am
by M1z23R
His life is dedicated to computers :) That is how and why he knows every single thing about computers :) every single bit :D

Re: [REQUEST] Application Hider ?

Posted: Fri Sep 30, 2011 11:04 am
by CodenStuff
mandai isnt real hes A.I. thats why he doesnt talk much..he only responds to programming questions lol. I asked him how to boil an egg once and he didnt answer so I rephrased my question and asked "How do you boil a Egg in .NET" and he replied:
Code: Select all
If Water = Boiling then
 PutEggInWater = True
 Timer1.Interval = "180000"
End If
What type of program are you making XroX that requires you to hide the running process? - hope its a friendly app :)

Re: [REQUEST] Application Hider ?

Posted: Fri Sep 30, 2011 1:36 pm
by clanc789
CodenStuff wrote:
mandai isnt real hes A.I. thats why he doesnt talk much..he only responds to programming questions lol. I asked him how to boil an egg once and he didnt answer so I rephrased my question and asked "How do you boil a Egg in .NET" and he replied:
Code: Select all
If Water = Boiling then
 PutEggInWater = True
 Timer1.Interval = "180000"
End If
What type of program are you making XroX that requires you to hide the running process? - hope its a friendly app :)
HAHAH, i rlly was ROFL by that cody :)

Re: [REQUEST] Application Hider ?

Posted: Fri Sep 30, 2011 7:16 pm
by mandai
Lol good joke there.
Did the code work?

For the programming questions, it does help to answer like an A.I. sometimes.

Re: [REQUEST] Application Hider ?

Posted: Fri Sep 30, 2011 7:43 pm
by Agust1337
Not always, sometimes we are like : "What the f*** is that?"

Re: [REQUEST] Application Hider ?

Posted: Fri Sep 30, 2011 9:51 pm
by mandai
You could always ask.

Re: [REQUEST] Application Hider ?

Posted: Sat Oct 01, 2011 9:45 am
by clanc789
mandai wrote:
Lol good joke there.
Did the code work?

For the programming questions, it does help to answer like an A.I. sometimes.
WOOT, he said LOL!

just kidding ^^

mandai is just tha best coder of the site :)