Windows api get text from window

There is some Win OS API call or so that would let one obtain text from the screen

not via obtaining a snapshot and then doing OCR on it, but via API

the idea is to get the text that is under the mouse that the user points to and clicks on.

This is how tools like Babylon (http://www.babylon.com) and 1-Click Answers (http://www.answers.com/main/download_answers_win.jsp) and many others work.

Can someone point me to the right direction to get this functionality?

Joris Schellekens's user avatar

asked Feb 5, 2009 at 7:59

bobi's user avatar

There is no direct way to obtain text. An application could render text in a zillion different ways (Windows API being one of them), and after it’s rendered — it’s just a bunch of pixels.

A method you could try however is to find the window directly under the mouse and trying to get the text from them. This would work fine on most standard Windows controls (labels, textboxes, etc.) Wouldn’t work on Internet browsers though.

I think the best you can do is make your application such that it supports as many different (common) controls as possible in the above described manner.

answered Feb 5, 2009 at 8:09

Vilx-'s user avatar

Vilx-Vilx-

105k87 gold badges279 silver badges422 bronze badges

You can get the text of every window with the GetWindowText API. The mouse position can be found with the GetCursorPos API.

In Delphi you could use this function (kudos to Peter Below)

Function ChildWindowUnderCursor: HWND;
Var
  hw, lasthw: HWND;
  pt, clientpt: TPoint;
Begin
  Result := 0;
  GetCursorPos( pt );
  // find top-level window under cursor
  hw := WindowFromPoint( pt );
  If hw = 0 Then Exit;

  // look for child windows in the window recursively
  // until we find no new windows
  Repeat
    lasthw := hw;
    clientpt := Pt;
    Windows.ScreenToClient( lasthw, clientpt );
    // Use ChildwindowfromPoint if app needs to run on NT 3.51!
    hw := ChildwindowFromPointEx( lasthw, clientpt, CWP_SKIPINVISIBLE );
  Until hw = lasthw;
  Result := hw;
End;

Regards,
Lieven

answered Feb 5, 2009 at 8:10

Lieven Keersmaekers's user avatar

Windows has APIs for accessibility tools like screen-readers for the blind. (Newer versions are also used for other purposes, like UI automation and testing.) It works with many applications, even most browsers which render their own content without using the standard Windows controls. It won’t work with all applications, but it can be used to figure out the text under the mouse in most cases.

The current API is called the Windows Automation API. Describing how to do this in general is beyond the scope of a Stack Overflow answer, so I’ve simply provided a link to the documentation.

The older API that was widely available when this question was first posted is called the Microsoft Active Accessibility API. As with the modern APIs, the scope here is too broad to detail here.

Note that documentation for both APIs is written both for both developers building accessibility tools (like screen readers) as well as for developers writing apps that want to be compatible with those accessibility tools.

The basic idea is that an accessibility tool gets COM interfaces provided by the target application’s window(s), and it can use those interfaces to figure out the controls and their text and how they’re related both logically and spatially. Applications that are composed of standard Windows controls are mostly automatically supported. Applications with custom UI implementations have to do work to provide these interfaces. Fortunately, the important ones, like the mainstream browsers, have done the work to support these interfaces.

answered Oct 27, 2017 at 23:18

Adrian McCarthy's user avatar

Adrian McCarthyAdrian McCarthy

45.7k16 gold badges123 silver badges176 bronze badges

i think its called the clipboard. i am going to bet these programs inject click and double click & keyboard events and then copy items there for inspection. Alternatively, they are gettin jiggy with the windows text controls, and grabbing content that way. i suspect due to security issues, these tools have problems running in vista also.

answered Feb 5, 2009 at 8:07

Scott Evernden's user avatar

Scott EverndenScott Evernden

39.2k15 gold badges79 silver badges84 bronze badges

There is some Win OS API call or so that would let one obtain text from the screen

not via obtaining a snapshot and then doing OCR on it, but via API

the idea is to get the text that is under the mouse that the user points to and clicks on.

This is how tools like Babylon (http://www.babylon.com) and 1-Click Answers (http://www.answers.com/main/download_answers_win.jsp) and many others work.

Can someone point me to the right direction to get this functionality?

Joris Schellekens's user avatar

asked Feb 5, 2009 at 7:59

bobi's user avatar

There is no direct way to obtain text. An application could render text in a zillion different ways (Windows API being one of them), and after it’s rendered — it’s just a bunch of pixels.

A method you could try however is to find the window directly under the mouse and trying to get the text from them. This would work fine on most standard Windows controls (labels, textboxes, etc.) Wouldn’t work on Internet browsers though.

I think the best you can do is make your application such that it supports as many different (common) controls as possible in the above described manner.

answered Feb 5, 2009 at 8:09

Vilx-'s user avatar

Vilx-Vilx-

105k87 gold badges279 silver badges422 bronze badges

You can get the text of every window with the GetWindowText API. The mouse position can be found with the GetCursorPos API.

In Delphi you could use this function (kudos to Peter Below)

Function ChildWindowUnderCursor: HWND;
Var
  hw, lasthw: HWND;
  pt, clientpt: TPoint;
Begin
  Result := 0;
  GetCursorPos( pt );
  // find top-level window under cursor
  hw := WindowFromPoint( pt );
  If hw = 0 Then Exit;

  // look for child windows in the window recursively
  // until we find no new windows
  Repeat
    lasthw := hw;
    clientpt := Pt;
    Windows.ScreenToClient( lasthw, clientpt );
    // Use ChildwindowfromPoint if app needs to run on NT 3.51!
    hw := ChildwindowFromPointEx( lasthw, clientpt, CWP_SKIPINVISIBLE );
  Until hw = lasthw;
  Result := hw;
End;

Regards,
Lieven

answered Feb 5, 2009 at 8:10

Lieven Keersmaekers's user avatar

Windows has APIs for accessibility tools like screen-readers for the blind. (Newer versions are also used for other purposes, like UI automation and testing.) It works with many applications, even most browsers which render their own content without using the standard Windows controls. It won’t work with all applications, but it can be used to figure out the text under the mouse in most cases.

The current API is called the Windows Automation API. Describing how to do this in general is beyond the scope of a Stack Overflow answer, so I’ve simply provided a link to the documentation.

The older API that was widely available when this question was first posted is called the Microsoft Active Accessibility API. As with the modern APIs, the scope here is too broad to detail here.

Note that documentation for both APIs is written both for both developers building accessibility tools (like screen readers) as well as for developers writing apps that want to be compatible with those accessibility tools.

The basic idea is that an accessibility tool gets COM interfaces provided by the target application’s window(s), and it can use those interfaces to figure out the controls and their text and how they’re related both logically and spatially. Applications that are composed of standard Windows controls are mostly automatically supported. Applications with custom UI implementations have to do work to provide these interfaces. Fortunately, the important ones, like the mainstream browsers, have done the work to support these interfaces.

answered Oct 27, 2017 at 23:18

Adrian McCarthy's user avatar

Adrian McCarthyAdrian McCarthy

45.7k16 gold badges123 silver badges176 bronze badges

i think its called the clipboard. i am going to bet these programs inject click and double click & keyboard events and then copy items there for inspection. Alternatively, they are gettin jiggy with the windows text controls, and grabbing content that way. i suspect due to security issues, these tools have problems running in vista also.

answered Feb 5, 2009 at 8:07

Scott Evernden's user avatar

Scott EverndenScott Evernden

39.2k15 gold badges79 silver badges84 bronze badges

WM_CREATE = 0x0001; Приложение для создания окна WM_DESTROY = 0x0002; Окно уничтожено WM_MOVE = 0x0003; Переместить окно WM_SIZE = 0x0005; Измените размер окна WM_ACTIVATE = 0x0006; Окно активируется или потеряно; WM_SETFOCUS = 0x0007; После получения внимания WM_KILLFOCUS = 0x0008; потерять фокус WM_ENABLE = 0x000A; Изменить состояние включения WM_SETREDRAW = 0x000B; Установите окно, если вы можете переопределить WM_SETTEXT = 0x000C; Приложение отправляет это сообщение, чтобы установить текст окна WM_GETTEXT = 0x000D; Приложение отправляет это сообщение для копирования текста соответствующего окна в буфер WM_GETTEXTLENGTH = 0x000E; Получите длину текста, связанного с окном (за исключением пустых символов) WM_PAINT = 0x000F; Спросите окно переопределить себя WM_CLOSE = 0x0010; Отправьте сигнал, когда окно или приложение закрыто WM_QUERYENDSESSION = 0x0011; Когда пользователь решает закончить диалоговое окно или программа вызывает функцию exitwindows WM_QUIT = 0x0012; Используется для завершения работы программы или когда программа вызывает функцию PostQuitMessage WM_QUERYOPEN = 0x0013; Когда окно пользователя восстанавливает позицию предыдущего размера, отправьте это сообщение на определенный значок WM_ERASEBKGND = 0x0014; Когда фон окна должен быть стерт (например, размер изменяется в окне) WM_SYSCOLORCHANGE = 0x0015; Когда цвет системы меняется, отправьте это сообщение во все верхние окна WM_ENDSESSION = 0x0016; После того, как системный процесс испускает сообщения wm_queryendessession, сообщение отправляется в приложение, чтобы сообщить о том, закончился ли диалог WM_SHOWWINDOW = 0x0018; Когда скрытое окно или окно отображения отправляется в это окно в это окно WM_ACTIVATEAPP = 0x001C; Отправьте это сообщение, на которое активируется окно и какое из них не является активированным WM_FONTCHANGE = 0x001D; Отправьте это сообщение во все верхние окна при изменении библиотеки ресурсов шрифта системы WM_TIMECHANGE = 0x001E; Отправьте это сообщение во все верхние окна, когда изменяется время системы WM_CANCELMODE = 0x001F; Отправьте это сообщение, чтобы отменить какое -то вступление в процесс (операция) WM_SETCURSOR = 0x0020; Если мышь заставляет курсор перемещаться в определенном окне, а вход мыши не запечатлен, в окно отправляется сообщение в окно WM_MOUSEACTIVATE = 0x0021; Когда курсор находится в неактивированном окне, пользователь отправляет это сообщение в текущее окно в соответствии с ключом на мыши WM_CHILDACTIVATE = 0x0022; Отправьте это сообщение в подводную ветку MDI, когда пользователь нажимает на строку заголовка этого окна, или окно активируется, перемещается и изменяет размер WM_QUEUESYNC = 0x0023; Это сообщение отправляется программой обучения на основе компьютера, а ввод пользователя разделена через программу Hook WH_JOURLANPALYBACK WM_GETMINMAXINFO = 0x0024; Это сообщение отправляется в окно, когда оно изменит размер или местоположение; WM_PAINTICON = 0x0026; Отправьте его в минимизированное окно, когда его значок будет перепроектирован WM_ICONERASEBKGND = 0x0027; Это сообщение отправлено в минимальное окно, только когда его фон должен быть перепроектирован, когда оно нарисовано перед значком WM_NEXTDLGCTL = 0x0028; Отправьте это сообщение в программу диалогового окна, чтобы изменить позицию фокусировки WM_SPOOLERSTATUS = 0x002A; Всякий раз, когда линия управления печати увеличивает или уменьшает работу, это сообщение выдается WM_DRAWITEM = 0x002B; Отправьте это сообщение владельцам этих свободных частей, когда кнопка, Combobox, Listbox, Menu, WM_MEASUREITEM = 0x002C; Когда кнопка, сочетание, поле списка, управление просмотром списка или элемент меню WM_DELETEITEM = 0x002D; Когда коробка списка или комбинированное поле уничтожается или некоторые элементы удаляются через lb_deletestring, lb_resetcontent, cb_deletetestring или cb_resetcontent message WM_VKEYTOITEM = 0x002E; Это сообщение имеет стиль lbs_wantkeyboardinput, отправленный своему владельцу, чтобы ответить на сообщение WM_Keydown WM_CHARTOITEM = 0x002F; Это сообщение было отправлено его владельцу в списке коробки LBS_WANTKEYBOARDINPUT, чтобы ответить на сообщение WM_CHAR WM_SETFONT = 0x0030; При рисовании текста программа отправляет это сообщение, чтобы использовать цвет для использования в управлении WM_GETFONT = 0x0031; Приложение отправляет это сообщение, чтобы получить шрифт текущего текста чертежа управления WM_SETHOTKEY = 0x0032; Приложение отправляет это сообщение, чтобы окно было связано с горячим ключом WM_GETHOTKEY = 0x0033; Приложение отправляет это сообщение, чтобы определить, связаны ли тепловые ключи с окном WM_QUERYDRAGICON = 0x0037; Это сообщение отправляется в минимальное окно. Когда это окно будет перетаскиваться и отбросить, в его классе нет значка определения. Приложение может вернуть ручку значка или курсора. WM_COMPAREITEM = 0x0039; Отправьте это сообщение, чтобы определить относительную позицию недавно добавленного элемента Combobox или Listbox WM_COMPACTING = 0x0041; Показать память уже очень маленькая WM_WINDOWPOSCHANGING = 0x0046; Отправить это сообщение в размер и положение окна, которое будет изменено, вызовите функцию SetWindowPos или другие функции управления окнами WM_WINDOWPOSCHANGED = 0x0047; Отправьте это сообщение в размер и позицию окна, которые были изменены, вызовите функцию SetWindowPos или другие функции управления окнами Wm_power = 0x0048; (подходит для 16 -бит Windows) Отправьте это сообщение, когда система введет состояние подвески WM_COPYDATA = 0x004A; Отправить это сообщение, когда одно приложение передает данные в другое приложение WM_CANCELJOURNAL = 0x004B; Когда пользователь отменяет статус активации журнала программы, отправьте это сообщение в программу WM_NOTIFY = 0x004E; Когда произошло определенное событие или этот контроль должен получить некоторую информацию, отправьте это сообщение в окно отца WM_INPUTLANGCHANGEREQUEST = 0x0050; Когда пользователь выбирает определенный язык ввода, или горячий ключ изменяется на языке ввода WM_INPUTLANGCHANGE = 0x0051; Когда сайт платформы будет изменен, это сообщение отправляется в верхнее окно, которое затронуто WM_TCARD = 0x0052; Отправьте это сообщение в приложение, когда программа инициализировала процедуру справки Windows WM_HELP = 0x0053; Это сообщение показывает, что пользователь нажимает F1. Если меню активируется, отправьте это сообщение в меню, связанное с этим окном, в противном случае оно будет отправлено в окно фокусировки. Если в настоящее время нет фокуса, отправьте это сообщение в настоящее время к текущему активированному окну WM_USERCHANGED = 0x0054; Когда пользователь вошел в систему или выйдет, отправьте это сообщение во все окно. Когда пользователь входит в систему или выйдет, система обновляет информацию о конкретных парадах пользователя, и система будет отправлять это сообщение немедленно, когда пользователь обновляет настройки; WM_NOTIFYFORMAT = 0x0055; Общественные элементы управления, пользовательские элементы управления и их родительские окна, чтобы определить, использует ли элемент управления структурой ANSI или Unicode в WM_NOTIFY. Использование этого элемента управления может заставить определенное управление связываться с его родительским управлением друг с другом для связи друг с другом. WM_CONTEXTMENU = 0x007B; Когда пользователь нажимает правое -щелкните в определенном окне, отправьте это сообщение в окно WM_STYLECHANGING = 0x007C; Отправьте это сообщение, когда функция SetWindowlong собирается изменить стиль одного или нескольких окон WM_STYLECHANGED = 0x007D; Когда стиль функции SetWindowlong отправляется в стиль одного или нескольких окон, это сообщение отправляется в это окно WM_DISPLAYCHANGE = 0x007E; Когда разрешение дисплея изменяется, отправьте это сообщение во все окно WM_GETICON = 0x007F; Это сообщение отправляется в окно, чтобы вернуть большой значок или небольшой культовый ручку, связанный с окном; WM_SETICON = 0x0080; Программа отправляет это сообщение, чтобы позволить новой большой значке или небольшом значке ассоциируется с определенным окном; WM_NCCREATE = 0x0081; Когда окно было впервые создано, сообщение было отправлено до отправки сообщения wm_create; WM_NCDESTROY = 0x0082; Эта новость уведомляет окно, которое разрушает неценциренная область WM_NCCALCSIZE = 0x0083; Это сообщение отправляется, когда должна быть рассчитана область клиента окна WM_NCHITTEST = 0x0084; Переместите мышь, удерживайте или отпустите мышь WM_NCPAINT = 0x0085; Программа отправляет это сообщение в окно, когда его кадр (окно) должна быть нарисована; WM_NCACTIVATE = 0x0086; Это сообщение отправляется в окно как раз тогда, когда необходимо изменить его область неценциента, чтобы отобразить, активировано или не активировано; WM_GETDLGCODE = 0x0087; Отправьте это сообщение в элемент управления, связанный с программой диалогового окна, клавишу ориентации управления Widdows и клавишу TAB включают ввод для ввода этого элемента управления. Отвечая на сообщение WM_GETDLGCODE, приложение может рассматривать его как специальное управление вводом и обработать его Анкет WM_NCMOUSEMOVE = 0x00A0; Когда курсор перемещается в не -закустомерной области в окне, это сообщение отправляется в неценкурную область этого окна: строка заголовка и граница окна WM_NCLBUTTONDOWN = 0x00A1; Отправьте это сообщение, когда курсор нажимает кнопку левой мыши одновременно в неценциренной области окна WM_NCLBUTTONUP = 0x00A2; Когда пользователь одновременно выпускает левую кнопку мыши, окно отправляет это сообщение в не -закустомерной области; WM_NCLBUTTONDBLCLK = 0x00A3; Когда пользователь удваивает кнопку левой мыши одновременно, свет пометил окно одновременно в не -закустомерной области, чтобы отправить это сообщение WM_NCRBUTTONDOWN = 0x00A4; Когда пользователь нажимает кнопку правой мыши одновременно, курсор и окно в некюстомерной области в окне WM_NCRBUTTONUP = 0x00A5; Когда пользователь выпускает правильную кнопку мыши одновременно, когда курсор и не -кустамерная область в окне отправьте это сообщение WM_NCRBUTTONDBLCLK = 0x00A6; Когда пользователь удваивает кнопку мыши одновременно, свет отмечает окно одновременно в не -закустомерной области и отправьте это сообщение WM_NCMBUTTONDOWN = 0x00A7; Когда пользователь нажимает кнопку в мышью, курсор и окно в не -кюстомерной области в окне WM_NCMBUTTONUP = 0x00A8; Это сообщение отправляется, когда пользователь выпускает курсор одновременно в не -закустомерной области в окне WM_NCMBUTTONDBLCLK = 0x00A9; Когда пользователь удваивает клавишу в мышью одновременно, когда курсор и не -кустамерная область в окне отправьте это сообщение WM_KEYDOWN = 0x0100; нажмите кнопку WM_KEYUP = 0x0101; Выпустите ключ WM_CHAR = 0x0102; Нажмите определенную клавишу и отправьте сообщение WM_KEYDOWN, WM_KEYUP WM_DEADCHAR = 0x0103; Отправить это сообщение в окно фокусировки при переводе сообщения WM_Keyup с функцией TranslateMessage WM_SYSKEYDOWN = 0x0104; Когда пользователь нажимает клавишу ALT одновременно, нажмите другую клавишу, чтобы отправить это сообщение в фокус; WM_SYSKEYUP = 0x0105; Когда пользователь выпускает ключ одновременно, клавиша ALT также отправляется в фокус окна в фокус окна WM_SYSCHAR = 0x0106; Когда сообщение WM_SyskeyDown переводится функцией TranslaTemessAge, это сообщение отправляется в фокус окна WM_SYSDEADCHAR = 0x0107; Когда сообщение wm_syskeydown переводится функцией TranslaTeMessage, это сообщение отправляется в фокус окна WM_INITDIALOG = 0x0110; Отправьте это сообщение перед отображением диалоговой программы. Обычно это сообщение инициализируется управление и выполняет другие задачи WM_COMMAND = 0x0111; Когда пользователь выбирает элемент команды меню или отправляет сообщение в окно родителей при отправке элемента управления, перевод клавиши ярлыка переводится WM_SYSCOMMAND = 0x0112; Когда пользователь выбирает команду меню окна или когда пользователь решает максимизировать или минимизировать его, окно получит сообщение WM_TIMER = 0x0113; Произошел инцидент с таймером WM_HSCROLL = 0x0114; Когда стандартная горизонтальная полоса прокрутки окна генерирует событие проката, отправьте это сообщение в это окно, а также отправьте его на управление с ним WM_VSCROLL = 0x0115; Когда стандартная вертикальная полоса прокрутки окна генерирует событие, отправляя это сообщение в это окно и отправьте его на управление с ним WM_INITMENU = 0x0116; Это сообщение отправляется, когда меню собирается активировать. Он встречается в определенном ключе меню, который происходит в строке меню пользователей. Он позволяет программе изменять меню перед отображением WM_INITMENUPOPUP = 0x0117; Это сообщение отправляется, когда будет активировано меню с падением или суб -меню. WM_MENUSELECT = 0x011F; Отправьте это сообщение владельцу меню, когда пользователь выбирает элемент меню (обычно окно) WM_MENUCHAR = 0x0120; Когда меню было активировано, пользователь нажимает клавишу (отличную от клавиши ускорения), чтобы отправить сообщение владельцу меню; WM_ENTERIDLE = 0x0121; Когда модальное диалоговое окно или меню входит в пустое состояние загрузки, отправьте это сообщение своему владельцу, модальное диалоговое окно или меню входит в пустое состояние загрузки, что после обработки одного или нескольких предыдущих сообщений нет сообщения. Подождите, ожидайте среднего ожидания WM_CTLCOLORMSGBOX = 0x0132; Отправьте сообщение в окно владельца окна сообщения перед окном сообщений о чертеже Windows. Отвечая на это сообщение, окно владельца может установить текст и цвет фона окна сообщения, используя ручку соответствующего устройства отображения, чтобы Установите ручку соответствующего устройства дисплея WM_CTLCOLOREDIT = 0x0133; Когда будет нарисован элемент управления редактированием, отправьте это сообщение в окно своего отца; ответив на это сообщение, окно владельца может установить текст и цвет фона блока редактора, используя ручку заданного корреляционного устройства WM_CTLCOLORLISTBOX = 0x0134; Когда управление блоком списка собирается отправить это сообщение в окно своего отца, прежде чем быть наброшенным; ответив на это сообщение, окно владельца может установить текст и цвет фона блока списка, используя ручку заданного связанного устройства отображения WM_CTLCOLORBTN = 0x0135; Когда элемент управления кнопкой будет нарисован, отправьте сообщение в окно своего отца; ответив на это сообщение, окно владельца может установить текст и цвет фона нового нового и фона через ручку соответствующего устройства отображения с заданное корреляционное устройство. WM_CTLCOLORDLG = 0x0136; Когда элемент управления диалоговом окном собирается отправить это сообщение в окно своего отца, прежде чем быть нарисовавшим; WM_CTLCOLORSCROLLBAR= 0x0137; Когда будет нарисован управление на ходу, сообщение отправляется в окно его отца; отвечая на это сообщение, окно владельца может установить цвет фона стержня прокрутки через ручку соответствующего устройства отображения. WM_CTLCOLORSTATIC = 0x0138; Когда статическое управление будет нарисовано, отправьте это сообщение в окно своего отца; ответив на это сообщение, окно владельца может установить текст и цвет фона статического элемента управления, используя ручку заданного корреляционного устройства WM_MOUSEMOVE = 0x0200; Мыши WM_LBUTTONDOWN = 0x0201; Нажмите кнопку левой мыши WM_LBUTTONUP = 0x0202; Отпустите левую кнопку мыши WM_LBUTTONDBLCLK = 0x0203; Двойной кнопку левой мыши WM_RBUTTONDOWN = 0x0204; Право -щелкните мышью WM_RBUTTONUP = 0x0205; Право -щелкните мышью WM_RBUTTONDBLCLK = 0x0206; Дважды -щелкните правую кнопку мыши WM_MBUTTONDOWN = 0x0207; Нажмите кнопку мыши WM_MBUTTONUP = 0x0208; Выпустите ключ мыши WM_MBUTTONDBLCLK = 0x0209; Дважды -щелкните ключ мыши WM_MOUSEWHEEL = 0x020A; Отправьте это сообщение, когда вращается колесо мыши WM_PARENTNOTIFY = 0x0210; Когда суб -ветка MDI создается или уничтожается, или пользователь нажимает кнопку мыши, а курсор отправляет это сообщение в окно своего отца, когда курсор находится на подволке. WM_ENTERMENULOOP = 0x0211; Отправьте это сообщение, чтобы проинформировать приложение главного окна, которое ввело режим цикла меню WM_EXITMENULOOP = 0x0212; Отправьте это сообщение, чтобы сообщить о применении главного окна приложения, которое отозвано из режима цикла меню WM_SIZING = 532; Когда пользователь настраивает окно, чтобы отправить это сообщение в окно в размере окна; через это приложение сообщения вы можете отслеживать размер и положение окна или позиции. WM_CAPTURECHANGED = 533; Отправьте это сообщение в окно, когда он теряет захваченную мышь; WM_MOVING = 534; Когда пользователь отправляет это сообщение при перемещении окна, приложение может отслеживать размер и положение окна через это приложение сообщения; WM_POWERBROADCAST = 536; Это сообщение отправляется в заявку, чтобы сообщить об этом о событии управления питанием; WM_DEVICECHANGE = 537; Отправьте это сообщение в драйвер приложения или устройства при изменении аппаратной конфигурации устройства WM_MDICREATE = 0x0220; Приложение отправляет это сообщение в окно клиента Multi -Document, чтобы создать Sub -Window MDI WM_MDIDESTROY = 0x0221; Приложение отправляет это сообщение в окно клиента Multi -Document, чтобы закрыть Sub -Window MDI

Функция GetWindowText



Функция GetWindowText
копирует текст заголовка определяемого окна (если окно имеет его) в буфер. Если заданное окно является органом управления,
копируется его текст. Однако функция GetWindowText
не может извлекать текст органа управления в другом приложении.

Синтаксис

int GetWindowText(
HWND hWnd,       // дескриптор окна или элемента 
                 // управления с текстом
LPTSTR lpString// адрес буфера для текста
int nMaxCount    // максимальное число символов 
                 // для копирования


);

Параметры

hWnd

[in] Дескриптор окна или органа управления, содержащего текст.

lpString

[out] Указывает на буфер, который примет текст. Указатель на буфер, который получит текст. Если строка является такой же длины
или длиннее, чем буфер, она обрезается и завершается символом
NULL.

nMaxCount

Устанавливает максимальное число символов для копирования в буфер, включая символ NULL. Если текст превышает это
ограничение, он усекается.

Возвращаемые
значения


Если функция завершается успешно, возвращаемое значение — длина, в символах, скопированной строки, не, включая символа
конца строки (нуль-терминатора). Если у окна нет заголовка или текста, если строка заголовка — пустая строка или, если
дескриптор окна или органа управления недопустимы, возвращаемое значение нулевое. Чтобы получать расширенные данные об
ошибках, вызовите GetLastError.

Эта функция не может извлекать текст из поля элемента редактирования в другой прикладной программе.

Замечания


Если целевое окно находится во владении текущего потока, функция
GetWindowText
вынуждена отправить сообщение WM_GETTEXT
заданному окну или органу управления. Если целевое окно находится во владении другого потока и имеет заголовок
GetWindowText извлекает текст заголовка окна. Если у окна нет
заголовка, возвращаемое значение является нулевой строкой. Это поведение регулируется в соответствии с проектом. Оно
позволяет прикладным программам вызвать функцию
GetWindowText
без зависания программы, если процесс, который владеет целевым окном, зависает. Однако если целевое окно зависаете, и оно
принадлежит вызывающей программе, функция GetWindowText
приведет к зависанию вызывающую программу.


Чтобы извлечь текст из органа управления в другом процессе, отправьте сообщение
WM_GETTEXT непосредственно вместо вызова GetWindowText.

Пример


Пример смотри в статье Отправка
сообщений
.

Смотри также



Краткий обзор Окна
, GetWindowTextLength,
SetWindowText,
WM_GETTEXT



Размещение и совместимость GetWindowText



Windows. NET Server


Да



Windows XP


Да



Windows 2000


Да



Windows NT


Да



Windows Me


Да



Windows 98


Да



Windows 95


Да

Используемая библиотека



User32.lib



Заголовочный файл

 



— объявлено в



Winuser.h



— включено в



Windows.h



Unicode


Нет



Замечания по платформе


Не имеется

Hosted by uCoz

Article catalog

      • I. Introduction
      • Second, use Spy ++ Tool Analysis Window
      • Third, C # capture the window via the Windows API, get the window text
      • Fourth, Appendix: Windows Window Message

I. Introduction

Project isUnityDeveloped, on the shelvesQQGame hall, need to be compatibleXPsystem.
QQThe process of launching the game in the game hall is like this:
1 QQ game hall .exe -------> 2 downloader .exe -------> 3 Unity game .exe
inXPIn the test,Unity game .exeThe operation is as followsError

So, we are not sure how many users have encountered this problem, so they need to be reported, and the logic detection is added in the downloader, when the downper is startedUnityWhen the game is waiting for 2 seconds, it is judged if there isErrorWindow, if any, capture this window and take out the text in it, report to the server, and convenient data analysis statistics.

Download device I usedC#of.Net FrameworkThe desktop application is done, so how is it?C#CaptureWindowsThe problem of windows, let’s introduce my implementation method.

Second, use Spy ++ Tool Analysis Window

We can useSpy++Tool analysis window. Here I am using it.Spy++ LiteOnly a few hundred k size, very light.

Spy++ Litedownload:

Extraction code: MTSQ

Spy ++ Lite is a feature-rich programming auxiliary tool for obtaining window handles and analyzing formal structures. 32-bit and 64-bit applications can be detected. You can display the value of the window handle, window style, and class style. You can get the parent window and the brothers window, the sub-window structure and form a handle tree, and adjust the status and behavior of the window, get the program path, screenshots, etc. The software also supports gain list control data, such as task manager, stock market data, etc., also supports getting a tree view, pull-down box, list box, menu data, and font information.

note,.OCXDocument requires registration, registration.OCXFile steps:
(1)COMCTL32.OCXDocument copy toCIn this directory: 32-bit system:c:\WINDOWS\system3264-bit system:c:\Windows\SysWOW64
I am as follows, because I am32-bit XPSo put it inc:\WINDOWS\system32in.

(2) Openrun, Enter the registration command,
32Bit system:

regsvr32 c:\WINDOWS\system32\COMCTL32.OCX

64Bit system:

regsvr32 c:\Windows\SysWOW64\COMCTL32.OCX

registration success.

Next, you can runSpy++ Lite.

useSpy++analysisErrorThe information of the window.

According to the above operation, we can know:
Window title isErrorUnder this window, there is a sub-window, the sub-window title isEditThe text in the sub-window is:

Failed to initialize Direct3D.
Make sure you have at least DirectX 9.0c installed, have drivers for your
graphics card and have not disabled 3D acceleration
in display settings.
InitializeEngineGraphics failed

What we have to do is to find this sub-window, take out the text, belowC#Code to implement this logic.

Third, C # capture the window via the Windows API, get the window text

WindowsA lot of packagesAPI, We can pass theseAPITo access the window and action window.
Among them, severalAPI

// Find window
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

// Traverse all child windows of the window, call back to Callback
[DllImport("user32.dll")]
public static extern int EnumChildWindows(IntPtr hWndParent, CallBack lpfn, int lParam);
public delegate bool CallBack(IntPtr hwnd, int lParam);

/ / Get the class name of the window
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);

/ / Judgment the window visible
[DllImport("user32.dll")]
public static extern bool IsWindowVisible(IntPtr hWnd);

// Get the length of the window text
[DllImport("user32.dll")]
public static extern int GetWindowTextLength(IntPtr hWnd);

/ / Get the window text, the text will put into the StringBuilder, you need to specify the maximum length of the string Nmaxcount
[DllImport("User32.dll", EntryPoint = "GetWindowText")]
private static extern int GetWindowText(IntPtr hwnd, StringBuilder lpString, int nMaxCount);

/ / Send a message to the window
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);

