Advertisement
calfred2808

Run console without showing console window

Aug 12th, 2022
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.38 KB | None | 0 0
  1. Private Declare Auto Function ShowWindow Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Boolean
  2. Private Declare Auto Function GetConsoleWindow Lib "kernel32.dll" () As IntPtr
  3. Private Const SW_HIDE As Integer = 0
  4.  
  5. Sub Main()
  6.     Dim hWndConsole As IntPtr
  7.     hWndConsole = GetConsoleWindow()
  8.     ShowWindow(hWndConsole, SW_HIDE)
  9.     'continue your code
  10. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement