Getforegroundwindow and getactivewindow

Source: Internet
Author: User
Getforegroundwindow function: This function returns the front-end window (the window currently used by the user ). The system assigns a higher priority to the thread that generates the foreground window.
Function prototype: hwnd getforegroundwindow (void)
Parameter: none.
Return Value: The handle returned by the function in the foreground window.
Quick query: Windows NT: 3.1 or later; windows: 95 or later: Windows CE: 1.0 or later: header file: winuser. h; library file: user32.lib. // Getforegroundwindow <br/> procedure tform1.timer1timer (Sender: tobject); <br/> var <br/> acaption: array [0 .. 254] of char; <br/> ahandle: thandle; <br/> begin <br/> ahandle: = getforegroundwindow; <br/> getwindowtext (ahandle, acaption, 255 ); <br/> memo1.lines. add (inttostr (ahandle) + acaption); <br/> end;Getactivewindow function: This function obtains the window handle of the active window related to the Message Queue of the calling thread.
Function prototype: hwnd getactivewindow (void)
Parameter: none.
Return Value: the return value is the handle of the active window related to the Message Queue of the calling thread. Otherwise, the return value is null.
Quick query: Windows NT: 3.1 and later; windows: 95 and later; Windows CE: 1.0 and later; header file: winser. h; library file: user32.lib. // Getactivewindow <br/> procedure tform1.timer2timer (Sender: tobject); <br/> var <br/> acaption: array [0 .. 254] of char; <br/> ahandle: thandle; <br/> begin <br/> ahandle: = getactivewindow; <br/> getwindowtext (ahandle, acaption, 255 ); <br/> memo2.lines. add (inttostr (ahandle) + acaption); <br/> end;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.