Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-19-2006, 11:54 AM
Junior Member
 
Join Date: Aug 2006
Posts: 10
Default Detecting windows users

Is there any way to detect windows users in swfkit and then listing them so that the program user can choose from them?

Edit: So, no one knows?
Maybe no one understands the question...

I'm wondering if swfkit can show all the users on a pc with Windows XP and if it then can put this data in a list. Is this possible?
Reply With Quote
  #2 (permalink)  
Old 08-24-2006, 02:08 PM
Junior Member
 
Join Date: Aug 2006
Posts: 10
Default Re:Detecting windows users

nobody knows hah
Reply With Quote
  #3 (permalink)  
Old 08-28-2006, 12:31 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Detecting windows users

This can be done by calling windows api directly in swfkit pro 3. We will build a sample for you.
Reply With Quote
  #4 (permalink)  
Old 08-28-2006, 02:34 PM
Junior Member
 
Join Date: Aug 2006
Posts: 10
Default Re:Detecting windows users

Thank you
Reply With Quote
  #5 (permalink)  
Old 09-05-2006, 03:52 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Detecting windows users

The following code can only work in SWFKit Pro 3
Code:
dllimport "netapi32.dll" stdcall long NetQueryDisplayInformation(
short*, unsigned int, unsigned int, unsigned int,
unsigned int, unsigned int*, int*) as netQInfo;

dllimport "netapi32.dll" stdcall long NetApiBufferFree(pointer) as netFree;
// WIN API constants
ERROR_SUCCESS = 0;
ERROR_MORE_DATA = 234;


var i = 0;
do // begin do
{ 
//
// Call the NetQueryDisplayInformation function;
//   specify information level 1 (user account information).
//
// dwRec is used to receive the number of user information
var dwRec = new Object;
dwRec.value = 0;
// pBuff is used to receive a pointer
var pBuff = new Object;
pBuff.value = 0;

res = netQInfo(null, 1, i, 1000, 0xFFFFFFFF, dwRec, pBuff);
  //
  // If the call succeeds,
  //
  if (res == ERROR_SUCCESS || res == ERROR_MORE_DATA)
  {
  // The count variable contains the count of the user information
  // returned by the above call
  var count = dwRec.value;
  // The data variable is a stringstream that contains a list of 
  // user information. The size of each user information
  // is 24. The structure of the user information is shown as follows
  /*
struct {
  short*usri1_name;
  short*usri1_comment;
  unsigned longusri1_flags;
  short*usri1_full_name;
  unsigned longusri1_user_id;
  unsigned longusri1_next_index;
} NET_DISPLAY_USER;
*/
  var data = Dll.getPointerValue(pBuff.value, 24 * count);
  
     for (var j = count; j > 0; j--)
     {
        //
        // Print the retrieved group information.
        //
        
        // read usri1_name
        var pusri1_name = data.getLong();
        var username = Dll.getPointerWideStringValue(pusri1_name);
        trace("username: ", username);
        // read usri1_comment
        var pusri1_comment = data.getLong();
        var comment = Dll.getPointerWideStringValue(pusri1_comment);
        trace("comment: ", comment);
        // read usri1_flags
        data.getLong();
        // read usri1_full_name
        var pusri1_full_name = data.getLong();
        var fullname = Dll.getPointerWideStringValue(pusri1_full_name);
        trace("full name: ", fullname);
        // read usri1_user_id
        data.getLong();
        // read usri1_next_index
        i = data.getLong();
     }
    //
    // Free the allocated memory.
    //
    netFree(pBuff.value);
  }
  else 
  {
  trace("Error");
  }
     
//
// Continue while there is more data.
//
} while (res == ERROR_MORE_DATA);
Reply With Quote
  #6 (permalink)  
Old 09-05-2006, 06:20 AM
Junior Member
 
Join Date: Aug 2006
Posts: 10
Default Re:Detecting windows users

Thanx ;D I'm going to test the code as soon as my computer with swfkit works (which should be today)
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:50 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.