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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 2 questions

2 questions

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TOMTEFAR
    wrote on last edited by
    #1

    Hello! I have 2 problems. 1) I have a context menu that are created within a program. The problem is that I can't access it through the contextmenu button on a keyboard. Is it possible to do that with a dynamic menu that is created in MainFrm? 2) How do I find the local administrator acounts from a program? We have an option in wich you can add UID and PW to the program to restrict its use. I would like it to always be accesible from the administrator account on the löocal computor. In other words I would like the program to automatically add the Admin acount. /Martin

    A 1 Reply Last reply
    0
    • T TOMTEFAR

      Hello! I have 2 problems. 1) I have a context menu that are created within a program. The problem is that I can't access it through the contextmenu button on a keyboard. Is it possible to do that with a dynamic menu that is created in MainFrm? 2) How do I find the local administrator acounts from a program? We have an option in wich you can add UID and PW to the program to restrict its use. I would like it to always be accesible from the administrator account on the löocal computor. In other words I would like the program to automatically add the Admin acount. /Martin

      A Offline
      A Offline
      Andreas Saurwein
      wrote on last edited by
      #2
      1. react on the WM_CONTEXTMENU message, or use the WM_RBUTTONUP message. 2) get the token and ::CheckTokenMembership(). Or use the lately documented IsUserAdmin() [or so], look up on MSDN.

      I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge

      T 1 Reply Last reply
      0
      • A Andreas Saurwein
        1. react on the WM_CONTEXTMENU message, or use the WM_RBUTTONUP message. 2) get the token and ::CheckTokenMembership(). Or use the lately documented IsUserAdmin() [or so], look up on MSDN.

        I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge

        T Offline
        T Offline
        TOMTEFAR
        wrote on last edited by
        #3

        The WM_CONTEXTMENU and WM_RBUTTONUP messages only respond to the mouse and I need it to respond to the context menu button on your keayboard. Anyways I found WM_KEYDOWN adn WM_CHAR to do that for me. CheckTokenMembership() only lets me check if the current user is an administrator. IsUserAdmin is a method on MSDN that does just that. I need to get the Administrator acount. Maby that is not possible... /Martin

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

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