/ / Send a message to the window, the data returned by the event is obtained by byte [] array
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, Byte[] lParam);

The full code is as follows:

using System;
using System.Runtime.InteropServices;
using System.Text;


public partial class WindowApiHelper 
{
    /// <summary>
    // / Try to find an Error window and remove the window text
    /// </summary>
    /// <returns></returns>
    public static string TryFindErrorWindowText()
    {
        string errorText = "";
        / / Find the title of Error
        IntPtr mainHandle = FindWindow(null, "Error");
        if (mainHandle != IntPtr.Zero)
        {
            // Enumerate a child form, find the control handle
            int i = EnumChildWindows(mainHandle, (h, l) =>
            {
                StringBuilder sbr = new StringBuilder();
                GetClassName(h, sbr, 255);
                string classname = sbr.ToString();
                / / Get an Edit sub-window
                if ("Edit" == classname)
                {
                    // Is it visible?
                    if (IsWindowVisible(h))
                    {
                        // Remove the window text
                        int textLen;
                        textLen = SendMessage(h, WM_GETTEXTLENGTH, 0, 0);
                        Byte[] byt = new Byte[textLen];
                        SendMessage(h, WM_GETTEXT, textLen + 1, byt);
                        errorText = Encoding.Default.GetString(byt);
                        // Close the Error window
                        // SendMessage(h, WM_CLOSE , 0, 0);
                    }
                }

                return true;
            }, 0);
        }
        return errorText;
    }

