dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: How to code the permissions for Windows?

  1. #1
    Join Date
    Aug 2002
    Posts
    681

    How to code the permissions for Windows?

    Hi, ALL,
    Looking at GTK, there is a GPermission class which has a nice properties - “allowed”, “can-acquire” and “can-release”.
    Those properties will help the developer create appropriate controls on the fly in order to get elevation or skip it if it was already entered/program running under the root privileges.
    The same set exist for OSX/Cocoa.

    Is something like this exist for Windows/WinAPI?
    Or everything here will have to be coded manually?

    Moreover - is there a way to get the elevation status? If the elevation dialog is shown and then escaped - can I get the result of that operation? Or it will have to be inside try/catch() block?

    Thank you.

  2. #2
    Join Date
    Aug 2002
    Posts
    681

    Re: How to code the permissions for Windows?

    Hi,
    I guess it is not possible on Windows.
    Since I tried to look for something like this and nobody replied to this thread.

    I mean if I want to acquire UAC status and provide the functionality based on that....

    Thank you.

  3. #3
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,422

    Re: How to code the permissions for Windows?

    I'm not aware of anything similar to what you are looking for in Windows. As a starter for Windows permissions, see https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx and referenced articles.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2017 (15.8.4)

  4. #4
    Join Date
    Aug 2002
    Posts
    681

    Re: How to code the permissions for Windows?

    Hi,
    Quote Originally Posted by 2kaud View Post
    I'm not aware of anything similar to what you are looking for in Windows. As a starter for Windows permissions, see https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx and referenced articles.
    Just curious - is there anything I can check for the UAC status? If I enter the proper credentials and hit "Enter"/click "OK" or hit "ESC"/click "Cancel"?

    Can I get a result of this dialog running?

    Also - are those things correspond to the UAC permissions?

    Thank you.

  5. #5
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,422

    Re: How to code the permissions for Windows?

    Just curious - is there anything I can check for the UAC status? If I enter the proper credentials and hit "Enter"/click "OK" or hit "ESC"/click "Cancel"?

    Can I get a result of this dialog running?
    Not that I know. The UAC dialog is created by a separate process running under a different secure windows desktop (not the usual default desktop window - the desktop used for the logon).

    You might find these articles of interest
    https://www.codeproject.com/Articles...finitive-Guide
    https://www.codeproject.com/articles...tory-level-che
    Last edited by 2kaud; January 12th, 2018 at 05:40 AM.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2017 (15.8.4)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)