Hello
Is this declare in my VB.NET Main startup form correct?
<DllImport("User32.dll", SetLastError:=True)>
Private Shared Function LockWorkStation() As Boolean
End Function
<DllImport("Kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)>
Friend Shared Function GetTickCount() As UInteger
End Function
<DllImport("Kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)>
Friend Shared Function SetThreadExecutionState(ByVal esFlags As EXECUTION_STATE) As EXECUTION_STATE
End Function
I've no idea if DllImport(Kernel32.dll) should be repeated twice for GetTickCount and SetThreadExecutionState?
Because if I remove the 2nd DllImport, I will get:
Function 'SetThreadExecutionState' doesn't return a value on all code paths.
My original working declare was:
Private Declare Function SetThreadExecutionState Lib "kernel32" (ByVal esFlags As EXECUTION_STATE) As EXECUTION_STATE
Thanks for advise :)