На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
Обратите внимание:
1. Прежде чем начать новую тему или отправить сообщение, убедитесь, что вы не нарушаете правил форума!
2. Обязательно воспользуйтесь поиском. Возможно, Ваш вопрос уже обсуждали. Полезные ссылки приведены ниже.
3. Темы с просьбой выполнить какую-либо работу за автора в этом разделе не обсуждаются.
4. Используйте теги [ code=cpp ] ...текст программы... [ /code ] для выделения текста программы подсветкой.
5. Помните, здесь телепатов нет. Старайтесь формулировать свой вопрос максимально грамотно и чётко: Как правильно задавать вопросы
6. Запрещено отвечать в темы месячной и более давности без веских на то причин.

Полезные ссылки:
user posted image FAQ Сайта (C++) user posted image FAQ Форума user posted image Наши Исходники user posted image Поиск по Разделу user posted image MSDN Library Online (Windows Driver Kit) user posted image Google

Ваше мнение о модераторах: user posted image B.V.
Модераторы: B.V.
Страницы: (4) [1] 2 3 ... Последняя » все  ( Перейти к последнему сообщению )  
> Работа с процессами
    Помогите, пожалуйста:
    Как узнать title приложения (который отображается в CAD'е)
    Сообщение отредактировано: v4ng3r -
      1. GetModuleFileName()
      2. GetSecurityInfo()
        GetModuleFileName - получения имени exe, а мне нужно получить title проги, который отображается при нажатии на CAD. Такой тайтл задаётся, например, Application.title
        GetSecurityInfo - чё ето? Никогда не слышал. Расскажи поподробнее.
          Ну тогда WM_GETTEXT правда применительно к какому хэндлу тут прямо и не скажешь.. :(
            Попробую wm_gettext, у меня ещё вся ночь впереди и пара бутылочек пивца :)
            И ещё вопрос: а что это за GetSecurityInfo ?
              Не знаю как к этому отнесутся, но все же лови:
              ExpandedWrap disabled
                <br>GetSecurityInfo<br>The GetSecurityInfo function retrieves a copy of the security descriptor for an object specified by a handle. <br><br>DWORD GetSecurityInfo(<br>  HANDLE handle,     // handle to the object<br>  SE_OBJECT_TYPE ObjectType,<br>                     // type of object<br>  SECURITY_INFORMATION SecurityInfo, <br>                     // type of security information to retrieve<br>  PSID *ppsidOwner,  // receives a pointer to the owner SID<br>  PSID *ppsidGroup,  // receives a pointer to the primary group SID<br>  PACL *ppDacl,      // receives a pointer to the DACL<br>  PACL *ppSacl,      // receives a pointer to the SACL<br>  PSECURITY_DESCRIPTOR *ppSecurityDescriptor<br>                     // receives a pointer to the security descriptor<br>);<br> <br>Parameters<br>handle <br>A handle to the object from which to retrieve security information. <br>ObjectType <br>Specifies a value from the SE_OBJECT_TYPE enumeration that indicates the type of object named by the pObjectName parameter. <br>SecurityInfo <br>A set of SECURITY_INFORMATION bit flags that indicate the type of security information to retrieve. This parameter can be a combination of the following values. Value Meaning <br>OWNER_SECURITY_INFORMATION If this flag is set, the ppsidOwner parameter receives the security identifier (SID) of the object's owner. <br>GROUP_SECURITY_INFORMATION If this flag is set, the ppsidGroup parameter receives the SID of the object's primary group.  <br>DACL_SECURITY_INFORMATION If this flag is set, the ppDacl parameter receives the object's discretionary access-control list (DACL). <br>SACL_SECURITY_INFORMATION If this flag is set, the ppSacl parameter receives the object's system access-control list (SACL).. <br><br><br>ppsidOwner <br>Pointer to a variable that receives a pointer to the owner SID in the security descriptor returned in ppSecurityDescriptor. The returned pointer is valid only if you set the OWNER_SECURITY_INFORMATION flag. This parameter can be NULL if you do not need the owner SID. <br>ppsidGroup <br>Pointer to a variable that receives a pointer to the primary group SID in the returned security descriptor. The returned pointer is valid only if you set the GROUP_SECURITY_INFORMATION flag. This parameter can be NULL if you do not need the group SID. <br>ppDacl <br>Pointer to a variable that receives a pointer to the DACL in the returned security descriptor. The returned pointer is valid only if you set the DACL_SECURITY_INFORMATION flag. This parameter can be NULL if you do not need the DACL. <br>ppSacl <br>Pointer to a variable that receives a pointer to the SACL in the returned security descriptor. The returned pointer is valid only if you set the SACL_SECURITY_INFORMATION flag. This parameter can be NULL if you do not need the SACL. <br>ppSecurityDescriptor <br>Pointer to a variable that receives a pointer to the security descriptor of the object. You must call the LocalFree function to free the returned buffer. <br>Return Values<br>If the function succeeds, the return value is ERROR_SUCCESS.<br><br>If the function fails, the return value is a nonzero error code defined in WINERROR.H. <br><br>Remarks<br>If the ppsidOwner, ppsidGroup, ppDacl, ppSacl parameters are non-NULL, and the SecurityInfo parameter specifies that they be retrieved from the object, those parameters will point to the corresponding parameters in the security descriptor returned in ppSecurityDescriptor.<br><br>To read the owner, group, or DACL from the object's security descriptor, the calling process must have been granted READ_CONTROL access when the handle was opened. To get READ_CONTROL access, the caller must be the owner of the object or the object's DACL must grant the access.<br><br>To read the SACL from the security descriptor, the calling process must have been granted ACCESS_SYSTEM_SECURITY access when the handle was opened. The proper way to get this access is to enable the SE_SECURITY_NAME privilege in the caller's current token, open the handle for ACCESS_SYSTEM_SECURITY access, and then disable the privilege.<br><br>QuickInfo<br>  Windows NT: Requires version 4.0 or later.<br>  Windows: Unsupported.<br>  Windows CE: Unsupported.<br>  Header: Declared in aclapi.h.<br>  Import Library: Use advapi32.lib.<br><br>See Also<br>Windows NT 4.0 Access Control Overview, Windows NT 4.0 Access-Control Functions, ACL, GetNamedSecurityInfo, LocalFree, SE_OBJECT_TYPE, SECURITY_DESCRIPTOR, SECURITY_INFORMATION, SetNamedSecurityInfo, SetSecurityInfo, SID <br><br>
                Функция не пашет под win9x, чтоли? Если да, то не подходит... Но всё равно спасибо!
                А где ты нарыл такую инфу?
                Сообщение отредактировано: v4ng3r -
                  В WinSDK
                    Цитата V4ng3R<RnD>, 22.03.03, 15:08:08
                    Помогите, пожалуйста:
                    1. Как узнать title процесса (который отображается в списке по ctrl+alt+del)


                    GetWindowText
                      Цитата Vasya2000, 23.03.03, 13:39:18
                      GetWindowText

                      Совершенно неправильно. GetWindowText() может использоваться только применительно к окнам своего процесса.
                      Сообщение отредактировано: Song -
                        Странно, но тем не менее у меня применительно к любым окнам в системе возвращается tittle...
                          Цитата V4ng3R<RnD>, 23.03.03, 03:45:23

                          А где ты нарыл такую инфу?

                          MSDN
                            Подождите! Во-первых, GetWindowText() позволяет получить caption любого окна по его хэндлу. Во-вторых, для тех, кто в танке: мне нужно получить title ПРОЦЕССА, а НЕ окна. В-третьих в WinSDK я нашёл следущее:
                            ===============================================================
                            Get Application Title    

                            Copies the application title to the specified buffer.

                            mov  ah, 16h            ; Windows multiplex function
                            mov  al, 8Eh             ; VM Title
                            mov  di, seg AppTitle  ; see below
                            mov  es, di
                            mov  di, offset AppTitle
                            mov  cx, Size          ; see below
                            mov  dx, 2              ; Get Application Title
                            int  2Fh
                            cmp  ax, 1
                            je   success

                            Parameters

                            AppTitle
                            Address of a buffer that receives the application title. This parameter must not be zero.

                            Size
                            Size, in bytes, of the buffer pointed to by AppTitle.

                            Return Value
                            Returns 1 in the AX register if successful or zero otherwise.

                            Remarks

                            Get Application Title copies as much of the title as possible, but never more than the specified number of bytes. The function always appends a terminating null character to the title in the buffer.
                            =================================================================
                            Я понял, что это и есть искомый способ, но
                            КАК этим пользоваться ???
                            Сообщение отредактировано: v4ng3r -
                              Вообщем понятно чего тебе надо. Здесь зависит от того какая ОС.
                              Если W9x, тогда юзай ToolHelp ф-ии, там есть параметр exe файл
                              Если NT, тогда или EnumProcesses(), или сразу NTQuerySystemInformation() (EnumProcesses использует последнюю)
                              Что касается асма, надо сначала Ring0 получать, чтобы иметь доступ к таким областям, иначе AV.
                                У меня win98


                                Цитата Song, 23.03.03, 20:09:20
                                Если W9x, тогда юзай ToolHelp ф-ии, там есть параметр exe файл

                                Поподробнее, что за функции

                                Цитата Song, 23.03.03, 20:09:20
                                Что касается асма, надо сначала Ring0 получать, чтобы иметь доступ к таким областям, иначе AV.

                                Как юзать AV?
                                Сообщение отредактировано: v4ng3r -
                                0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
                                0 пользователей:


                                Рейтинг@Mail.ru
                                [ Script execution time: 0,0350 ]   [ 16 queries used ]   [ Generated: 2.05.24, 07:57 GMT ]