{"id":99,"date":"2007-08-28T16:36:00","date_gmt":"2007-08-28T16:36:00","guid":{"rendered":"http:\/\/www.webmundi.com\/?p=99"},"modified":"2019-06-13T10:28:47","modified_gmt":"2019-06-13T13:28:47","slug":"obter-o-username-logado-no-windows","status":"publish","type":"post","link":"http:\/\/localhost\/cmswebmundicom\/desenvolvimento-de-sistemas\/delphi\/obter-o-username-logado-no-windows\/","title":{"rendered":"Obter o username logado no Windows"},"content":{"rendered":"
<\/p>\n
Esta fun\u00e7\u00e3o permite que atrav\u00e9s da rotina GetUserName da API do Windows seja poss\u00edvel recuperar o usu\u00e1rio (username) que se logou ao windows.<\/p>\n
function UsuarioLogado : string;
\nvar nsize: Cardinal;
\nUserName: string;
\nbegin
\nnsize := 25;
\nSetLength(UserName,nsize);
\nif GetUserName(PChar(UserName), nsize) then
\nbegin
\nSetLength(UserName,nsize-1);
\nResult := UserName;
\nend;
\nend;<\/p>\n","protected":false},"excerpt":{"rendered":"
Como obter o username logado no Windows em Delphi Esta fun\u00e7\u00e3o permite que atrav\u00e9s da rotina GetUserName da API…<\/p>\n","protected":false},"author":2,"featured_media":1445,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[9,13],"tags":[27,28,14],"class_list":["post-99","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-delphi","category-desenvolvimento-de-sistemas","tag-delphi","tag-desenvolvimento-de-sistemas","tag-programacao"],"yoast_head":"\n