|
송신영님
감사합니다.
송신영 님이 쓰신 글 :
: Caption 이름이 "하나" 인 윈도우를 찾아서
: 해당 윈도우를 Close 하라는 메시지를 보내는 것입니다.
: 아래는 FindWindow에 대한 설명입니다.
: 모르는 함수가 있을 경우에는 해당 함수에서 F1키를 누르면 Help 파일이 나옵니다.
:
: Syntax
:
: HWND WINAPI FindWindow(
: __in_opt LPCTSTR lpClassName,
: __in_opt LPCTSTR lpWindowName
: );
:
: Parameters
: lpClassName [in, optional]
: Type: LPCTSTR
:
: The class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero.
: If lpClassName points to a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names.
: If lpClassName is NULL, it finds any window whose title matches the lpWindowName parameter.
:
: lpWindowName [in, optional]
: Type: LPCTSTR
:
: The window name (the window's title). If this parameter is NULL, all window names match.
:
: Return value
: Type:
:
: Type: HWND
:
: If the function succeeds, the return value is a handle to the window that has the specified class name and window name.
: If the function fails, the return value is NULL. To get extended error information, call GetLastError.
:
: Remarks
: If the lpWindowName parameter is not NULL, FindWindow calls the GetWindowText function to retrieve the window name for comparison. For a description of a potential problem that can arise, see the Remarks for GetWindowText.
:
: Examples
: For an example, see Retrieving the Number of Mouse Wheel Scroll Lines.
:
: Requirements
: Minimum supported client
: Windows 2000 Professional
: Minimum supported server
: Windows 2000 Server
: Header
: Winuser.h (include Windows.h)
: Library
: User32.lib
: DLL
: User32.dll
: Unicode and ANSI names
: FindWindowW (Unicode) and FindWindowA (ANSI)
:
: See also
: Reference
: EnumWindows
: FindWindowEx
: GetClassName
: GetWindowText
: RegisterClass
: RegisterClassEx
: Conceptual
: Windows
:
:
: hanmuun 님이 쓰신 글 :
: : 안녕하세요.
: : 제가 질문올릴때마다 자세한 설명 너무감사합니다.
: : 초보다 보니까 너무 모르는것이 많네요.^-^
: : FindWindow에 대한 설명과
: : 아래예제에 대한 주석좀 부탁드릴께요.
: : 감사합니다.
: :
: : void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
: : {
: : HWND hWnd = FindWindow(NULL, "하나");
: : if(hWnd)
: : {
: : SendMessage(hWnd,WM_CLOSE,0,0);
: : }
: : }
|