Click here to Skip to main content
15,927,344 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ and HTML Pin
BlackDice9-Nov-04 3:11
BlackDice9-Nov-04 3:11 
GeneralPrivate dial-up connection Pin
mickeg8-Nov-04 21:15
mickeg8-Nov-04 21:15 
QuestionHow can I Distribute N rectangles into one rectangle in most appropriate manner? Pin
mfc_surfer8-Nov-04 19:59
mfc_surfer8-Nov-04 19:59 
AnswerRe: How can I Distribute N rectangles into one rectangle in most appropriate manner? Pin
BlackDice9-Nov-04 3:13
BlackDice9-Nov-04 3:13 
GeneralRe: How can I Distribute N rectangles into one rectangle in most appropriate manner? Pin
mfc_surfer9-Nov-04 18:33
mfc_surfer9-Nov-04 18:33 
GeneralRe: How can I Distribute N rectangles into one rectangle in most appropriate manner? Pin
mfc_surfer9-Nov-04 18:33
mfc_surfer9-Nov-04 18:33 
GeneralTo get current Login User name from within a service. Pin
e_prabhu8-Nov-04 19:53
e_prabhu8-Nov-04 19:53 
GeneralRe: To get current Login User name from within a service. Pin
vilmer8-Nov-04 21:21
vilmer8-Nov-04 21:21 
Hi,

you can try to access the windows register at
\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
and catch the value of Logon User Name key.

To do this use:

HKEY masterKey = HKEY_CURRENT_USER;
CString SubKey = "\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer";
HKEY hKey;

if (RegOpenKey(masterKey,SubKey,&hKey) == ERROR_SUCCESS)

char ValueName[1024]="";
DWORD dwValueNameSize=sizeof(ValueName);
DWORD dwType=REG_NONE;
BYTE Data[1024]="";
DWORD dwDataSize=sizeof(Data);
while (strcmpi(ValueName,"Logon User Name") != 0)
{
LONG Result=RegEnumValue(hKey, dwIndex, ValueName,
&dwValueNameSize, 0, &dwType, Data, &dwDataSize);
dwIndex++;
}

---

You will get the user logon on ValueName string

For furhter details see also

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regenumvalue.asp

GeneralRe: To get current Login User name from within a service. Pin
ThatsAlok8-Nov-04 22:36
ThatsAlok8-Nov-04 22:36 
GeneralRe: To get current Login User name from within a service. Pin
ThatsAlok8-Nov-04 22:36
ThatsAlok8-Nov-04 22:36 
GeneralRe: To get current Login User name from within a service. Pin
ThatsAlok8-Nov-04 22:39
ThatsAlok8-Nov-04 22:39 
GeneralRe: To get current Login User name from within a service. Pin
David Crow9-Nov-04 2:36
David Crow9-Nov-04 2:36 
GeneralRe: To get current Login User name from within a service. Pin
2249179-Nov-04 4:56
2249179-Nov-04 4:56 
GeneralInstallation and uninstallation application Pin
Rajesh_K_Sharma8-Nov-04 18:23
Rajesh_K_Sharma8-Nov-04 18:23 
GeneralRe: Installation and uninstallation application Pin
includeh109-Nov-04 2:06
includeh109-Nov-04 2:06 
GeneralHandling of resizing the view and controls for different screen resolutions Pin
ledallam8-Nov-04 17:23
ledallam8-Nov-04 17:23 
GeneralQuestion about random access file. Pin
momer8-Nov-04 16:45
momer8-Nov-04 16:45 
GeneralRe: Question about random access file. Pin
David Crow9-Nov-04 2:49
David Crow9-Nov-04 2:49 
QuestionHow to get the listbox multi-select item number and content Pin
RobertHuang8-Nov-04 15:58
RobertHuang8-Nov-04 15:58 
AnswerRe: How to get the listbox multi-select item number and content Pin
David Crow9-Nov-04 2:51
David Crow9-Nov-04 2:51 
GeneralC++ and Java Pin
asv8-Nov-04 14:55
asv8-Nov-04 14:55 
GeneralRe: C++ and Java Pin
jan larsen8-Nov-04 21:50
jan larsen8-Nov-04 21:50 
Generalconversion from Ascii to decimal... Pin
Ann668-Nov-04 14:33
sussAnn668-Nov-04 14:33 
GeneralRe: conversion from Ascii to decimal... Pin
Chris Losinger8-Nov-04 16:00
professionalChris Losinger8-Nov-04 16:00 
GeneralRe: conversion from Ascii to decimal... Pin
ThatsAlok8-Nov-04 18:21
ThatsAlok8-Nov-04 18:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.