    /*--Windows API------------------------------------------------------------------------------------*/

    [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
    public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

    [DllImport("user32.dll")]
    public static extern int EnumChildWindows(IntPtr hWndParent, CallBack lpfn, int lParam);
    public delegate bool CallBack(IntPtr hwnd, int lParam);

    [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);

    [DllImport("user32.dll")]
    public static extern bool IsWindowVisible(IntPtr hWnd);

    [DllImport("user32.dll")]
    public static extern int GetWindowTextLength(IntPtr hWnd);

    [DllImport("User32.dll", EntryPoint = "GetWindowText")]
    private static extern int GetWindowText(IntPtr hwnd, StringBuilder lpString, int nMaxCount);

    [DllImport("user32.dll", EntryPoint = "SendMessageA")]
    public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);

    [DllImport("user32.dll", EntryPoint = "SendMessageA")]
    public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, Byte[] lParam);

    const int WM_GETTEXT = 0x000D;
    const int WM_GETTEXTLENGTH = 0x000E;
    const int WM_CLOSE = 0x10;

    /*--Windows API------------------------------------------------------------------------------------*/
}

Fourth, Appendix: Windows Window Message

news description
WM_CREATE = 0x0001; Application creates a window
WM_DESTROY = 0x0002; One window is destroyed
WM_MOVE = 0x0003; Move a window
WM_SIZE = 0x0005; Change the size of a window
WM_ACTIVATE = 0x0006; A window is activated or lost to activate;
WM_SETFOCUS = 0x0007; After getting the focus
WM_KILLFOCUS = 0x0008; lose focus
WM_ENABLE = 0x000A; Change the Enable status
WM_SETREDRAW = 0x000B; Set whether the window is able to redraw
WM_SETTEXT = 0x000C; The application sends this message to set the text of a window
WM_GETTEXT = 0x000D; The application sends this message to copy the text to the buffer corresponding to the window
WM_GETTEXTLENGTH = 0x000E; Get the length of text related to a window (not including empty characters)
WM_PAINT = 0x000F; Ask one window to call yourself
WM_CLOSE = 0x0010; Send a signal when a window or application is turned off
WM_QUERYENDSESSION = 0x0011; When the user selects the end dialog or the program calls the exitwindows function
WM_QUIT = 0x0012; Used to end the program to run or when the program calls postquitMessage functions
WM_QUERYOPEN = 0x0013; When the user window recovers the previous size position, send this message to an icon.
WM_ERASEBKGND = 0x0014; When the window background must be erased (case change in the window)
WM_SYSCOLORCHANGE = 0x0015; When the system color changes, send this message to all top windows
WM_ENDSESSION = 0x0016; When the system process issues a WM_QueryEndSession message, this message is sent to the application, notifying it to end if the conversation ends
WM_SHOWWINDOW = 0x0018; When the hidden or display window is sent to this message to this window
WM_ACTIVATEAPP = 0x001C; Send this message which window to the application is activated, which is non-activated
WM_FONTCHANGE = 0x001D; Send this message to all top windows when the system’s font resource library changes
WM_TIMECHANGE = 0x001E; Send this message to all top windows when the system’s time changes
WM_CANCELMODE = 0x001F; Send this message to cancel some of the ongoing touch state (operation)
WM_SETCURSOR = 0x0020; If the mouse causes the cursor to move in a window and the mouse input is not captured, send a message to a window.
WM_MOUSEACTIVATE = 0x0021; When the cursor is in a non-active window and the user is in pressing a key in the mouse to send this message to the current window.
WM_CHILDACTIVATE = 0x0022; Send this message to the MDI child window When the user clicks on this window, or when the window is activated, moved, change the size
WM_QUEUESYNC = 0x0023; This message is sent by a computer-based training program, separating the user input message via the HOOK program of WH_Journalpalyback
WM_GETMINMAXINFO = 0x0024; This message is sent to the window When it will change the size or position;
WM_PAINTICON = 0x0026; Send to the minimization window When it icon will be heavy
WM_ICONERASEBKGND = 0x0027; This message is sent to a minimization window, only when it is drawing the background, it must be heavy
WM_NEXTDLGCTL = 0x0028; Send this message to a dialog program to change the focus location
WM_SPOOLERSTATUS = 0x002A; Whenever the print management queue increases or decreases this message when a job
WM_DRAWITEM = 0x002B; This message is sent to the owner of these empty parts when the visual appearance of Button, ComboBox, ListBox, Menu
WM_MEASUREITEM = 0x002C; When Button, Combo Box, List Box, List View Control, or Menu Item is created, send this message to the owner of the control
WM_DELETEITEM = 0x002D; When the List Box or Combo Box is destroyed or when some items are removed through lb_deleteString, lb_resetcontent, cb_deleteString, or cb_resetcontent message
WM_VKEYTOITEM = 0x002E; This message has a LBS_WANTKEYBOARDINPUT style to the owner of it to respond to WM_KeyDown messages
WM_CHARTOITEM = 0x002F; This message is sent to his owner by a list box in a lbs_wantkeyboardinput style to respond to WM_CHAR messages.
WM_SETFONT = 0x0030; When the text is drawn, the program is sent this message to get the color you want to use.
WM_GETFONT = 0x0031; Application Send this message to get the current control to draw the text
WM_SETHOTKEY = 0x0032; The application sends this message to let a window associated with a hotkey
WM_GETHOTKEY = 0x0033; The application sends this message to determine if the hotkey is associated with a window.
WM_QUERYDRAGICON = 0x0037; This message is sent to the minimization window, when this window will be dragged and the icon is not defined in its class, the application can return a handle of an icon or cursor, when the user drags and drop icon, the system displays this icon or cursor.
WM_COMPAREITEM = 0x0039; Send this message to determine the relative position of the new item added in ComboBox or Listbox
WM_COMPACTING = 0x0041; There is already very few memory
WM_WINDOWPOSCHANGING = 0x0046; Send this message to call the SETWINDOWPOS function or other window management functions when the size and location of the window will be changed.
WM_WINDOWPOSCHANGED = 0x0047; Send this message to call the SETWINDOWPOS function or other window management functions when the size and location of the window have been changed.
WM_POWER = 0x0048; (for 16-bit Windows) This message will be sent when the system will enter the pause state
WM_COPYDATA = 0x004A; Send this message when an application passes data to another application
WM_CANCELJOURNAL = 0x004B; Submit this message to the program when a user cancels the program log activation status
WM_NOTIFY = 0x004E; When a control is or if this control needs to get some information, send this message to its parent window.
WM_INPUTLANGCHANGEREQUEST = 0x0050; When the user selects some kind of input language, or the hotkey change in the input language
WM_INPUTLANGCHANGE = 0x0051; This message is sent to the most affected top window when the platform has been changed.
WM_TCARD = 0x0052; This message is sent to the application when the program has initialized the Windows Help routine.
WM_HELP = 0x0053; This message displays the user presses F1. If a menu is activated, send this message and this window is associated with the menu, otherwise send a window with focus, if there is no focus, just send this message to the current Activated window
WM_USERCHANGED = 0x0054; When the user has already logged in or exits, the message is sent to all windows, and the system updates the user’s specific setting information when the user logins or exits, and the system will send this message immediately when the user update settings;
WM_NOTIFYFORMAT = 0x0055; Public controls, custom controls, and their parent windows to determine that the control is using ansi or a Unicode structure in the WM_NOTIFY message, using this control to make each other to communicate with its parent controls
WM_CONTEXTMENU = 0x007B; When you click on a window, you can send this message to this window.
WM_STYLECHANGING = 0x007C; When the calling setWindowlong function will change this message to that window when you want to change the style of one or more windows.
WM_STYLECHANGED = 0x007D; This message is sent to that window when calling the style of a setWindowlong function one or more windows.
WM_DISPLAYCHANGE = 0x007E; Send this message to all windows when the resolution of the display changes
WM_GETICON = 0x007F; This message is sent to a window to return a handle of a large icon or a small icon with a window;
WM_SETICON = 0x0080; The program sends this message to let a new large icon or small icon associated with a window;
WM_NCCREATE = 0x0081; This message is sent before the WM_CREATE message is sent when a window is created first.
WM_NCDESTROY = 0x0082; This message notifies a window, non-customer district is destroying
WM_NCCALCSIZE = 0x0083; This message must be sent when a customer area of ​​a window must be verified
WM_NCHITTEST = 0x0084; Move the mouse, hold down or release the mouse
WM_NCPAINT = 0x0085; The program sends this message to a window when it (window) is drawn;
WM_NCACTIVATE = 0x0086; This message is sent to a window only when its non-customer area needs to be changed to display is activated or inactive;
WM_GETDLGCODE = 0x0087; Send this message to a control associated with the dialog program, the Widdows Control orientation key, and Tab keys enters this control, by responding to the WM_GETDLGCODE message, the application can treat him as a special input control and can handle it
WM_NCMOUSEMOVE = 0x00A0; When the cursor is moving this message when moving in a window’s non-customer zone, the non-client area is: the title bar of the form and the side frame of the window
WM_NCLBUTTONDOWN = 0x00A1; This message submits this message when the cursor is in the non-client area of ​​a window.
WM_NCLBUTTONUP = 0x00A2; When the user releases the left mouse button, the cursor is sent to the non-client zone ten;
WM_NCLBUTTONDBLCLK = 0x00A3; When the user doubles the left mouse button, the spectrum is sent to this message in the non-client zone ten.
WM_NCRBUTTONDOWN = 0x00A4; When the user presses the mouse button, the cursor is sent to this message when the cursor is in the non-client district of the window.
WM_NCRBUTTONUP = 0x00A5; When the user releases the right mouse button, the cursor is sent to the window’s non-client district.
WM_NCRBUTTONDBLCLK = 0x00A6; When the user doubles the mouse button, the cursor is sent in the non-client zone ten.
WM_NCMBUTTONDOWN = 0x00A7; When the user presses the mouse button while the cursor is also sent this message when the cursor is in the non-client district of the window.
WM_NCMBUTTONUP = 0x00A8; When the user releases the mouse button while the cursor is also sent to the window’s non-client district
WM_NCMBUTTONDBLCLK = 0x00A9; When the user doubles the mouse button, the cursor is sent to this message when the cursor is in the non-client district of the window.
WM_KEYDOWN = 0x0100; Press a button
WM_KEYUP = 0x0101; Release a key
WM_CHAR = 0x0102; Press a key and issue WM_KEYDOWN, WM_KEYUP message
WM_DEADCHAR = 0x0103; Send this message to the window with focus when translating the WM_KEYUP message with the TranslateMessage function
WM_SYSKEYDOWN = 0x0104; Submit this message to the window with focus when the user holds down the Alt button.
WM_SYSKEYUP = 0x0105; When the user releases a button while the Alt key is pressed, submit this message to the window with focus.
WM_SYSCHAR = 0x0106; When the WM_SYSKEYDOWN message is translated by the translateMessage function, submit this message to the window with focus.
WM_SYSDEADCHAR = 0x0107; When the WM_SYSKEYDOWN message is translated by the translateMessage function, send this message to the window with focus.
WM_INITDIALOG = 0x0110; Send this message before a dialog program is displayed, usually use this message to initialize the control and perform other tasks.
WM_COMMAND = 0x0111; When the user chooses a menu command item or when a control sends a message to its parent window, a shortcut is translated
WM_SYSCOMMAND = 0x0112; When a user selects a command to the window menu or when the user selects maximizes or minimizes the message, the window will receive this message.
WM_TIMER = 0x0113; Timer event occurs
WM_HSCROLL = 0x0114; When a window standard horizontal scroll bar generates a scrolling event to send this message to that window, also sent to the control with it
WM_VSCROLL = 0x0115; When a window standard vertical scroll bar generates a scrolling event to send this message to that window, send it to the control with it.
WM_INITMENU = 0x0116; When a menu will be activated, this message is sent, which occurs in a user menu bar or presses a menu button, which allows the program to change the menu before display
WM_INITMENUPOPUP = 0x0117; When a drop-down menu or submenu will be sent to send this message when it is activated, it allows the program to change the menu before it is displayed, not to change all
WM_MENUSELECT = 0x011F; When the user selects a menu item, send this message to the owner of the menu (generally the window)
WM_MENUCHAR = 0x0120; When the menu has been activated by the user (different from the accelerator), send this message to the owner of the menu;
WM_ENTERIDLE = 0x0121; When a modal dialog or menu enters an air-loaded state, send this message to its owner, a modal dialog or menu into the no-load state is the column that does not have a message after processing one or more previous messages. Neutralize
WM_CTLCOLORMSGBOX = 0x0132; Send this message to the owner window of the message box before drawing the message box, by responding to this message, the owner window can set the text and background color of the message box with the handle of the given related display device.
WM_CTLCOLOREDIT = 0x0133; When a editing control will be drawn, send this message to its parent window; by responding to this message, the owner window can set the text and background color of the edit box by using the handle of the given related display device.
WM_CTLCOLORLISTBOX = 0x0134; When a list box control will send this message to its parent window before being drawn; by responding to this message, the owner window can set the text and background color of the list box by using the handle of the given related display device.
WM_CTLCOLORBTN = 0x0135; When a button control will send this message to its parent window; by responding to this message, the owner window can set the text and background color of the button with the handle of the given related display device.
WM_CTLCOLORDLG = 0x0136; When a dialog control will send this message to the parent window before drawn; by responding to this message, the owner window can set the text background color of the dialog box by using the handle of the given related display device.
WM_CTLCOLORSCROLLBAR= 0x0137; When a scroll strip control will send this message to its parent window; by responding to this message, the owner window can set the background color of the scroll bar by using the handle of the given related display device.
WM_CTLCOLORSTATIC = 0x0138; When a static control will be drawn, send this message to its parent window; by responding to this message, the owner window can set the text and background color of the static control by using the handle of the given related display device.
WM_MOUSEMOVE = 0x0200; Move mouse
WM_LBUTTONDOWN = 0x0201; Press the left mouse button
WM_LBUTTONUP = 0x0202; Release the left mouse button
WM_LBUTTONDBLCLK = 0x0203; Double-click the left mouse button
WM_RBUTTONDOWN = 0x0204; Press the right mouse button
WM_RBUTTONUP = 0x0205; Right click
WM_RBUTTONDBLCLK = 0x0206; Double-click the right mouse button
WM_MBUTTONDOWN = 0x0207; Press the mouse button
WM_MBUTTONUP = 0x0208; Release mouse button
WM_MBUTTONDBLCLK = 0x0209; Double click on the mouse button
WM_MOUSEWHEEL = 0x020A; Send this message when the mouse wheel is rotated, the current focus control
WM_PARENTNOTIFY = 0x0210; When the MDI sub-window is created or destroyed, or the user presses the mouse button and the cursor will send this message to its parent window on the child window.
WM_ENTERMENULOOP = 0x0211; Send this message to notify the application’s main window That has entered the menu loop mode
WM_EXITMENULOOP = 0x0212; Send this message to notify the application’s main window That has exited menu loop mode
WM_SIZING = 532; When the user is adjusting the window size to the window; you can monitor the window size and location through this message application can also modify them.
WM_CAPTURECHANGED = 533; Send this message to the window When it lost the captured mouse;
WM_MOVING = 534; When the user sends this message while moving the window, you can monitor the window size and location or modify them;
WM_POWERBROADCAST = 536; This message is sent to the application to inform it about power management events;
WM_DEVICECHANGE = 537; This message is sent to the application or device driver when the hardware configuration change of the device changes
WM_MDICREATE = 0x0220; The application sends this message to a multi-document customer window to create an MDI sub-window
WM_MDIDESTROY = 0x0221; The application sends this message to the multi-document customer window to close a MDI sub-window

  • Windows audio ошибка 0x80070005 отказано в доступе
  • Windows admin center не подключается к серверу
  • Windows anytime upgrade windows 7 код активации
  • Windows arm64 что это такое
  • Windows aik для windows 10 скачать