Announcement

Collapse
No announcement yet.

DisconnectWindowDialog

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DisconnectWindowDialog

    Show logoff-switch users-screen, undocumented, XPsp3+
    Function can't be reach via its name so the ordinal number 254 must be used

    Pierre

    Code:
    [color=#0000FF]#COMPILE EXE[/color] [b][i][color=#008080]'#Win 8.04#[/color][/i][/b]
    [color=#0000FF]#DIM ALL[/color]
    [color=#0000FF]#INCLUDE[/color] [color=#800040]"Win32Api.inc"[/color]
     
    [b][i][color=#008080]'DECLARE FUNCTION DisconnectWindowDialogOrdinal LIB "shell32.dll" _
    'ALIAS "DisconnectWindowDialogOrdinal"(BYVAL unused AS DWORD)AS LONG 'Ordinal 254, XPsp3+[/color][/i][/b]
     
    [color=#0000FF]DECLARE FUNCTION[/color] DisconnectWindowDialogOrdinal([color=#0000FF]BYVAL[/color] unused [color=#0000FF]AS LONG[/color])[color=#0000FF]AS LONG[/color] [b][i][color=#008080]'Ordinal 254, XPsp3+[/color][/i][/b]
     
    [color=#0000FF]GLOBAL[/color] hDlg [color=#0000FF]AS DWORD[/color]
     
    [color=#8000FF]%LabelDescription[/color] = [color=#FF0000]101[/color]
    [color=#8000FF]%LabelShowInfo[/color]    = [color=#FF0000]102[/color]
    [color=#8000FF]%ButtonLogOff[/color]     = [color=#FF0000]201[/color]
    [b][i][color=#008080]'______________________________________________________________________________[/color][/i][/b]
     
    [color=#0000FF]CALLBACK FUNCTION[/color] DlgProc
     [color=#0000FF]LOCAL[/color] hLib  [color=#0000FF]AS DWORD[/color]
     [color=#0000FF]LOCAL[/color] pProc [color=#0000FF]AS DWORD[/color]
     
     [color=#0000FF]SELECT CASE CBMSG[/color]
       [color=#0000FF]CASE[/color] [color=#8000FF]%WM_COMMAND[/color]
         [color=#0000FF]SELECT CASE CBCTL[/color]
           [color=#0000FF]CASE[/color] [color=#8000FF]%ButtonLogOff[/color]
             [color=#0000FF]IF CBCTLMSG[/color] = [color=#8000FF]%BN_CLICKED[/color] [color=#0000FF]OR CBCTLMSG[/color] = [color=#FF0000]1[/color] [color=#0000FF]THEN[/color]
               [b][i][color=#008080]'Function can't be reach via its name so the ordinal number must be used[/color][/i][/b]
               hLib = [color=#009CFF][b]LoadLibrary[/b][/color]([color=#800040]"Shell32.dll"[/color])
               [color=#0000FF]IF[/color] hLib [color=#0000FF]THEN[/color]
                 pProc = [color=#009CFF][b]GetProcAddress[/b][/color](hLib, [color=#0000FF]BYVAL MAKDWD[/color]([color=#FF0000]254[/color], [color=#FF0000]0[/color]))
                 [color=#0000FF]IF[/color] pProc [color=#0000FF]THEN[/color]
                   [b][i][color=#008080]'Show logoff-switch users-screen[/color][/i][/b]
                   [color=#0000FF]CALL DWORD[/color] pProc [color=#0000FF]USING[/color] DisconnectWindowDialogOrdinal([color=#FF0000]0[/color])
                 [color=#0000FF]END IF[/color]
                 [color=#009CFF][b]FreeLibrary[/b][/color](hLib)
               [color=#0000FF]END IF[/color]
             [color=#0000FF]END IF[/color]
         [color=#0000FF]END SELECT[/color]
      [color=#0000FF]END SELECT[/color]
     
    [color=#0000FF]END FUNCTION[/color]
    [b][i][color=#008080]'______________________________________________________________________________[/color][/i][/b]
     
    [color=#0000FF]FUNCTION PBMAIN[/color]()
     [color=#0000FF]LOCAL[/color] hIcon [color=#0000FF]AS DWORD[/color]
     
     [color=#0000FF]DIALOG FONT[/color] [color=#800040]"Segoe UI"[/color], [color=#FF0000]9[/color]
     [color=#0000FF]DIALOG NEW[/color] [color=#8000FF]%HWND_DESKTOP[/color], [color=#800040]"DisconnectWindowDialog"[/color], , , [color=#FF0000]200[/color], [color=#FF0000]60[/color], _
     [color=#8000FF]%WS_CAPTION[/color] [color=#0000FF]OR[/color] [color=#8000FF]%WS_MINIMIZEBOX[/color] [color=#0000FF]OR[/color] [color=#8000FF]%WS_SYSMENU[/color], [color=#FF0000]0[/color] [color=#0000FF]TO[/color] hDlg
     
     hIcon = [color=#009CFF][b]ExtractIcon[/b][/color]([color=#009CFF][b]GetModuleHandle[/b][/color]([color=#800040]""[/color]), [color=#800040]"Shell32.dll"[/color], [color=#FF0000]80[/color])
     [color=#009CFF][b]SetClassLong[/b][/color](hDlg, [color=#8000FF]%GCL_HICON[/color], hIcon)
     
     [color=#0000FF]CONTROL ADD LABEL[/color],  hDlg, [color=#8000FF]%LabelDescription[/color], [color=#800040]"Show logoff-switch-users screen"[/color], [color=#FF0000]5[/color],  [color=#FF0000]5[/color], [color=#FF0000]190[/color], [color=#FF0000]10[/color], [color=#8000FF]%SS_CENTER[/color] [color=#0000FF]OR[/color] [color=#8000FF]%SS_NOTIFY[/color]
     [color=#0000FF]CONTROL ADD LABEL[/color],  hDlg, [color=#8000FF]%LabelShowInfo[/color],    [color=#800040]"Undocumented api: XP sp3 +"[/color],      [color=#FF0000]5[/color], [color=#FF0000]20[/color], [color=#FF0000]190[/color], [color=#FF0000]10[/color], [color=#8000FF]%SS_CENTER[/color] [color=#0000FF]OR[/color] [color=#8000FF]%SS_NOTIFY[/color]
     [color=#0000FF]CONTROL ADD BUTTON[/color], hDlg, [color=#8000FF]%ButtonLogOff[/color],     [color=#800040]"&DisconnectWindowDialog"[/color],        [color=#FF0000]50[/color], [color=#FF0000]35[/color], [color=#FF0000]100[/color], [color=#FF0000]15[/color]
     
     [color=#0000FF]DIALOG SHOW MODAL[/color] hDlg [color=#0000FF]CALL[/color] DlgProc
     
     [color=#009CFF][b]DestroyIcon[/b][/color](hIcon)
     
    [color=#0000FF]END FUNCTION[/color]
    [b][i][color=#008080]'______________________________________________________________________________
    '[/color][/i][/b]
Working...
X