Click here to Skip to main content
15,923,051 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionselect case Pin
charchabil0316-Nov-06 2:05
charchabil0316-Nov-06 2:05 
AnswerRe: select case Pin
nlarson1116-Nov-06 3:57
nlarson1116-Nov-06 3:57 
AnswerRe: select case [modified] Pin
Yona Low16-Nov-06 4:17
Yona Low16-Nov-06 4:17 
GeneralRe: select case Pin
nlarson1116-Nov-06 4:34
nlarson1116-Nov-06 4:34 
GeneralRe: select case Pin
Yona Low16-Nov-06 4:44
Yona Low16-Nov-06 4:44 
Questionhow to logoff using Windows Service Pin
BSRK16-Nov-06 1:39
BSRK16-Nov-06 1:39 
AnswerRe: how to logoff using Windows Service Pin
Dave Sexton16-Nov-06 3:16
Dave Sexton16-Nov-06 3:16 
AnswerRe: how to logoff using Windows Service Pin
Dave Sexton16-Nov-06 3:43
Dave Sexton16-Nov-06 3:43 
Here is an API call that forces a logoff BUT I'm still trying to work out a bug - it throws an exception during debug saying that I've unbalanced the stack, though this exception isn't thrown when I run the code from outside the IDE.

So basically what I'm saying is that the code below ain't perfect but it's closer to what you asked for than the previous example.

This function takes two arguments. First argument is one or more flags (the declared constants) instructing windows how to shutdown. Second argument is reserved (I don't know why yet), and is set to zero.

Public Const EWX_LOGOFF = 0
Public Const EWX_SHUTDOWN = 1
Public Const EWX_REBOOT = 2
Public Const EWX_FORCE = 4

Declare Function ExitWindowsEx Lib "user32" Alias _
    "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved _
    As Long) As Long

then when needed call
ExitWindowsEx(EWX_FORCE Or EWX_LOGOFF, 0)


I'm still trying to figure it out better. Sorry that the help I've provided isn't very informative or perfect. Sigh | :sigh:
GeneralRe: how to logoff using Windows Service Pin
Dave Kreskowiak16-Nov-06 4:15
mveDave Kreskowiak16-Nov-06 4:15 
GeneralRe: how to logoff using Windows Service Pin
Yona Low16-Nov-06 4:21
Yona Low16-Nov-06 4:21 
GeneralRe: how to logoff using Windows Service Pin
Dave Sexton16-Nov-06 19:34
Dave Sexton16-Nov-06 19:34 
GeneralThanks to kulazfuk and Dave Pin
BSRK17-Nov-06 18:41
BSRK17-Nov-06 18:41 
QuestionShared Memory Pin
PlescaSorin16-Nov-06 0:52
PlescaSorin16-Nov-06 0:52 
AnswerRe: Shared Memory Pin
nlarson1116-Nov-06 4:01
nlarson1116-Nov-06 4:01 
AnswerRe: Shared Memory Pin
Dave Kreskowiak16-Nov-06 6:15
mveDave Kreskowiak16-Nov-06 6:15 
QuestionWhats the meaning of 2 declarations. Pin
ashwath197915-Nov-06 23:05
ashwath197915-Nov-06 23:05 
AnswerRe: Whats the meaning of 2 declarations. Pin
The ANZAC15-Nov-06 23:06
The ANZAC15-Nov-06 23:06 
AnswerRe: Whats the meaning of 2 declarations. Pin
Dave Kreskowiak16-Nov-06 4:03
mveDave Kreskowiak16-Nov-06 4:03 
GeneralRe: Whats the meaning of 2 declarations. Pin
ashwath197916-Nov-06 19:16
ashwath197916-Nov-06 19:16 
QuestionHow can i replace all apostrophes on DataSet? Pin
murat_turhan15-Nov-06 23:01
murat_turhan15-Nov-06 23:01 
AnswerRe: How can i replace all apostrophes on DataSet? Pin
_mubashir16-Nov-06 0:27
_mubashir16-Nov-06 0:27 
GeneralRe: How can i replace all apostrophes on DataSet? Pin
murat_turhan16-Nov-06 3:22
murat_turhan16-Nov-06 3:22 
QuestionWhats the meaning of below declarations Pin
ashwath197915-Nov-06 22:28
ashwath197915-Nov-06 22:28 
QuestionIs there something wrong with this line...? Pin
penguin500015-Nov-06 21:57
penguin500015-Nov-06 21:57 
AnswerRe: Is there something wrong with this line...? Pin
Christian Graus15-Nov-06 22:06
protectorChristian Graus15-Nov-06 22:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.