Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

Enumerate network Users, Groups and Machines using NetQueryDisplayInformation

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

  • Enumerate network Users, Groups and Machines using NetQueryDisplayInformation

    Enumerate network Users, Groups and Machines using NetQueryDisplayInformation



    Code:
    [B][I][COLOR=#008080]'Enumerate network Users, Groups and Machines using NetQueryDisplayInformation[/COLOR][/I][/B]
     
    [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]
    [COLOR=#0000FF]#INCLUDE[/COLOR] [COLOR=#800040]"LmAccess.inc"[/COLOR]
    [COLOR=#0000FF]#INCLUDE[/COLOR] [COLOR=#800040]"LmWkSta.inc"[/COLOR]
    [COLOR=#0000FF]#INCLUDE[/COLOR] [COLOR=#800040]"CommCtrl.inc"[/COLOR]
     
    [COLOR=#8000FF]%LabelDomain[/COLOR]      = [COLOR=#FF0000]1001[/COLOR]
    [COLOR=#8000FF]%LabelPdc[/COLOR]         = [COLOR=#FF0000]1002[/COLOR]
    [COLOR=#8000FF]%LabelUsername[/COLOR]    = [COLOR=#FF0000]1003[/COLOR]
    [COLOR=#8000FF]%LabelLoggedon[/COLOR]    = [COLOR=#FF0000]1004[/COLOR]
     
    [COLOR=#8000FF]%ButtonUser[/COLOR]       = [COLOR=#FF0000]1011[/COLOR]
    [COLOR=#8000FF]%ButtonMachine[/COLOR]    = [COLOR=#FF0000]1012[/COLOR]
    [COLOR=#8000FF]%ButtonGroup[/COLOR]      = [COLOR=#FF0000]1013[/COLOR]
    [COLOR=#8000FF]%ButtonExit[/COLOR]       = [COLOR=#FF0000]1014[/COLOR]
     
    [COLOR=#8000FF]%TextboxDomain[/COLOR]    = [COLOR=#FF0000]1021[/COLOR]
    [COLOR=#8000FF]%TextboxPdc[/COLOR]       = [COLOR=#FF0000]1022[/COLOR]
    [COLOR=#8000FF]%TextboxLoggedon[/COLOR]  = [COLOR=#FF0000]1023[/COLOR]
    [COLOR=#8000FF]%TextboxUsername[/COLOR]  = [COLOR=#FF0000]1024[/COLOR]
     
    [COLOR=#8000FF]%ListboxUser[/COLOR]      = [COLOR=#FF0000]1031[/COLOR]
     
    [COLOR=#8000FF]%CheckboxPdc[/COLOR]      = [COLOR=#FF0000]1041[/COLOR]
    [COLOR=#8000FF]%CheckboxLoggedon[/COLOR] = [COLOR=#FF0000]1042[/COLOR]
     
    [COLOR=#8000FF]%Statusbar[/COLOR]        = [COLOR=#FF0000]1051[/COLOR]
     
    [COLOR=#8000FF]%User_Level[/COLOR]       = [COLOR=#FF0000]0001[/COLOR]
    [COLOR=#8000FF]%Machine_Level[/COLOR]    = [COLOR=#FF0000]0002[/COLOR]
    [COLOR=#8000FF]%Group_Level[/COLOR]      = [COLOR=#FF0000]0003[/COLOR]
     
    [COLOR=#0000FF]DECLARE FUNCTION[/COLOR] [COLOR=#009CFF][B]NetApiBufferFree[/B][/COLOR] [COLOR=#0000FF]LIB[/COLOR] [COLOR=#800040]"NETAPI32.DLL"[/COLOR] [COLOR=#0000FF]ALIAS[/COLOR] [COLOR=#800040]"NetApiBufferFree"[/COLOR]([COLOR=#0000FF]BYVAL[/COLOR] pBuffer [COLOR=#0000FF]AS DWORD[/COLOR]) [COLOR=#0000FF]AS DWORD[/COLOR]
     
    [COLOR=#0000FF]GLOBAL[/COLOR] hDlg [COLOR=#0000FF]AS DWORD[/COLOR]
    [B][I][COLOR=#008080]'______________________________________________________________________________[/COLOR][/I][/B]
     
    [COLOR=#0000FF]FUNCTION[/COLOR] WinError$([COLOR=#0000FF]BYVAL[/COLOR] ErrorCode [COLOR=#0000FF]AS DWORD[/COLOR]) [COLOR=#0000FF]AS STRING[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] pzError  [COLOR=#0000FF]AS ASCIIZ POINTER[/COLOR] [B][I][COLOR=#008080]'Max is 64K[/COLOR][/I][/B]
     [COLOR=#0000FF]LOCAL[/COLOR] ErrorLen [COLOR=#0000FF]AS DWORD[/COLOR]
     
     ErrorLen = [COLOR=#009CFF][B]FormatMessage[/B][/COLOR]([COLOR=#8000FF]%FORMAT_MESSAGE_FROM_SYSTEM[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%FORMAT_MESSAGE_ALLOCATE_BUFFER[/COLOR], _
                              [COLOR=#0000FF]BYVAL[/COLOR] [COLOR=#8000FF]%NULL[/COLOR], ErrorCode, [COLOR=#8000FF]%NULL[/COLOR], [COLOR=#0000FF]BYVAL VARPTR[/COLOR](pzError), [COLOR=#8000FF]%NULL[/COLOR], [COLOR=#0000FF]BYVAL[/COLOR] [COLOR=#8000FF]%NULL[/COLOR])
     [COLOR=#0000FF]IF[/COLOR] ErrorLen [COLOR=#0000FF]THEN[/COLOR]
       [COLOR=#0000FF]#IF %DEF[/COLOR]([COLOR=#0000FF]%PB_CC32[/COLOR])
       [COLOR=#009CFF][B]CharToOem[/B][/COLOR]([COLOR=#0000FF]BYVAL[/COLOR] pzError, [COLOR=#0000FF]BYVAL[/COLOR] pzError) [B][I][COLOR=#008080]'Console characters[/COLOR][/I][/B]
       [COLOR=#0000FF]#ENDIF[/COLOR]
       [COLOR=#0000FF]FUNCTION[/COLOR] = [COLOR=#800040]"Error"[/COLOR] & [COLOR=#0000FF]STR$[/COLOR](ErrorCode) & [COLOR=#800040]" (0x"[/COLOR] & [COLOR=#0000FF]HEX$[/COLOR](ErrorCode) & [COLOR=#800040]") : "[/COLOR] & @pzError
       [COLOR=#009CFF][B]LocalFree[/B][/COLOR](pzError)
     [COLOR=#0000FF]ELSE[/COLOR]
       [COLOR=#0000FF]FUNCTION[/COLOR] = [COLOR=#800040]"Unknown error"[/COLOR] & [COLOR=#0000FF]STR$[/COLOR](ErrorCode) & [COLOR=#800040]" (0x"[/COLOR] & [COLOR=#0000FF]HEX$[/COLOR](ErrorCode) & [COLOR=#800040]")"[/COLOR]
     [COLOR=#0000FF]END IF[/COLOR]
     
    [COLOR=#0000FF]END FUNCTION[/COLOR]
    [B][I][COLOR=#008080]'_____________________________________________________________________________[/COLOR][/I][/B]
     
    [COLOR=#0000FF]FUNCTION[/COLOR] pUnicodeToAnsi([COLOR=#0000FF]BYVAL[/COLOR] pUnicode [COLOR=#0000FF]AS DWORD[/COLOR])[COLOR=#0000FF]AS STRING[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] CharCount [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] sAnsi     [COLOR=#0000FF]AS STRING[/COLOR]
     
     [COLOR=#0000FF]IF[/COLOR] pUnicode [COLOR=#0000FF]THEN[/COLOR]
       CharCount = [COLOR=#009CFF][B]LStrlenW[/B][/COLOR]([COLOR=#0000FF]BYVAL[/COLOR] pUnicode)
       sAnsi = [COLOR=#0000FF]NUL$[/COLOR](CharCount)
       [COLOR=#009CFF][B]WideCharToMultiByte[/B][/COLOR]([COLOR=#8000FF]%CP_ACP[/COLOR], [COLOR=#8000FF]%NULL[/COLOR], [COLOR=#0000FF]BYVAL[/COLOR] pUnicode, CharCount, _
                           [COLOR=#0000FF]BYVAL STRPTR[/COLOR](sAnsi), CharCount, [COLOR=#0000FF]BYVAL[/COLOR] [COLOR=#8000FF]%NULL[/COLOR], [COLOR=#0000FF]BYVAL[/COLOR] [COLOR=#8000FF]%NULL[/COLOR])
       [COLOR=#0000FF]FUNCTION[/COLOR] = sAnsi
     [COLOR=#0000FF]END IF[/COLOR]
     
    [COLOR=#0000FF]END FUNCTION[/COLOR]
    [B][I][COLOR=#008080]'_____________________________________________________________________________[/COLOR][/I][/B]
     
    [COLOR=#0000FF]FUNCTION[/COLOR] PdcGet([COLOR=#0000FF]BYVAL[/COLOR] sServer [COLOR=#0000FF]AS STRING[/COLOR], [COLOR=#0000FF]BYVAL[/COLOR] sDomainName [COLOR=#0000FF]AS STRING[/COLOR]) [COLOR=#0000FF]AS STRING[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] pBuffer [COLOR=#0000FF]AS DWORD[/COLOR]
     
     [COLOR=#0000FF]IF LEN[/COLOR](sServer) [COLOR=#0000FF]THEN[/COLOR]
       [COLOR=#0000FF]IF LEFT$[/COLOR](sServer, [COLOR=#FF0000]2[/COLOR]) <> [COLOR=#800040]"\\"[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
         sServer = [COLOR=#800040]"\\"[/COLOR] & sServer
       [COLOR=#0000FF]END IF[/COLOR]
       sServer = [COLOR=#0000FF]UCODE$[/COLOR](sServer)
     [COLOR=#0000FF]END IF[/COLOR]
     
     sDomainName = [COLOR=#0000FF]UCODE$[/COLOR](sDomainName)
     
     [COLOR=#0000FF]IF[/COLOR] NetGetDcName([COLOR=#0000FF]BYVAL STRPTR[/COLOR](sServer), [COLOR=#0000FF]BYVAL STRPTR[/COLOR](sDomainName), pBuffer) = [COLOR=#8000FF]%ERROR_SUCCESS[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
       [COLOR=#0000FF]FUNCTION[/COLOR] = pUnicodeToAnsi(pBuffer)
       [COLOR=#009CFF][B]NetApiBufferFree[/B][/COLOR](pBuffer)
     [COLOR=#0000FF]END IF[/COLOR]
     
    [COLOR=#0000FF]END FUNCTION[/COLOR]
    [B][I][COLOR=#008080]'______________________________________________________________________________[/COLOR][/I][/B]
     
    [COLOR=#0000FF]FUNCTION[/COLOR] FlagInfo([COLOR=#0000FF]BYVAL[/COLOR] dwFlags [COLOR=#0000FF]AS DWORD[/COLOR] ) [COLOR=#0000FF]AS STRING[/COLOR]
     
     dwFlags = dwFlags [COLOR=#0000FF]AND[/COLOR] [COLOR=#8000FF]%UF_ACCOUNT_TYPE_MASK[/COLOR]
     
     [COLOR=#0000FF]SELECT CASE[/COLOR] dwFlags
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%UF_NORMAL_ACCOUNT[/COLOR]            : [COLOR=#0000FF]FUNCTION[/COLOR] = [COLOR=#800040]"Domain user"[/COLOR]
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%UF_TEMP_DUPLICATE_ACCOUNT[/COLOR]    : [COLOR=#0000FF]FUNCTION[/COLOR] = [COLOR=#800040]"Local user"[/COLOR]
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%UF_WORKSTATION_TRUST_ACCOUNT[/COLOR] : [COLOR=#0000FF]FUNCTION[/COLOR] = [COLOR=#800040]"Workstation account"[/COLOR]
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%UF_SERVER_TRUST_ACCOUNT[/COLOR]      : [COLOR=#0000FF]FUNCTION[/COLOR] = [COLOR=#800040]"PDC/BDC account"[/COLOR]
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%UF_INTERDOMAIN_TRUST_ACCOUNT[/COLOR] : [COLOR=#0000FF]FUNCTION[/COLOR] = [COLOR=#800040]"Trusted domain account"[/COLOR]
       [COLOR=#0000FF]CASE ELSE[/COLOR]                          : [COLOR=#0000FF]FUNCTION[/COLOR] = [COLOR=#800040]"Unkown account type"[/COLOR]
     [COLOR=#0000FF]END SELECT[/COLOR]
     
    [COLOR=#0000FF]END FUNCTION[/COLOR]
    [B][I][COLOR=#008080]'______________________________________________________________________________[/COLOR][/I][/B]
     
    [COLOR=#0000FF]SUB[/COLOR] NetQuery([COLOR=#0000FF]BYVAL[/COLOR] sServer [COLOR=#0000FF]AS STRING[/COLOR], Level [COLOR=#0000FF]AS DWORD[/COLOR])
     [COLOR=#0000FF]LOCAL[/COLOR] NetDisplayMachinePtr [COLOR=#0000FF]AS[/COLOR] [COLOR=#009CFF][B]NET_DISPLAY_MACHINE[/B][/COLOR] [COLOR=#0000FF]POINTER[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] NetDisplayGroupPtr   [COLOR=#0000FF]AS[/COLOR] [COLOR=#009CFF][B]NET_DISPLAY_GROUP[/B][/COLOR] [COLOR=#0000FF]POINTER[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] NetDisplayUserPtr    [COLOR=#0000FF]AS[/COLOR] [COLOR=#009CFF][B]NET_DISPLAY_USER[/B][/COLOR] [COLOR=#0000FF]POINTER[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] SortedBuf            [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] NextIndex            [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] EntrieCount          [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] DomainAccountCount   [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] DomainGroupCount     [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] DomainMachineCount   [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] EntriesRequested     [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] Looper               [COLOR=#0000FF]AS LONG[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] Retval               [COLOR=#0000FF]AS LONG[/COLOR]
     
     EntriesRequested = [COLOR=#FF0000]99[/COLOR]
     sServer          = [COLOR=#0000FF]UCODE$[/COLOR](sServer)
     
     [COLOR=#0000FF]DO[/COLOR]
       SortedBuf = [COLOR=#8000FF]%NULL[/COLOR]
       [B][I][COLOR=#008080]'NetQueryDisplayInformation returns user account, computer, or group account information.[/COLOR][/I][/B]
       [B][I][COLOR=#008080]'Call this function to quickly enumerate account information for display in user interfaces.[/COLOR][/I][/B]
       Retval = [COLOR=#009CFF][B]NetQueryDisplayInformation[/B][/COLOR]([COLOR=#0000FF]BYVAL STRPTR[/COLOR](sServer), Level, NextIndex, _
                                           [COLOR=#0000FF]BYVAL[/COLOR] EntriesRequested, [COLOR=#8000FF]%MAX_PREFERRED_LENGTH[/COLOR], _
                                           [COLOR=#0000FF]BYVAL VARPTR[/COLOR](EntrieCount), [COLOR=#0000FF]BYVAL VARPTR[/COLOR](SortedBuf))
       [COLOR=#0000FF]IF[/COLOR] Retval <> [COLOR=#8000FF]%ERROR_MORE_DATA[/COLOR] [COLOR=#0000FF]AND[/COLOR] Retval <> [COLOR=#8000FF]%ERROR_SUCCESS[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
         [COLOR=#0000FF]LISTBOX ADD[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#800040]"NetQueryDisplayInformation failed - "[/COLOR] & WinError$(Retval)
         [COLOR=#0000FF]EXIT DO[/COLOR]
       [COLOR=#0000FF]END IF[/COLOR]
     
       [COLOR=#0000FF]LISTBOX ADD[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#0000FF]FORMAT$[/COLOR](EntrieCount) & [COLOR=#800040]" entrie"[/COLOR] & [COLOR=#0000FF]IIF$[/COLOR]((EntrieCount > [COLOR=#FF0000]1[/COLOR]), [COLOR=#800040]"s"[/COLOR], [COLOR=#800040]""[/COLOR])
       [COLOR=#0000FF]LISTBOX ADD[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#800040]""[/COLOR]
     
       [COLOR=#0000FF]SELECT CASE[/COLOR] Level
     
         [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%User_Level[/COLOR]
           NetDisplayUserPtr = SortedBuf
           [COLOR=#0000FF]FOR[/COLOR] Looper = [COLOR=#FF0000]0[/COLOR] [COLOR=#0000FF]TO[/COLOR] EntrieCount - [COLOR=#FF0000]1[/COLOR]
             [B][I][COLOR=#008080]'IF (@NetDisplayUserPtr.usri1_flags AND _NORMAL_Account) THEN[/COLOR][/I][/B]
             [COLOR=#0000FF]INCR[/COLOR] DomainAccountCount
             [COLOR=#0000FF]LISTBOX ADD[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#0000FF]FORMAT$[/COLOR](DomainAccountCount, [COLOR=#800040]"0000"[/COLOR]) & [COLOR=#0000FF]$TAB[/COLOR] & _
                     pUnicodeToAnsi(@NetDisplayUserPtr.usri1_name)              & [COLOR=#0000FF]$TAB[/COLOR] & _
                     pUnicodeToAnsi(@NetDisplayUserPtr.usri1_full_name)         & [COLOR=#0000FF]$TAB[/COLOR] & _
                     FlagInfo(@NetDisplayUserPtr.usri1_flags)
             [COLOR=#0000FF]INCR[/COLOR] NetDisplayUserPtr
             [B][I][COLOR=#008080]'END IF[/COLOR][/I][/B]
           [COLOR=#0000FF]NEXT[/COLOR]
           [COLOR=#0000FF]CONTROL REDRAW[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR]
           [COLOR=#0000FF]IF[/COLOR] EntrieCount > [COLOR=#FF0000]0[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
             [COLOR=#0000FF]DECR[/COLOR] NetDisplayUserPtr
             NextIndex = @NetDisplayUserPtr.usri1_next_index
           [COLOR=#0000FF]END IF[/COLOR]
     
         [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%Machine_Level[/COLOR]
           NetDisplayMachinePtr = SortedBuf
           [COLOR=#0000FF]FOR[/COLOR] Looper = [COLOR=#FF0000]0[/COLOR] [COLOR=#0000FF]TO[/COLOR] EntrieCount - [COLOR=#FF0000]1[/COLOR]
             [COLOR=#0000FF]INCR[/COLOR] DomainMachineCount
             [COLOR=#0000FF]LISTBOX ADD[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#0000FF]FORMAT$[/COLOR](DomainMachineCount, [COLOR=#800040]"0000"[/COLOR]) & [COLOR=#0000FF]$TAB[/COLOR] & _
                     pUnicodeToAnsi(@NetDisplayMachinePtr.usri2_name)           & [COLOR=#0000FF]$TAB[/COLOR] & _
                     pUnicodeToAnsi(@NetDisplayMachinePtr.usri2_comment)        & [COLOR=#0000FF]$TAB[/COLOR] & _
                     FlagInfo(@NetDisplayMachinePtr.usri2_flags)
             [COLOR=#0000FF]INCR[/COLOR] NetDisplayMachinePtr
           [COLOR=#0000FF]NEXT[/COLOR]
           [COLOR=#0000FF]CONTROL REDRAW[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR]
           [COLOR=#0000FF]IF[/COLOR] EntrieCount > [COLOR=#FF0000]0[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
             [COLOR=#0000FF]DECR[/COLOR] NetDisplayMachinePtr
             NextIndex = @NetDisplayMachinePtr.usri2_next_index
           [COLOR=#0000FF]END IF[/COLOR]
     
         [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%Group_Level[/COLOR]
           NetDisplayGroupPtr = SortedBuf
           [COLOR=#0000FF]FOR[/COLOR] Looper = [COLOR=#FF0000]0[/COLOR] [COLOR=#0000FF]TO[/COLOR] EntrieCount - [COLOR=#FF0000]1[/COLOR]
             [COLOR=#0000FF]INCR[/COLOR] DomainGroupCount
             [COLOR=#0000FF]LISTBOX ADD[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#0000FF]FORMAT$[/COLOR](DomainGroupCount, [COLOR=#800040]"0000"[/COLOR]) & [COLOR=#0000FF]$TAB[/COLOR] & _
                     pUnicodeToAnsi(@NetDisplayGroupPtr.grpi3_name)           & [COLOR=#0000FF]$TAB[/COLOR] & _
                     pUnicodeToAnsi(@NetDisplayGroupPtr.grpi3_comment)
             [COLOR=#0000FF]INCR[/COLOR] NetDisplayGroupPtr
           [COLOR=#0000FF]NEXT[/COLOR]
           [COLOR=#0000FF]CONTROL REDRAW[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR]
           [COLOR=#0000FF]IF[/COLOR] EntrieCount > [COLOR=#FF0000]0[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
             [COLOR=#0000FF]DECR[/COLOR] NetDisplayGroupPtr
             NextIndex = @NetDisplayGroupPtr.grpi3_next_index
           [COLOR=#0000FF]END IF[/COLOR]
     
       [COLOR=#0000FF]END SELECT[/COLOR]
     
       [COLOR=#009CFF][B]NetApiBufferFree[/B][/COLOR](SortedBuf)
     
     [COLOR=#0000FF]LOOP WHILE[/COLOR] Retval = [COLOR=#8000FF]%ERROR_MORE_DATA[/COLOR]
     
    [COLOR=#0000FF]END SUB[/COLOR]
    [B][I][COLOR=#008080]'______________________________________________________________________________[/COLOR][/I][/B]
     
    [COLOR=#0000FF]CALLBACK FUNCTION[/COLOR] DlgProc() [COLOR=#0000FF]AS LONG[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR]  pUserInfo   [COLOR=#0000FF]AS[/COLOR] WKSTA_USER_INFO_1 [COLOR=#0000FF]POINTER[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR]  pMinMaxInfo [COLOR=#0000FF]AS[/COLOR] [COLOR=#009CFF][B]MINMAXINFO[/B][/COLOR] [COLOR=#0000FF]POINTER[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR]  zUserName   [COLOR=#0000FF]AS ASCIIZ[/COLOR] * [COLOR=#8000FF]%UNLEN[/COLOR]
     [COLOR=#0000FF]STATIC[/COLOR] sServer     [COLOR=#0000FF]AS STRING[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR]  TryLoggedOn [COLOR=#0000FF]AS LONG[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR]  Retval      [COLOR=#0000FF]AS LONG[/COLOR]
     
     [COLOR=#0000FF]SELECT CASE CBMSG[/COLOR]
     
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%WM_INITDIALOG[/COLOR]
         [B][I][COLOR=#008080]'NetWkstaUserGetInfo returns information about the currently logged-on user.[/COLOR][/I][/B]
         [B][I][COLOR=#008080]'This function must be called in the context of the logged-on user.[/COLOR][/I][/B]
         Retval = [COLOR=#009CFF][B]NetWkstaUserGetInfo[/B][/COLOR]([COLOR=#0000FF]BYVAL[/COLOR] [COLOR=#8000FF]%NULL[/COLOR], [COLOR=#0000FF]BYVAL[/COLOR] [COLOR=#FF0000]1[/COLOR], [COLOR=#0000FF]BYVAL VARPTR[/COLOR](pUserInfo))
         [COLOR=#0000FF]CONTROL SET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%TextboxDomain[/COLOR], pUnicodeToAnsi(@pUserInfo.wkui1_logon_domain)
         [COLOR=#0000FF]CONTROL SET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%TextboxPdc[/COLOR], PdcGet([COLOR=#800040]""[/COLOR], [COLOR=#800040]""[/COLOR])
         sServer = pUnicodeToAnsi(@pUserInfo.wkui1_logon_server)
         [COLOR=#0000FF]IF LEFT$[/COLOR](sServer, [COLOR=#FF0000]2[/COLOR]) <> [COLOR=#800040]"\\"[/COLOR] [COLOR=#0000FF]THEN[/COLOR] sServer = [COLOR=#800040]"\\"[/COLOR] & sServer
         [COLOR=#0000FF]CONTROL SET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%TextboxLoggedon[/COLOR], sServer
     
         [COLOR=#009CFF][B]GetUserName[/B][/COLOR] zUserName, [COLOR=#8000FF]%UNLEN[/COLOR]
         [COLOR=#0000FF]CONTROL SET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%TextboxUsername[/COLOR], zUserName
     
         [COLOR=#0000FF]DIM[/COLOR] TabLen([COLOR=#FF0000]0[/COLOR] [COLOR=#0000FF]TO[/COLOR] [COLOR=#FF0000]2[/COLOR]) [COLOR=#0000FF]AS DWORD[/COLOR]
         TabLen([COLOR=#FF0000]0[/COLOR]) = [COLOR=#FF0000]25[/COLOR]
         TabLen([COLOR=#FF0000]1[/COLOR]) = [COLOR=#FF0000]130[/COLOR]
         TabLen([COLOR=#FF0000]2[/COLOR]) = [COLOR=#FF0000]330[/COLOR]
         [COLOR=#0000FF]CONTROL SEND[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#8000FF]%LB_SETTABSTOPS[/COLOR], [COLOR=#FF0000]3[/COLOR], [COLOR=#0000FF]VARPTR[/COLOR](TabLen([COLOR=#FF0000]0[/COLOR]))
         [COLOR=#0000FF]CONTROL SEND[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#8000FF]%LB_SETHORIZONTALEXTENT[/COLOR], [COLOR=#FF0000]1500[/COLOR], [COLOR=#FF0000]0[/COLOR]
     
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%WM_COMMAND[/COLOR]
         [COLOR=#0000FF]SELECT CASE CBCTL[/COLOR]
     
           [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%ButtonUser[/COLOR], [COLOR=#8000FF]%ButtonGroup[/COLOR], [COLOR=#8000FF]%ButtonMachine[/COLOR]
             [COLOR=#0000FF]IF CBCTLMSG[/COLOR] = [COLOR=#8000FF]%BN_CLICKED[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
               [COLOR=#0000FF]LISTBOX RESET CBHNDL[/COLOR], [COLOR=#8000FF]%ListboxUser[/COLOR]
               sServer = [COLOR=#800040]""[/COLOR]
               [COLOR=#0000FF]CONTROL GET CHECK CBHNDL[/COLOR], [COLOR=#8000FF]%CheckboxLoggedon[/COLOR] [COLOR=#0000FF]TO[/COLOR] TryLoggedOn
               [COLOR=#0000FF]IF[/COLOR] TryLoggedOn [COLOR=#0000FF]THEN[/COLOR]
                 [COLOR=#0000FF]CONTROL GET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%TextboxLoggedon[/COLOR] [COLOR=#0000FF]TO[/COLOR] sServer
               [COLOR=#0000FF]ELSE[/COLOR]
                 [COLOR=#0000FF]CONTROL GET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%TextboxPdc[/COLOR] [COLOR=#0000FF]TO[/COLOR] sServer
               [COLOR=#0000FF]END IF[/COLOR]
               [COLOR=#0000FF]CONTROL SET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%StatusBar[/COLOR], [COLOR=#800040]"Please wait..."[/COLOR]
               [COLOR=#0000FF]MOUSEPTR[/COLOR] [COLOR=#FF0000]11[/COLOR] [B][I][COLOR=#008080]'HourGlass[/COLOR][/I][/B]
               [COLOR=#0000FF]CONTROL DISABLE CBHNDL[/COLOR], [COLOR=#8000FF]%ButtonUser[/COLOR]
               [COLOR=#0000FF]CONTROL DISABLE CBHNDL[/COLOR], [COLOR=#8000FF]%ButtonGroup[/COLOR]
               [COLOR=#0000FF]CONTROL DISABLE CBHNDL[/COLOR], [COLOR=#8000FF]%ButtonMachine[/COLOR]
               [COLOR=#0000FF]IF LEN[/COLOR](sServer) [COLOR=#0000FF]THEN[/COLOR]
                 [COLOR=#0000FF]SELECT CASE CBCTL[/COLOR]
     
                   [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%ButtonUser[/COLOR]
                     NetQuery sServer, [COLOR=#8000FF]%User_Level[/COLOR]
                     [COLOR=#0000FF]CONTROL SET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%StatusBar[/COLOR], [COLOR=#800040]"Domain User info"[/COLOR]
     
                   [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%ButtonMachine[/COLOR]
                     NetQuery sServer, [COLOR=#8000FF]%Machine_Level[/COLOR]
                     [COLOR=#0000FF]CONTROL SET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%StatusBar[/COLOR], [COLOR=#800040]"Domain Machine info"[/COLOR]
     
                   [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%ButtonGroup[/COLOR]
                     NetQuery sServer, [COLOR=#8000FF]%Group_Level[/COLOR]
                     [COLOR=#0000FF]CONTROL SET TEXT CBHNDL[/COLOR], [COLOR=#8000FF]%StatusBar[/COLOR], [COLOR=#800040]"Domain Group info"[/COLOR]
     
                 [COLOR=#0000FF]END SELECT[/COLOR]
               [COLOR=#0000FF]ELSE[/COLOR]
                 [COLOR=#0000FF]IF[/COLOR] TryLoggedOn [COLOR=#0000FF]THEN[/COLOR]
                   [COLOR=#0000FF]LISTBOX ADD[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#800040]"LoggedOn field is empty !"[/COLOR]
                 [COLOR=#0000FF]ELSE[/COLOR]
                   [COLOR=#0000FF]LISTBOX ADD[/COLOR] hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], [COLOR=#800040]"PDC field is empty !"[/COLOR]
                 [COLOR=#0000FF]END IF[/COLOR]
               [COLOR=#0000FF]END IF[/COLOR]
               [COLOR=#0000FF]CONTROL ENABLE CBHNDL[/COLOR], [COLOR=#8000FF]%ButtonUser[/COLOR]
               [COLOR=#0000FF]CONTROL ENABLE CBHNDL[/COLOR], [COLOR=#8000FF]%ButtonGroup[/COLOR]
               [COLOR=#0000FF]CONTROL ENABLE CBHNDL[/COLOR], [COLOR=#8000FF]%ButtonMachine[/COLOR]
               [COLOR=#0000FF]MOUSEPTR[/COLOR] [COLOR=#FF0000]1[/COLOR] [B][I][COLOR=#008080]'Arrow[/COLOR][/I][/B]
             [COLOR=#0000FF]END IF[/COLOR]
     
           [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%CheckboxPdc[/COLOR]
             [COLOR=#0000FF]IF CBCTLMSG[/COLOR] = [COLOR=#8000FF]%BN_CLICKED[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
               [COLOR=#0000FF]CONTROL ENABLE[/COLOR] hDlg, [COLOR=#8000FF]%TextboxPdc[/COLOR]
               [COLOR=#0000FF]CONTROL DISABLE[/COLOR] hDlg, [COLOR=#8000FF]%TextboxLoggedon[/COLOR]
             [COLOR=#0000FF]END IF[/COLOR]
     
           [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%CheckboxLoggedon[/COLOR]
             [COLOR=#0000FF]IF CBCTLMSG[/COLOR] = [COLOR=#8000FF]%BN_CLICKED[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
               [COLOR=#0000FF]CONTROL DISABLE[/COLOR] hDlg, [COLOR=#8000FF]%TextboxPdc[/COLOR]
               [COLOR=#0000FF]CONTROL ENABLE[/COLOR] hDlg, [COLOR=#8000FF]%TextboxLoggedon[/COLOR]
             [COLOR=#0000FF]END IF[/COLOR]
     
           [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%ButtonExit[/COLOR]
             [COLOR=#0000FF]IF CBCTLMSG[/COLOR] = [COLOR=#8000FF]%BN_CLICKED[/COLOR] [COLOR=#0000FF]THEN[/COLOR]
               [COLOR=#0000FF]DIALOG END CBHNDL[/COLOR], [COLOR=#FF0000]0[/COLOR]
             [COLOR=#0000FF]END IF[/COLOR]
     
         [COLOR=#0000FF]END SELECT[/COLOR]
     
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%WM_SIZE[/COLOR]
         [COLOR=#009CFF][B]MoveWindow[/B][/COLOR]([COLOR=#009CFF][B]GetDlgItem[/B][/COLOR]([COLOR=#0000FF]CBHNDL[/COLOR], [COLOR=#8000FF]%ListboxUser[/COLOR]), [COLOR=#FF0000]5[/COLOR], [COLOR=#FF0000]145[/COLOR], _
                    [COLOR=#0000FF]LOWRD[/COLOR]([COLOR=#0000FF]CBLPARAM[/COLOR]) - [COLOR=#FF0000]10[/COLOR], [COLOR=#0000FF]HIWRD[/COLOR]([COLOR=#0000FF]CBLPARAM[/COLOR]) - [COLOR=#FF0000]170[/COLOR], [COLOR=#8000FF]%TRUE[/COLOR])
         [COLOR=#009CFF][B]SendMessage[/B][/COLOR]([COLOR=#009CFF][B]GetDlgItem[/B][/COLOR]([COLOR=#0000FF]CBHNDL[/COLOR], [COLOR=#8000FF]%StatusBar[/COLOR]), [COLOR=#0000FF]CBMSG[/COLOR], [COLOR=#0000FF]CBWPARAM[/COLOR], [COLOR=#0000FF]CBLPARAM[/COLOR])
     
       [COLOR=#0000FF]CASE[/COLOR] [COLOR=#8000FF]%WM_GETMINMAXINFO[/COLOR]
         pMinMaxInfo = [COLOR=#0000FF]CBLPARAM[/COLOR]
         [COLOR=#0000FF]DIALOG UNITS CBHNDL[/COLOR], [COLOR=#FF0000]285[/COLOR], [COLOR=#FF0000]200[/COLOR] [COLOR=#0000FF]TO PIXELS[/COLOR] @pMinMaxInfo.ptMinTrackSize.x, _
                                                 @pMinMaxInfo.ptMinTrackSize.y
     [COLOR=#0000FF]END SELECT[/COLOR]
     
    [COLOR=#0000FF]END FUNCTION[/COLOR]
    [B][I][COLOR=#008080]'______________________________________________________________________________[/COLOR][/I][/B]
     
    [COLOR=#0000FF]FUNCTION WINMAIN[/COLOR]([COLOR=#0000FF]BYVAL[/COLOR] hInst [COLOR=#0000FF]AS DWORD[/COLOR], [COLOR=#0000FF]BYVAL[/COLOR] hPrevInstance [COLOR=#0000FF]AS DWORD[/COLOR], _
                     [COLOR=#0000FF]BYVAL[/COLOR] lpszCmdLine [COLOR=#0000FF]AS ASCIIZ PTR[/COLOR], [COLOR=#0000FF]BYVAL[/COLOR] nCmdShow [COLOR=#0000FF]AS LONG[/COLOR]) [COLOR=#0000FF]AS LONG[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] hIconBig   [COLOR=#0000FF]AS DWORD[/COLOR]
     [COLOR=#0000FF]LOCAL[/COLOR] hIconSmall [COLOR=#0000FF]AS DWORD[/COLOR]
     
     [COLOR=#0000FF]DIALOG NEW[/COLOR] [COLOR=#8000FF]%HWND_DESKTOP[/COLOR], [COLOR=#800040]"NetQueryDisplayInformation"[/COLOR], , , [COLOR=#FF0000]400[/COLOR], [COLOR=#FF0000]250[/COLOR], _
                [COLOR=#8000FF]%WS_POPUP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_CLIPSIBLINGS[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_CAPTION[/COLOR] [COLOR=#0000FF]OR[/COLOR] _
                [COLOR=#8000FF]%WS_SYSMENU[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_THICKFRAME[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_MINIMIZEBOX[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_MAXIMIZEBOX[/COLOR] [COLOR=#0000FF]OR[/COLOR] _
                [COLOR=#8000FF]%DS_3DLOOK[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%DS_NOFAILCREATE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%DS_SETFONT[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%DS_MODALFRAME[/COLOR], _
                [COLOR=#8000FF]%WS_EX_DLGMODALFRAME[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_EX_CONTROLPARENT[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_EX_CLIENTEDGE[/COLOR] [COLOR=#0000FF]OR[/COLOR] _
                [COLOR=#8000FF]%WS_EX_WINDOWEDGE[/COLOR] [COLOR=#0000FF]TO[/COLOR] hDlg
     
     [COLOR=#009CFF][B]ExtractIconEx[/B][/COLOR]([COLOR=#800040]"mstsc.exe"[/COLOR], [COLOR=#FF0000]1[/COLOR], [COLOR=#0000FF]BYVAL VARPTR[/COLOR](hIconBig), [COLOR=#0000FF]BYVAL VARPTR[/COLOR](hIconSmall), [COLOR=#FF0000]1[/COLOR])
     [COLOR=#009CFF][B]SetClassLong[/B][/COLOR](hDlg, [COLOR=#8000FF]%GCL_HICONSM[/COLOR], hIconSmall) [B][I][COLOR=#008080]'Set an icon[/COLOR][/I][/B]
     [COLOR=#009CFF][B]SetClassLong[/B][/COLOR](hDlg, [COLOR=#8000FF]%GCL_HICON[/COLOR], hIconBig) [B][I][COLOR=#008080]'Set an icon[/COLOR][/I][/B]
     [COLOR=#009CFF][B]SendMessage[/B][/COLOR](hDlg, [COLOR=#8000FF]%WM_SETICON[/COLOR], [COLOR=#8000FF]%ICON_SMALL[/COLOR], hIconSmall)
     [COLOR=#009CFF][B]SendMessage[/B][/COLOR](hDlg, [COLOR=#8000FF]%WM_SETICON[/COLOR], [COLOR=#8000FF]%ICON_BIG[/COLOR], hIconBig)
     
     [COLOR=#0000FF]CONTROL ADD LABEL[/COLOR], hDlg, [COLOR=#8000FF]%LabelDomain[/COLOR], [COLOR=#800040]"Domain"[/COLOR], [COLOR=#FF0000]10[/COLOR], [COLOR=#FF0000]10[/COLOR], [COLOR=#FF0000]45[/COLOR], [COLOR=#FF0000]15[/COLOR], [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD LABEL[/COLOR], hDlg, [COLOR=#8000FF]%LabelPdc[/COLOR], [COLOR=#800040]"PDC"[/COLOR], [COLOR=#FF0000]10[/COLOR], [COLOR=#FF0000]30[/COLOR], [COLOR=#FF0000]45[/COLOR], [COLOR=#FF0000]15[/COLOR], [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD LABEL[/COLOR], hDlg, [COLOR=#8000FF]%LabelUsername[/COLOR], [COLOR=#800040]"UserName"[/COLOR], [COLOR=#FF0000]10[/COLOR], [COLOR=#FF0000]70[/COLOR], [COLOR=#FF0000]45[/COLOR], [COLOR=#FF0000]15[/COLOR], [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD LABEL[/COLOR], hDlg, [COLOR=#8000FF]%LabelLoggedon[/COLOR], [COLOR=#800040]"Logged on"[/COLOR], [COLOR=#FF0000]10[/COLOR], [COLOR=#FF0000]50[/COLOR], [COLOR=#FF0000]45[/COLOR], [COLOR=#FF0000]15[/COLOR], [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD TEXTBOX[/COLOR], hDlg, [COLOR=#8000FF]%TextboxDomain[/COLOR], [COLOR=#800040]"Domain"[/COLOR], [COLOR=#FF0000]55[/COLOR], [COLOR=#FF0000]5[/COLOR], [COLOR=#FF0000]140[/COLOR], [COLOR=#FF0000]15[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%ES_AUTOHSCROLL[/COLOR], [COLOR=#8000FF]%WS_EX_CLIENTEDGE[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD TEXTBOX[/COLOR], hDlg, [COLOR=#8000FF]%TextboxPdc[/COLOR], [COLOR=#800040]"PDC"[/COLOR], [COLOR=#FF0000]55[/COLOR], [COLOR=#FF0000]25[/COLOR], [COLOR=#FF0000]140[/COLOR], [COLOR=#FF0000]15[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%ES_AUTOHSCROLL[/COLOR], [COLOR=#8000FF]%WS_EX_CLIENTEDGE[/COLOR]
     [COLOR=#0000FF]CONTROL DISABLE[/COLOR] hDlg, [COLOR=#8000FF]%TextboxPdc[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD TEXTBOX[/COLOR], hDlg, [COLOR=#8000FF]%TextboxLoggedon[/COLOR], [COLOR=#800040]"Logged on"[/COLOR], [COLOR=#FF0000]55[/COLOR], [COLOR=#FF0000]45[/COLOR], [COLOR=#FF0000]140[/COLOR], [COLOR=#FF0000]15[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%ES_AUTOHSCROLL[/COLOR], [COLOR=#8000FF]%WS_EX_CLIENTEDGE[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD TEXTBOX[/COLOR], hDlg, [COLOR=#8000FF]%TextboxUsername[/COLOR], [COLOR=#800040]"UserName"[/COLOR], [COLOR=#FF0000]55[/COLOR], [COLOR=#FF0000]65[/COLOR], [COLOR=#FF0000]140[/COLOR], [COLOR=#FF0000]15[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%ES_AUTOHSCROLL[/COLOR], [COLOR=#8000FF]%WS_EX_CLIENTEDGE[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD OPTION[/COLOR], hDlg, [COLOR=#8000FF]%CheckboxPdc[/COLOR], [COLOR=#800040]"Use PDC"[/COLOR], [COLOR=#FF0000]210[/COLOR], [COLOR=#FF0000]25[/COLOR], [COLOR=#FF0000]60[/COLOR], [COLOR=#FF0000]20[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD OPTION[/COLOR], hDlg, [COLOR=#8000FF]%CheckboxLoggedon[/COLOR], [COLOR=#800040]"Use server"[/COLOR], [COLOR=#FF0000]210[/COLOR], [COLOR=#FF0000]45[/COLOR], [COLOR=#FF0000]60[/COLOR], [COLOR=#FF0000]20[/COLOR]
     
     [COLOR=#0000FF]CONTROL SET OPTION[/COLOR] hDlg, [COLOR=#8000FF]%CheckboxLoggedon[/COLOR], [COLOR=#8000FF]%CheckboxPdc[/COLOR], [COLOR=#8000FF]%CheckboxLoggedon[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD BUTTON[/COLOR], hDlg, [COLOR=#8000FF]%ButtonUser[/COLOR], [COLOR=#800040]"Get user"[/COLOR], [COLOR=#FF0000]330[/COLOR], [COLOR=#FF0000]5[/COLOR], [COLOR=#FF0000]60[/COLOR], [COLOR=#FF0000]15[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%BS_CENTER[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%BS_VCENTER[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD BUTTON[/COLOR], hDlg, [COLOR=#8000FF]%ButtonMachine[/COLOR], [COLOR=#800040]"Get machine"[/COLOR], [COLOR=#FF0000]330[/COLOR], [COLOR=#FF0000]25[/COLOR], [COLOR=#FF0000]60[/COLOR], [COLOR=#FF0000]15[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%BS_CENTER[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%BS_VCENTER[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD BUTTON[/COLOR], hDlg, [COLOR=#8000FF]%ButtonGroup[/COLOR], [COLOR=#800040]"Get group"[/COLOR], [COLOR=#FF0000]330[/COLOR], [COLOR=#FF0000]45[/COLOR], [COLOR=#FF0000]60[/COLOR], [COLOR=#FF0000]15[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%BS_CENTER[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%BS_VCENTER[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD BUTTON[/COLOR], hDlg, [COLOR=#8000FF]%ButtonExit[/COLOR], [COLOR=#800040]"Exit"[/COLOR], [COLOR=#FF0000]330[/COLOR], [COLOR=#FF0000]65[/COLOR], [COLOR=#FF0000]60[/COLOR], [COLOR=#FF0000]15[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%BS_CENTER[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%BS_VCENTER[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD LISTBOX[/COLOR], hDlg, [COLOR=#8000FF]%ListboxUser[/COLOR], , [COLOR=#FF0000]5[/COLOR], [COLOR=#FF0000]95[/COLOR], [COLOR=#FF0000]335[/COLOR], [COLOR=#FF0000]236[/COLOR], _
                 [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_BORDER[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VSCROLL[/COLOR] [COLOR=#0000FF]OR[/COLOR] _
                 [COLOR=#8000FF]%WS_TABSTOP[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%LBS_NOTIFY[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%Lbs_UseTabStops[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_HSCROLL[/COLOR] _
                 [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%LBS_NOINTEGRALHEIGHT[/COLOR], [COLOR=#8000FF]%WS_EX_CLIENTEDGE[/COLOR]
     
     [COLOR=#0000FF]CONTROL ADD[/COLOR] [COLOR=#800040]"MsCtls_StatusBar32"[/COLOR], hDlg, [COLOR=#8000FF]%Statusbar[/COLOR],[COLOR=#800040]"NetQueryDisplayInformation"[/COLOR],_
                 [COLOR=#8000FF]%NULL[/COLOR],[COLOR=#8000FF]%NULL[/COLOR],[COLOR=#8000FF]%NULL[/COLOR],[COLOR=#8000FF]%NULL[/COLOR], [COLOR=#8000FF]%WS_CHILD[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_CLIPSIBLINGS[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%WS_VISIBLE[/COLOR] [COLOR=#0000FF]OR[/COLOR] [COLOR=#8000FF]%SBS_SIZEGRIP[/COLOR]
     
     [COLOR=#0000FF]DIALOG SHOW MODAL[/COLOR] hDlg, [COLOR=#0000FF]CALL[/COLOR] DlgProc
     
     [COLOR=#009CFF][B]DestroyIcon[/B][/COLOR](hIconSmall)
     [COLOR=#009CFF][B]DestroyIcon[/B][/COLOR](hIconBig)
     
    [COLOR=#0000FF]END FUNCTION[/COLOR]
    [B][I][COLOR=#008080]'______________________________________________________________________________
    '[/COLOR][/I][/B]
    Last edited by Pierre Bellisle; 5 May 2016, 03:06 PM.
Working...
X