[VB] Keydown issue?

Since I have a custom frame on my application pressing WinKey + Up maximises the application, so I thought ok I'll add a function that supresses the key press when the WinKey + Up combination is pressed, but oh no, it doesn't work.

Are either one of these keys not detected as a key press or something? I'm pretty sure the up key isn't.

dmesg | grep microcode​

Stop hovering to collapse...Click to collapse...Hover to expand...Click to expand...

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(Keys.LWin) Then
MessageBox.Show("winkey pressed")
End If
If GetAsyncKeyState(Keys.Up) Then
MessageBox.Show("up pressed")
End If
End Sub

Can't you just set the MaximizeBox property on your form to False? As far as I know, there's no way to prevent resizing via Windows Key + Up by using the KeyDown event of a form because it only sends the Windows key and not the Up button.

thats why i showed him the getasynckeystate function, it will register all key presses even if the program is not in focus

EDIT:
I think i found what you are looking for (found it on a site and modified it a little for your purpose this will disable the winkeyup on form load and reenable it on form close (uses a low-level hook) tested as working (You may have to go to Project / Properties / Debug and uncheck Enable the Visual Studio Hosting process for it to work while running in Visual Studio), here's the class:

you can add this in a timer with 100 delay to toggle the disabling(e and d):

Code:

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(Keys.E) Then
KeyboardJammer.Jam()
End If
If GetAsyncKeyState(Keys.D) Then
KeyboardJammer.UnJam()
End If
End Sub

I for one have trouble viewing this in this format so here is the project link here don't use their download manager