Russian Qt Forum
Май 05, 2024, 05:55 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1]   Вниз
  Печать  
Автор Тема: QT 3.3.4 + WinXP: Как получить имя текущего пользователя?  (Прочитано 4585 раз)
Alan
Гость
« : Ноябрь 03, 2005, 11:38 »

Как в Windows получить имя текущего пользователя  :oops:?
Примеры приветствуются   Улыбающийся
Записан
Admin
Administrator
Джедай : наставник для всех
*****
Offline Offline

Сообщений: 1988



Просмотр профиля
« Ответ #1 : Ноябрь 03, 2005, 13:22 »

во первых это к куте отношения не имеет

во вротых лезем в MSDN и видим

Цитировать
GetUserName
The GetUserName function retrieves the user name of the current thread. This is the name of the user currently logged onto the system.

BOOL GetUserName(
  LPTSTR lpBuffer,  // address of name buffer
  LPDWORD nSize     // address of size of name buffer
);
 
Parameters
lpBuffer
Pointer to the buffer to receive the null-terminated string containing the user's logon name. If this buffer is not large enough to contain the entire user name, the function fails. A buffer size of (UNLEN + 1) characters will hold the maximum length user name including the terminating null character. UNLEN is defined in LMCONS.H.
nSize
Pointer to a DWORD variable that, on input, specifies the maximum size, in characters, of the buffer specified by the lpBuffer parameter. If the function succeeds, the variable receives the number of characters copied to the buffer. If the buffer is not large enough, the function fails and the variable receives the required buffer size, in characters, including the terminating null character.
Записан
Alan
Гость
« Ответ #2 : Ноябрь 03, 2005, 13:40 »

Спасибо!!! Сейчас попробую.
Записан
Страниц: [1]   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.045 секунд. Запросов: 22.