Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2002.04.29;
Скачать: [xml.tar.bz2];

Вниз

хуки и shellproc   Найти похожие ветки 

 
Raptor   (2002-02-24 16:08) [2]

Кто-нибудь точно знает. ;-))
Например хелп.
Открываем его и читаем:

The ShellProc hook procedure is an application-defined or library-defined callback function used with the SetWindowsHookEx function. The function receives notifications of shell events from the system.

LRESULT CALLBACK ShellProc(
int nCode, // hook code
WPARAM wParam, // event-specific information
LPARAM lParam // event-specific information
);

Parameters
nCode
Specifies the hook code. This parameter can be one of the following values. Value Meaning
HSHELL_ACCESSIBILITYSTATE Windows NT 5.0 and later: The accessibility state has changed.
HSHELL_ACTIVATESHELLWINDOW The shell should activate its main window.
HSHELL_GETMINRECT A window is being minimized or maximized. The system needs the coordinates of the minimized rectangle for the window.
HSHELL_LANGUAGE Keyboard language was changed or a new keyboard layout was loaded.
HSHELL_REDRAW The title of a window in the task bar has been redrawn.
HSHELL_TASKMAN The user has selected the task list. A shell application that provides a task list should return TRUE to prevent Windows from starting its task list.
HSHELL_WINDOWACTIVATED The activation has changed to a different top-level, unowned window.
HSHELL_WINDOWCREATED A top-level, unowned window has been created. The window exists when the system calls a ShellProc function.
HSHELL_WINDOWDESTROYED A top-level, unowned window is about to be destroyed. The window still exists when the system calls a ShellProc function.

If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx.

wParam
The value depends on the value of the nCode parameter, as shown in the following table. nCode wParam
HSHELL_ACCESSIBILITYSTATE Indicates which accessibility feature has changed state. This value is one of the following: ACCESS_FILTERKEYS, ACCESS_MOUSEKEYS, or ACCESS_STICKYKEYS.
HSHELL_GETMINRECT Handle to the minimized or maximized window.
HSHELL_LANGUAGE Handle to the window.
HSHELL_REDRAW Handle to the redrawn window.
HSHELL_WINDOWACTIVATED Handle to the activated window.
HSHELL_WINDOWCREATED Handle to the created window.
HSHELL_WINDOWDESTROYED Handle to the destroyed window.

lParam
The value depends on the value of the nCode parameter, as shown in the following table. nCode lParam
HSHELL_GETMINRECT Pointer to aRECT structure.
HSHELL_LANGUAGE Handle to a keyboard layout.
HSHELL_REDRAW The value is TRUE if the window is flashing, or FALSE otherwise.
HSHELL_WINDOWACTIVATED The value is TRUE if the window is in full-screen mode, or FALSE otherwise.


Из этого следует, что в wParam, при nCode=HSHELL_WINDOWCREATED мы имеем хендл сотворенного окна. Ну вот его и посылай своей проге, которая, имея хендл, при помощи GetClassName может получить класс окна.
Вместо этого ты почему-то отсылаешь ей значение переменной I, а эта переменная, как видно из твоего кода
i:=HSHELL_WINDOWCREATED;
всегда равна константе (HSHELL_WINDOWCREATED - это константа).
Делай так:

SendMessage(FindWindow(PCHAR("TFORM1"),"MouseHook"), WM_USER+111,0 ,W);




Страницы: 1 вся ветка

Форум: "WinAPI";
Текущий архив: 2002.04.29;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.007 c
1-94518
asdf
2002-04-16 14:34
2002.04.29
Признак работы Delphi


3-94278
Malyatko
2002-04-08 12:48
2002.04.29
Добавление в базу данных.


3-94326
Герман63
2002-04-09 15:02
2002.04.29
MS Access


14-94539
kaif
2002-03-21 00:05
2002.04.29
Как купить D5 Pro?


4-94611
Velocity
2002-02-23 09:09
2002.04.29
CheckBox на WinAPI





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский