- Joined
- Jun 5, 2007
- Messages
- 2,167 (0.33/day)
- Location
- Metro Manila, Philippines
System Name | Zangief (Reborn) 2.0 AM4 not dead yet! |
---|---|
Processor | AMD Ryzen R7 5700X3D (tweaked PBO) |
Motherboard | Gigabyte GA-AX370 Gaming K7 Rev 1.0 BIOS F53d |
Cooling | Noctua NH-D15 Push / Push Config | 2x ML120 | 2x Phanteks 120 mm |
Memory | 2x16GB G.Skill Trident Z Neo RGB @ 3600mhz CL 18 -> running 3800mhz @ 1.37v |
Video Card(s) | Asus RTX 3080 Rog Strix Gaming OC |
Storage | 250 GB Samsung Evo 850 / 1tb WD Black / 4tb WD Blue / 512GB Adata XPG Pro SX8200 |
Display(s) | Acer Predator XB271HU |Asus VX239H 23" AH-IPS Led |
Case | Phanteks Enthoo Pro M TG |
Audio Device(s) | On Board Realtek HD | Steelseries Arctis Nova Pro Wireless |
Power Supply | Seasonic Focus GX V4 850 Watts ATX 3.1 |
Mouse | Logitech G903 |
Keyboard | AKKO 5098N (Otemu Cocoa Brown Lubed) | Tecware Spectre 96 (Akko Lavander Purple V3 lubed) |
Software | Windows 11 Pro 24H2 |
Code:
Imports System.Runtime.InteropServices
Imports System.Diagnostics
Public Class Form1
Const SW_HIDE As Integer = 0
Const SW_RESTORE As Integer = 9
Dim hWnd As Integer
Dim p As Process() = Process.GetProcessesByName("notepad")
Declare Auto Function ShowWindow Lib "User32" (ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ShowWindow(hWnd, SW_HIDE)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ShowWindow(hWnd, SW_RESTORE)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
hWnd = p(0).MainWindowHandle.ToInt32
End Sub
So far this does what I want it to do, hide the application from the taskbar and will be able to show it again on screen.
But this works only if notepad(other apps) is alread running ahead of my program.
If I ran my program first and open up notepad it won't work.
How can I set it to work ?
Last edited: