Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

H4u32

@H4u32
About
Posts
60
Topics
25
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Regarding Property Page
    H H4u32

    I want to embed Rich Edit Text inside property page. I am using Rich Text Edit control for displaying License agreement. Please help me out. I stuck at this point. Any help would be greatly appreciated. Thanks H4u32

    C / C++ / MFC help

  • Regarding application expiration
    H H4u32

    Thank u to all. I really appreciate your help. I got a clue from all of your replies. Again thanks a lot to u all.

    C / C++ / MFC help

  • Regarding application expiration
    H H4u32

    I didn't get you in your previous reply. If you are asking what i am trying to accomplish is clear. I want to expire my application on particular date. but i can't use local time/date to check it as user may change its local time/date. That's why i am thinking of some other way. Please help me if u have some suggestions for me. Thanks

    C / C++ / MFC help

  • Regarding application expiration
    H H4u32

    yaa... I think you are right. Let me think over hoe to accomplish it. Thank you very much for your replies. Thanks

    C / C++ / MFC help

  • Regarding application expiration
    H H4u32

    Thanks for your reply. I also thought about the suggestion for getting global time from server till PC is connected to Internet that you have mentioned. But that's not my requirement. what could be the other way to do so?? As I told you that i need to expire it on particular date. Your suggestion would work if i need to expire it after number of days from its installation. Please help me out if you still have some suggestions. by the way thanks again for you reply. Thanks

    C / C++ / MFC help

  • Regarding application expiration
    H H4u32

    Hello all, I am building Win32 application. My requirement is to expire this application on a particular date let say for e.g. on 31 december, 2008. If i use system's local time then user will be able to run it by changing its date/time. So is there any way to get global time in my VC application. Please help me out in this situation. Any help would be greatly appreciated. Thanks

    C / C++ / MFC help

  • Regarding string conversion
    H H4u32

    Thank you all of you. I also got my solution However, Thanks a lot Regards, Hemang

    C / C++ / MFC help question

  • Regarding string conversion
    H H4u32

    char *subKey = GetLocalMachineName(); int nSize1 = MultiByteToWideChar(CP_ACP, 0, subKey, -1, NULL, 0); LPWSTR wSubKey = new WCHAR[nSize1]; MultiByteToWideChar(CP_ACP, 0, subKey, -1, wSubKey, nSize1); I have used above code. In above code function GetLocalMachineName() returns char * string which works correctly as i have debug it. what is the mistake in above code.. Please help me. Thanks

    C / C++ / MFC help question

  • Regarding string conversion
    H H4u32

    Hi all, I want to convert char* to unsigned short* string. How would i accomplish it?? Please give me some hint to make it work. it would be a great help to me. Thanks

    C / C++ / MFC help question

  • Regarding Auto Logon
    H H4u32

    Hi all, I want to enable Auto logon feature through my application. I got help for doing so manually from the below link. http://support.microsoft.com/kb/315231[^] But if i try to do it programmatically then i am not being succeeded in that. I made all three registry entries(AutoAdminLogon, DefaultUserName, DefaultPassword) correctly through programming as mentioned in manual steps in above link. If i do it manually it works. But somehow it is not happening. can anyone please throw some light on this? It would be a great help to me. Please help me out. Thanks Hemang

    C / C++ / MFC com windows-admin help question

  • Regarding Admin rights user
    H H4u32

    void ChangeUserPrivilege(LPWSTR csUser, DWORD csPrivilege) { NET_API_STATUS nStatus; USER_INFO_1 ui1005; DWORD dwLevel1005 = 1005; DWORD dwPrivilege = 0;; wchar_t *pswzUser = csUser; if(csPrivilege == 2) dwPrivilege = USER_PRIV_USER; ui1005.usri1_priv = dwPrivilege; nStatus = NetUserSetInfo(NULL,pswzUser,dwLevel1005,(LPBYTE)&ui1005,NULL); if(nStatus != NERR_Success) // MessageBox(hwnd, (LPCWSTR)"Failed", (LPCWSTR)"Test", NULL); fprintf(stderr, "NetUserGetinfo failed with error: %d\n", nStatus); } I am using above code to change admin rights user to limited rights user. Is it possible with this code. Thanks

    C / C++ / MFC help question

  • Regarding Admin rights user
    H H4u32

    It has returned error code 87. Having been referred to MSDN, i came to know that this error code indicates that one of the functions parameter is invalid. But i am not having an idea about which parameter i am passing wrong. Any clue?? Your help would be greatly appreciated. Thanks Hemang

    C / C++ / MFC help question

  • Regarding Admin rights user
    H H4u32

    Hi all, My reqirement is to change admin rights user to limited account user. I tried to change admin rights to limited user account using NetUserSetInfo(). But wasnt succeeded in that. so please help me out in this scenario. How would I accomplish it?? Any help would be greatly appreciated. Thanks. Hemang

    C / C++ / MFC help question

  • Regarding NetUserAdd
    H H4u32

    I am getting ERROR_INVALID_PARAMETER as return error code. Description of cod says that one of the functions parameters is invalid. Now i am not getting clue about whic parameter is wrong. can you please point me out now how to proceed in order to resolve it. You have helped me a lot. So thanks for it. Regards, Hemang

    C / C++ / MFC help question

  • Regarding NetUserAdd
    H H4u32

    Thanks for your reply. Now onwards, i look into documents before posting Thanks, Hemang

    C / C++ / MFC help question

  • Regarding NetUserAdd
    H H4u32

    I have console based appliacation. So i used following code to determine it. nStatus = NetUserSetInfo(NULL,pswzUser,dwLevel1005,(LPBYTE)&ui1005,NULL); if(nStatus != NERR_Success) fprintf(stderr, "NetUserSetInfo failed with error: %d\n", nStatus); And above code gives me following error. NetUserSetInfo failed with error: 87 Any suggestion. Please help me. Thanks, Hemang

    C / C++ / MFC help question

  • Regarding NetUserAdd
    H H4u32

    I am sending the code snippet that i am using to change account type from admin to limited/noraml user. The user that i am trying to restrict has been created as admin. her is the code int getAdminNumber(int argc, wchar_t *argv[], LPWSTR user) { DWORD dwLevel = 2; LPUSER_INFO_0 pBuf = NULL; LPUSER_INFO_2 pBuf2 = NULL; NET_API_STATUS nStatus; LPTSTR sStringSid = NULL; wprintf(L"\nCalling NetUserGetinfo with Servername=%s Username=%s Level=%d\n", argv[1], user, dwLevel); nStatus = NetUserGetInfo(argv[1], user, dwLevel, (LPBYTE *) & pBuf); if (nStatus == NERR_Success) { if (pBuf != NULL) { pBuf2 = (LPUSER_INFO_2) pBuf; wprintf(L"\tUser account name: %s\n", pBuf2->usri2_name); wprintf(L"\tPrivilege level: %d\n", pBuf2->usri2_priv); if (pBuf2->usri2_priv == 2) cnt++; if(strcmp((char *)pBuf2->usri2_name, (char *)user) ==0) ChangeUserPrivilege(pBuf2->usri2_name, pBuf2->usri2_priv); } } else fprintf(stderr, "NetUserGetinfo failed with error: %d\n", nStatus); return 0; } void ChangeUserPrivilege(LPWSTR csUser, DWORD csPrivilege) { NET_API_STATUS nStatus; USER_INFO_1005 ui1005; DWORD dwLevel1005 = 1005; DWORD dwPrivilege; wchar_t *pswzUser = csUser; if(csPrivilege == 2) dwPrivilege = USER_PRIV_USER; ui1005.usri1005_priv = dwPrivilege; nStatus = NetUserSetInfo(NULL,pswzUser,dwLevel1005,(LPBYTE)&ui1005,NULL); } I am not getting any error for above code but at the same time not getting desired output. Any help would be greatly appreciated. Thanks Hemang

    C / C++ / MFC help question

  • Regarding NetUserAdd
    H H4u32

    I apologize for such a vague post. I had tried to make it brief but was brief more than necessary. BTW i got solution for my previous vague post. My next problem is to change right of current user from administrator to limited user account . That is, i want to make current user from admin to limited account. I tried to do this with NetUserSetinfo(). But it is not working for my case. Hope for positive reply. Thanks, Hemang

    C / C++ / MFC help question

  • Regarding NetUserAdd
    H H4u32

    Hi all, I am creating Win32 application in which i need to create an account with administative privileges. I am able to create an account with normal user rights. But when i tried to create an account with administative privileges, it is giving error. So can't I create an account with admin rights directly?? Please help me out in this scenario. Any help would be greatly appreciated. Thanks Hemang

    C / C++ / MFC help question

  • Regarding Admin rights user
    H H4u32

    A bunch of thanks. I got a clue from your answer and also found solution for getting number of admin account from NetGetUserInfo. Thanks a lot again. Regards, Hemang

    C / C++ / MFC help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups