Sinisterly
Transparent Console Application! - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework)
+--- Thread: Transparent Console Application! (/Thread-Transparent-Console-Application)



Transparent Console Application! - HomerChimpson - 07-26-2013

I did not make the code, i simply added improvements.
Coded by my good friend Anon?M ID :angel:
Let's get started!

== Tutorial ==
1. Create a Console Application, name it whatever you want.
[Image: AZmYiCx.png]
2. Add this code right below the text "Module Module1"

Code:
Private Enum DwmBlurBehindDwFlags ' Fields DWM_BB_BLURREGION = 2 DWM_BB_ENABLE = 1 DWM_BB_TRANSITIONONMAXIMIZED = 4 End Enum <DllImport("Kernel32.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _ Private Function GetConsoleWindow() As IntPtr End Function Private Structure DWM_BLURBEHIND Public dwFlags As DwmBlurBehindDwFlags Public fEnable As Boolean Public hRgnBlur As IntPtr Public fTransitionOnMaximized As Boolean End Structure <StructLayout(LayoutKind.Sequential)> _ Public Structure MARGINS Public cxLeftWidth As Integer Public cxRightWidth As Integer Public cyTopHeight As Integer Public cyButtomheight As Integer End Structure <DllImport("dwmapi.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _ Private Sub DwmEnableBlurBehindWindow(ByVal hwnd As IntPtr, ByRef blurBehind As DWM_BLURBEHIND) End Sub
3. And add this code to the Main Sub :
Code:
Dim blurBehind As New DWM_BLURBEHIND With { _ .dwFlags = DwmBlurBehindDwFlags.DWM_BB_ENABLE, _ .fEnable = True _ } Module1.DwmEnableBlurBehindWindow(Module1.GetConsoleWindow, blurBehind)
4. What's that? errors you say? just add this code on the top :
Code:
Imports System.Runtime.InteropServices
== Finishing ==
Now, your code should look like this :
[Image: xwk5.png]
Add your own codes, Debug, and done! this is the end result :
[Image: RE9IIZQ.png]
Give credits to Anon?M ID if you'll use this :3
And leave positive feedback :angel:


RE: Transparent Console Application! - Xiledcore - 07-26-2013

This looks pretty neat, thanks for sharing! (Might use)

Thank you, Anon?m ID.


RE: Transparent Console Application! - Eternity - 07-26-2013

It's not transparent, you just replaced the background with blur.

Good share though.


RE: Transparent Console Application! - Platinum - 07-27-2013

Looks neat, already found something similar to this before though. Nice share!


RE: Transparent Console Application! - Madara-Uchiha - 07-27-2013

You can also make the console looking transparent using this method:

PHP Code:
Imports System.Diagnostics Public Class Glass Private Declare Sub DwmEnableBlurBehindWindow Lib "dwmapi.dll" ( _ ByVal hwnd As IntPtr, _ ByRef blurBehind As DWM_BLURBEHIND) Private Enum DwmBlurBehindDwFlags DWM_BB_ENABLE = &H1 DWM_BB_BLURREGION = &H2 DWM_BB_TRANSITIONONMAXIMIZED = &H4 End Enum Private Structure DWM_BLURBEHIND Public dwFlags As DwmBlurBehindDwFlags Public fEnable As Boolean Public hRgnBlur As IntPtr Public fTransitionOnMaximized As Boolean End Structure Shared Sub Main() Dim P As New Process Dim ArgString As String = String.Empty Dim eArgs() As String = Environment.GetCommandLineArgs If eArgs.Length > 1 Then For i As Integer = 1 To eArgs.Length - 1 ArgString &= eArgs(i) & " " Next End If P.StartInfo.FileName = "Cmd.exe" P.StartInfo.Arguments = ArgString P.Start() Threading.Thread.Sleep(350) DwmEnableBlurBehindWindow(P.MainWindowHandle, New DWM_BLURBEHIND With {.dwFlags = DwmBlurBehindDwFlags.DWM_BB_ENABLE, .fEnable = True}) End Sub End Class

Credits: nathan72389 from HF


RE: Transparent Console Application! - Eternity - 07-27-2013

(07-27-2013, 11:49 AM)Madara-Uchiha Wrote: You can also make the console looking transparent using this method:

PHP Code:
Imports System.Diagnostics Public Class Glass Private Declare Sub DwmEnableBlurBehindWindow Lib "dwmapi.dll" ( _ ByVal hwnd As IntPtr, _ ByRef blurBehind As DWM_BLURBEHIND) Private Enum DwmBlurBehindDwFlags DWM_BB_ENABLE = &H1 DWM_BB_BLURREGION = &H2 DWM_BB_TRANSITIONONMAXIMIZED = &H4 End Enum Private Structure DWM_BLURBEHIND Public dwFlags As DwmBlurBehindDwFlags Public fEnable As Boolean Public hRgnBlur As IntPtr Public fTransitionOnMaximized As Boolean End Structure Shared Sub Main() Dim P As New Process Dim ArgString As String = String.Empty Dim eArgs() As String = Environment.GetCommandLineArgs If eArgs.Length > 1 Then For i As Integer = 1 To eArgs.Length - 1 ArgString &= eArgs(i) & " " Next End If P.StartInfo.FileName = "Cmd.exe" P.StartInfo.Arguments = ArgString P.Start() Threading.Thread.Sleep(350) DwmEnableBlurBehindWindow(P.MainWindowHandle, New DWM_BLURBEHIND With {.dwFlags = DwmBlurBehindDwFlags.DWM_BB_ENABLE, .fEnable = True}) End Sub End Class

Credits: nathan72389 from HF

Blur isn't Transparent -.-


RE: Transparent Console Application! - 0xDEADPIXEL - 07-28-2013

You can achieve window transparency using the SetLayeredWindowAttributes function.


RE: Transparent Console Application! - zosoftnet - 08-01-2013

Haha! This is great code....Thanks for sharing! I just have a simple question, this will work on XP Environment ? I think it will only work on Vista/7/8 ??


RE: Transparent Console Application! - Eternity - 08-01-2013

(08-01-2013, 02:45 PM)zosoftnet Wrote: Haha! This is great code....Thanks for sharing! I just have a simple question, this will work on XP Environment ? I think it will only work on Vista/7/8 ??

Don't think som since it uses the aero framework.