Pass correct value in VB.net

StewartBW 1,460 Reputation points
2025-05-01T15:02:24.29+00:00

Hi experts,

When using ExitWindowsEx in VB.net, for DWORD dwReason I wanna set this value:

SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED

"Other (Planned)" A planned shutdown or restart.

So, what to set for:

ExitWindowsEx(EWX_REBOOT, xx??xx)

Their values are 0x00000000 and 0x00000000 and 0x80000000

Thanks for your help :)

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,837 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 88,871 Reputation points
    2025-05-01T16:20:55.7766667+00:00
    Public Const SHTDN_REASON_MAJOR_OTHER As UInteger = &H0
    Public Const SHTDN_REASON_MINOR_OTHER As UInteger = &H0
    Public Const SHTDN_REASON_FLAG_PLANNED As UInteger = &H80000000UI
    
    Dim nReason As UInteger = SHTDN_REASON_MAJOR_OTHER Or SHTDN_REASON_MINOR_OTHER Or SHTDN_REASON_FLAG_PLANNED
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.