• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetWindowInfo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetWindowInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetWindowInfo函数的具体用法?C++ GetWindowInfo怎么用?C++ GetWindowInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetWindowInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: al

void LocalUpdateHandler::updateVideoRegion()
{
  ServerConfig *srvConf = Configurator::getInstance()->getServerConfig();
  unsigned int interval = srvConf->getVideoRecognitionInterval();

  DateTime curTime = DateTime::now();
  if ((curTime - m_lastVidUpdTime).getTime() > interval) {
    m_lastVidUpdTime = DateTime::now();
    m_vidRegion.clear();
    AutoLock al(srvConf);
    StringVector *classNames = srvConf->getVideoClassNames();
    std::vector<HWND> hwndVector;
    std::vector<HWND>::iterator hwndIter;

    WindowFinder::findWindowsByClass(classNames, &hwndVector);

    for (hwndIter = hwndVector.begin(); hwndIter != hwndVector.end(); hwndIter++) {
      HWND videoHWND = *hwndIter;
      if (videoHWND != 0) {
        WINDOWINFO wi;
        wi.cbSize = sizeof(WINDOWINFO);
        if (GetWindowInfo(videoHWND, &wi)) {
          Rect videoRect(wi.rcClient.left, wi.rcClient.top,
                         wi.rcClient.right, wi.rcClient.bottom);
          videoRect.move(-GetSystemMetrics(SM_XVIRTUALSCREEN),
                         -GetSystemMetrics(SM_YVIRTUALSCREEN));
          m_vidRegion.addRect(&videoRect);
        }
      }
    }
  }
}
开发者ID:sim0629,项目名称:tightvnc,代码行数:32,代码来源:LocalUpdateHandler.cpp


示例2: winDialogGetWindowDecor

static void winDialogGetWindowDecor(Ihandle* ih, int *border, int *caption, int menu)
{
  WINDOWINFO wi;
  wi.cbSize = sizeof(WINDOWINFO);
  GetWindowInfo(ih->handle, &wi);

  *border = wi.cxWindowBorders;

  if (wi.rcClient.bottom == wi.rcClient.top || 
      wi.rcClient.top > wi.rcWindow.bottom ||
      wi.rcClient.bottom > wi.rcWindow.bottom)
  {
    if (wi.dwStyle & WS_CAPTION)
    {
      if (wi.dwExStyle & WS_EX_TOOLWINDOW)
        *caption = GetSystemMetrics(SM_CYSMCAPTION); /* tool window */
      else
        *caption = GetSystemMetrics(SM_CYCAPTION);   /* normal window */
    }
    else
      *caption = 0;
  }
  else
  {
    /* caption = window height - borders - client height - menu */
    *caption = (wi.rcWindow.bottom-wi.rcWindow.top) - 2*wi.cyWindowBorders - (wi.rcClient.bottom-wi.rcClient.top) - menu; 
  }
}
开发者ID:ivanceras,项目名称:iup-mirror,代码行数:28,代码来源:iupwin_dialog.c


示例3: winDialogGetActiveWindowAttrib

static char* winDialogGetActiveWindowAttrib(Ihandle* ih)
{
  WINDOWINFO wininfo;
  wininfo.cbSize = sizeof(WINDOWINFO);
  GetWindowInfo(ih->handle, &wininfo);
  return iupStrReturnBoolean (wininfo.dwWindowStatus & WS_ACTIVECAPTION); 
}    
开发者ID:ivanceras,项目名称:iup-mirror,代码行数:7,代码来源:iupwin_dialog.c


示例4: GetWindowInfo

	void Window::HandleSizeMessage()
	{
		WINDOWINFO info;
		GetWindowInfo(m_handle, &info);

		bool resized = false;
		if (GetRectWidth(info.rcClient) != GetRectWidth(m_clientRect))
			resized = true;
		else if (GetRectHeight(info.rcClient) != GetRectHeight(m_clientRect))
			resized = true;

		m_clientRect = info.rcClient;
		m_windowRect = info.rcWindow;
				
		if (resized)
		{
			unsigned int clientWidth = GetClientWidth();
			unsigned int clientHeight = GetClientHeight();
			unsigned int windowWidth = GetWindowWidth();
			unsigned int windowHeight = GetWindowHeight();

			for (size_t i = 0; i < m_eventListeners.size(); ++i)
			{
				m_eventListeners[i]->WindowResized(clientWidth, clientHeight, windowWidth, windowHeight);
			}
		}
	}
开发者ID:rarosu,项目名称:WarSettlers,代码行数:27,代码来源:Window.cpp


示例5: RKMDIWindow

RKCaughtX11Window::RKCaughtX11Window (WId window_to_embed, int device_number) : RKMDIWindow (0, X11Window) {
	RK_TRACE (MISC);

	commonInit (device_number);
	embedded = window_to_embed;

#ifdef Q_WS_WIN
	// unfortunately, trying to get KWindowInfo as below hangs on windows (KDElibs 4.2.3)
	WINDOWINFO wininfo;
	wininfo.cbSize = sizeof (WINDOWINFO);
	GetWindowInfo (embedded, &wininfo);

	// clip off the window frame and menubar
	xembed_container->setContentsMargins (wininfo.rcWindow.left - wininfo.rcClient.left, wininfo.rcWindow.top - wininfo.rcClient.top,
				wininfo.rcClient.right - wininfo.rcWindow.right, wininfo.rcClient.bottom - wininfo.rcWindow.bottom);
	// set a fixed size until the window is shown
	xembed_container->setFixedSize (wininfo.rcClient.right - wininfo.rcClient.left, wininfo.rcClient.bottom - wininfo.rcClient.top);
	setGeometry (wininfo.rcClient.left, wininfo.rcClient.right, wininfo.rcClient.top, wininfo.rcClient.bottom);	// see comment in X11 section
	move (wininfo.rcClient.left, wininfo.rcClient.top);		// else the window frame may be off scree on top/left.
#elif defined Q_WS_X11
	KWindowInfo wininfo = KWindowSystem::windowInfo (embedded, NET::WMName | NET::WMGeometry);
	RK_ASSERT (wininfo.valid ());

	// set a fixed size until the window is shown
	xembed_container->setFixedSize (wininfo.geometry ().width (), wininfo.geometry ().height ());
	setGeometry (wininfo.geometry ());	// it's important to set a size, even while not visible. Else DetachedWindowContainer will assign a default size of 640*480, and then size upwards, if necessary.
	setCaption (wininfo.name ());
#endif

	// somehow in Qt 4.4.3, when the RKCaughtWindow is reparented the first time, the QX11EmbedContainer may kill its client. Hence we delay the actual embedding until after the window was shown.
	// In some previous version of Qt, this was not an issue, but I did not track the versions.
	QTimer::singleShot (0, this, SLOT (doEmbed()));
}
开发者ID:KDE,项目名称:rkward,代码行数:33,代码来源:rkwindowcatcher.cpp


示例6: is_valid_window

static int is_valid_window(HWND hwnd)
{
	WINDOWINFO wi;
	wi.cbSize = sizeof(wi);
	GetWindowInfo(hwnd, &wi);
	return (wi.dwStyle & WS_VISIBLE) && !(wi.dwExStyle & WS_EX_TOOLWINDOW);
}
开发者ID:abhisheknair,项目名称:virgo,代码行数:7,代码来源:virgo.c


示例7: maybeAddWindow

static
bool maybeAddWindow(HWND hwnd, std::vector<QRect> *windows) {
    WINDOWINFO wi;
    GetWindowInfo( hwnd, &wi );
    RECT rect = wi.rcClient;

#if 0
    RECT rect;
    GetWindowRect( hwnd, &rect );
#endif

    int width = rect.right - rect.left;
    int height = rect.bottom - rect.top;

    // For some reason, rect.left and rect.top are shifted by cxWindowBorders and cyWindowBorders pixels respectively 
    // in *every* case (for every window), but cxWindowBorders and cyWindowBorders are non-zero only in the 
    // biggest-window case, therefore we need to save the biggest cxWindowBorders and cyWindowBorders to adjust the rect later
    cxWindowBorder = qMax(cxWindowBorder, wi.cxWindowBorders);
    cyWindowBorder = qMax(cyWindowBorder, wi.cyWindowBorders);

    if ( ( ( wi.dwStyle & WS_VISIBLE ) != 0 ) && (width >= minSize ) && (height >= minSize ) )
    {
        //QRect r( rect.left + 4, rect.top + 4, width, height); // 4 = max(wi.cxWindowBorders) = max(wi.cyWindowBorders)
        QRect r(rect.left + cxWindowBorder, rect.top + cyWindowBorder, width, height);
		if ( std::find( windows->begin(), windows->end(), r ) == windows->end() ) {
            windows->push_back( r );
            return true;
                }
    }
    return false;
}
开发者ID:KDE,项目名称:ksnapshot,代码行数:31,代码来源:windowgrabber.cpp


示例8: draw_hilight_box

static void draw_hilight_box (HWND hWnd, HDC hdc, COOLBARITEMDATA* item)
{
    int  l,r,t,b; 
    WINDOWINFO *info = (WINDOWINFO*)GetWindowInfo (hWnd);
    DWORD color;
    DWORD mainc = GetWindowElementAttr (hWnd, WE_MAINC_THREED_BODY);

    l = item->RcTitle.left;
    t = item->RcTitle.top;
    r = item->RcTitle.right - 1;
    b = item->RcTitle.bottom - 1;

    color = info->we_rdr->calc_3dbox_color (mainc, LFRDR_3DBOX_COLOR_DARKER);
    SetPenColor (hdc,
            RGBA2Pixel (hdc, GetRValue (color), GetGValue (color), 
                GetBValue (color), GetAValue (color)));
    MoveTo (hdc, l, t);
    LineTo (hdc, l, b);
    MoveTo (hdc, r - 1, t);
    LineTo (hdc, r - 1, b);

    color = info->we_rdr->calc_3dbox_color (mainc, LFRDR_3DBOX_COLOR_LIGHTER);
    SetPenColor (hdc,
            RGBA2Pixel (hdc, GetRValue (color), GetGValue (color), 
                GetBValue (color), GetAValue (color)));
    MoveTo (hdc, l + 1, t);
    LineTo (hdc, l + 1, b);
    MoveTo (hdc, r, t);
    LineTo (hdc, r, b);
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:30,代码来源:coolbar.c


示例9: InitInstance

//
//   ‘”Ќ ÷»я: InitInstance(HINSTANCE, int)
//
//   Ќј«Ќј„≈Ќ»≈: сохран¤ет обработку экземпл¤ра и создает главное окно.
//
//    ќћћ≈Ќ“ј–»»:
//
//        ¬ данной функции дескриптор экземпл¤ра сохран¤етс¤ в глобальной переменной, а также
//        создаетс¤ и выводитс¤ на экран главное окно программы.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   HWND hWnd;

   hInst = hInstance; // —охранить дескриптор экземпл¤ра в глобальной переменной

   //Samsung Galaxy S+ Screen Resolution
   int WINDOW_WIDTH = 800;
   int WINDOW_HEIGHT = 480;

   hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, 
	   CW_USEDEFAULT, CW_USEDEFAULT, WINDOW_WIDTH, WINDOW_HEIGHT, NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
      return FALSE;
   }

   RECT rect = { 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT };
   WINDOWINFO info;
   GetWindowInfo(hWnd, &info);
   AdjustWindowRectEx(&rect, info.dwStyle, GetMenu(hWnd) != NULL, info.dwExStyle);
   MoveWindow(hWnd, 0, 0, (rect.right - rect.left), (rect.bottom - rect.top), FALSE); 

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return TRUE;
}
开发者ID:merelalkar,项目名称:zlpacman,代码行数:39,代码来源:asteroids.cpp


示例10: GetWindowInformation

void GetWindowInformation()
{

	TCHAR buf[256];

	GetCursorPos (&g_ptMouse);

	memset(&g_WinInfo, 0, sizeof(g_WinInfo));

	g_WinInfo.hwnd  = WindowFromPoint(g_ptMouse);

	RealGetWindowClass(g_WinInfo.hwnd , g_WinInfo.szWindowClass, sizeof(g_WinInfo.szWindowClass));
	GetWindowInfo(g_WinInfo.hwnd , &g_WinInfo.wi );

	int id = GetDlgCtrlID(g_WinInfo.hwnd );

	HWND hwndEdit = GetDlgItem(g_hWndMain,ID_EDITCHILD);

	_stprintf_s(buf, _T("「WindowClass」=%s 「CtrlID」=0x%p 「Location」=%d,%d"), g_WinInfo.szWindowClass, id, 
		g_WinInfo.wi.rcWindow.right - g_WinInfo.wi.rcWindow.left  , 
		g_WinInfo.wi.rcWindow.bottom - g_WinInfo.wi.rcWindow.top);

	// Add text to the window. 
	//SendMessage(hwndEdit, WM_SETTEXT, 0, (LPARAM) buf);

	InvalidateRect(g_hWndMain,NULL,FALSE);
}
开发者ID:janseM3319,项目名称:cchelper,代码行数:27,代码来源:WinMain.cpp


示例11: GetWindowInfo

/*static*/ WindowInfo WindowInfo::about (int64_t wid){
	HWND win = (HWND) (wid);
	WINDOWINFO info;
	GetWindowInfo(win, &info);

	bool isVisible = (info.dwStyle & WS_VISIBLE) != 0;

	if (isVisible) {
		char title [512] = "";
		GetWindowText (win, title, (sizeof title) - 1);

		DWORD process;
		GetWindowThreadProcessId (win, &process);


		WindowInfo dst;
		dst.title = title;
		dst.id    = (int64_t) win; // At least in Win7 Window Handles seem unique and could also be interpreted as IDs
		dst.pid   = process;
		dst.area  = dz::Rect(info.rcWindow.left, info.rcWindow.top, info.rcWindow.right - info.rcWindow.left, info.rcWindow.bottom - info.rcWindow.top);
		return dst;
	} else {
		// do not count invisible windows
		return WindowInfo ();
	}
}
开发者ID:dozeo,项目名称:screengrabber,代码行数:26,代码来源:WindowInfo.cpp


示例12: _ecore_win32_event_handle_configure_notify

void
_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
{
   WINDOWINFO                          wi;
   Ecore_Win32_Event_Window_Configure *e;
   WINDOWPOS                          *window_pos;

   INF("window configure notify");

   e = calloc(1, sizeof(Ecore_Win32_Event_Window_Configure));
   if (!e) return;

   window_pos = (WINDOWPOS *)msg->data_param;
   wi.cbSize = sizeof(WINDOWINFO);
   if (!GetWindowInfo(window_pos->hwnd, &wi))
     {
        free(e);
        return;
     }

   e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
   e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA);
   e->x = wi.rcClient.left;
   e->y = wi.rcClient.top;
   e->width = wi.rcClient.right - wi.rcClient.left;
   e->height = wi.rcClient.bottom - wi.rcClient.top;
   e->timestamp = _ecore_win32_event_last_time;

   ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CONFIGURE, e, NULL, NULL);
}
开发者ID:Limsik,项目名称:e17,代码行数:30,代码来源:ecore_win32_event.c


示例13: EnumWindowsProc

static BOOL CALLBACK EnumWindowsProc (HWND win, LPARAM user){
	EnumerateWindowSettings * settings = (EnumerateWindowSettings*) (user);

	DWORD process;
	GetWindowThreadProcessId (win, &process);

	if (settings->pid && settings->pid != process) {
		return TRUE; // skipping
	}

	WINDOWINFO info;
	GetWindowInfo(win, &info);

	char title [512] = "";
	GetWindowText (win, title, (sizeof title) - 1);

	bool isVisible = (info.dwStyle & WS_VISIBLE) != 0;
	// bool isPopup   = info.dwStyle & WS_POPUP;

	if (isVisible) {
		WindowInfo dst;
		dst.title = title;
		dst.id    = (int64_t) win; // At least in Win7 Window Handles seem unique and could also be interpreted as IDs
		dst.pid   = process;
		dst.area  = dz::Rect(info.rcWindow.left, info.rcWindow.top, info.rcWindow.right - info.rcWindow.left, info.rcWindow.bottom - info.rcWindow.top);
		settings->destination->push_back (dst);
	}
	return TRUE; // continue enumeration
}
开发者ID:dozeo,项目名称:screengrabber,代码行数:29,代码来源:WindowInfo.cpp


示例14: IsTopLevelWindow

bool IsTopLevelWindow(HWND hWnd)
{
	WINDOWINFO wi = {0};

	assert(GetWindowInfo(hWnd, &wi));



	bool WS_VISIBLE_isSet = (wi.dwStyle & WS_VISIBLE) != 0;
	bool WS_EX_NOACTIVATE_isSet = (wi.dwExStyle & WS_EX_NOACTIVATE) != 0;
	bool WS_EX_TOOLWINDOW_isSet = (wi.dwExStyle & WS_EX_TOOLWINDOW) != 0;
	bool WS_EX_APPWINDOW_isSet = (wi.dwExStyle & WS_EX_APPWINDOW) != 0;
	bool WS_POPUP_isSet = (wi.dwStyle & WS_POPUP) != 0;
	bool WS_CHILD_isSet = (wi.dwStyle & WS_CHILD) != 0;


	if (!WS_VISIBLE_isSet
		|| ((WS_EX_NOACTIVATE_isSet || WS_EX_TOOLWINDOW_isSet) && !WS_EX_APPWINDOW_isSet)
		|| hWnd == 0
		|| WS_POPUP_isSet
		|| WS_CHILD_isSet
		)
	{
		return false;
	}
	else
	{
		return true;
	}

}
开发者ID:DX94,项目名称:BumpTop,代码行数:31,代码来源:EnumProc.cpp


示例15: draw_scroll_button

/* 
 * draw_scroll_button:
 *
 * This function draw scroll button of propsheet control . 
 *
 * Author: Peng LIU
 * Date: 2007-12-05
 */
static void 
draw_scroll_button (HWND hWnd, HDC hdc, RECT *title_rc, 
    PPROPSHEETDATA propsheet, DWORD style)
{
    RECT btn_rect = {0, 0, 0, 0};
    WINDOWINFO  *info;
    DWORD color; 

    info = (WINDOWINFO*)GetWindowInfo (hWnd);
    color = GetWindowElementAttr (hWnd, WE_FGC_WINDOW);
    
    /* draw left arrow */ 
    btn_rect.top = ((style & 0xf0L) == PSS_BOTTOM) ? 
            title_rc->top + 1 + 2 : title_rc->top + 1;
    btn_rect.right = get_metrics (MWM_SB_WIDTH);
    btn_rect.bottom = ((style & 0xf0L) == PSS_BOTTOM) ? 
            title_rc->bottom + 2 - 2 : title_rc->bottom - 2 - 1;
    //SelectClipRect (hdc, &btn_rect);
    info->we_rdr->draw_arrow (hWnd, hdc, &btn_rect, color , LFRDR_ARROW_LEFT); 
 
    /* draw right arrow */
    btn_rect.left = propsheet->head_rc.right - get_metrics(MWM_SB_WIDTH);
    btn_rect.right = propsheet->head_rc.right;
    //SelectClipRect (hdc, &btn_rect);
    info->we_rdr->draw_arrow (hWnd, hdc, &btn_rect, color , LFRDR_ARROW_RIGHT);  
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:34,代码来源:propsheet.c


示例16: MmMapIoSpace

BOOL CPdd6410Uart::MapHardware() 
{
    if (m_pRegVirtualAddr !=NULL)
    {
        return TRUE;
    }

    // Get IO Window From Registry
    DDKWINDOWINFO dwi;
    if ( GetWindowInfo( &dwi)!=ERROR_SUCCESS || 
    dwi.dwNumMemWindows < 1 || 
    dwi.memWindows[0].dwBase == 0 || 
    dwi.memWindows[0].dwLen < m_dwMemLen)
    {
        return FALSE;
    }

    DWORD dwInterfaceType;
    if (m_ActiveReg.IsKeyOpened() && 
    m_ActiveReg.GetRegValue( DEVLOAD_INTERFACETYPE_VALNAME, (PBYTE)&dwInterfaceType,sizeof(DWORD)))
    {
        dwi.dwInterfaceType = dwInterfaceType;
    }

    // Translate to System Address.
    PHYSICAL_ADDRESS    ioPhysicalBase = { dwi.memWindows[0].dwBase, 0};
    ULONG                inIoSpace = 0;
    if (TranslateBusAddr(m_hParent,(INTERFACE_TYPE)dwi.dwInterfaceType,dwi.dwBusNumber, ioPhysicalBase,&inIoSpace,&ioPhysicalBase))
    {
        // Map it if it is Memeory Mapped IO.
        m_pRegVirtualAddr = MmMapIoSpace(ioPhysicalBase, dwi.memWindows[0].dwLen,FALSE);
    }

    return (m_pRegVirtualAddr!=NULL );
}
开发者ID:HITEG,项目名称:TenByTen6410_SLC,代码行数:35,代码来源:pdds3c6410_ser.cpp


示例17: enumWindowsProc

//Enumerates windows.
BOOL CALLBACK enumWindowsProc(HWND hwnd, LPARAM lParam)
{
	ZeroMemory(tbuffer, sizeof(wchar_t) * 2048);
	WINDOWINFO windowinfo;


	//Got a window by HWND: 
	if (GetWindowTextW(hwnd, tbuffer, 2048) > 0)
	{

		if (GetWindowInfo(hwnd, &windowinfo))
		{
			//Check if this is a "Window".
			if((windowinfo.dwStyle & WS_MINIMIZEBOX) && (windowinfo.dwStyle & WS_VISIBLE))
			{
				if (wcsstr(tbuffer, L"CloseAllWindows.exe") == NULL)
				{
					wcout << "Got a window by HWND: " << hwnd << " " << tbuffer << "\n";
					SendMessage(hwnd, WM_CLOSE, NULL, (LPARAM) 0);
					SendMessage(hwnd, WM_QUIT, NULL, (LPARAM) 0);
					SendMessage(hwnd, WM_DESTROY, NULL, (LPARAM) 0);
				}
				
			}
		}

	}

	return TRUE;
}
开发者ID:alwynd,项目名称:PublicGitRepo,代码行数:31,代码来源:closeWindows.cpp


示例18: drop_window_therad

static DWORD WINAPI drop_window_therad(void *arg)
{
    struct DragParam *param = arg;
    WNDCLASSA cls;
    WINDOWINFO info;
    BOOL r;
    MSG msg;

    memset(&cls, 0, sizeof(cls));
    cls.lpfnWndProc = drop_window_proc;
    cls.hInstance = GetModuleHandleA(NULL);
    cls.lpszClassName = "drop test";
    RegisterClassA(&cls);

    param->hwnd = CreateWindowA("drop test", NULL, 0, 0, 0, 0, 0,
                                NULL, 0, NULL, 0);
    ok(param->hwnd != NULL, "CreateWindow failed: %d\n", GetLastError());

    memset(&info, 0, sizeof(info));
    info.cbSize = sizeof(info);
    r = GetWindowInfo(param->hwnd, &info);
    ok(r, "got %d\n", r);
    ok(!(info.dwExStyle & WS_EX_ACCEPTFILES), "got %08x\n", info.dwExStyle);

    DragAcceptFiles(param->hwnd, TRUE);

    memset(&info, 0, sizeof(info));
    info.cbSize = sizeof(info);
    r = GetWindowInfo(param->hwnd, &info);
    ok(r, "got %d\n", r);
    ok((info.dwExStyle & WS_EX_ACCEPTFILES), "got %08x\n", info.dwExStyle);

    SetEvent(param->ready);

    while ((r = GetMessageA(&msg, NULL, 0, 0)) != 0) {
        if (r == (BOOL)-1) {
            ok(0, "unexpected return value, got %d\n", r);
            break;
        }
        DispatchMessageA(&msg);
    }

    DestroyWindow(param->hwnd);
    UnregisterClassA("drop test", GetModuleHandleA(NULL));
    return 0;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:46,代码来源:shellole.c


示例19: do_click

static void do_click(HWND window, DWORD down, DWORD up)
{
    WINDOWINFO window_info;
    long x, y;

    SetForegroundWindow(GetParent(window));
    window_info.cbSize=sizeof(window_info);
    GetWindowInfo(window, &window_info);

    /* The calculations below convert the coordinates so they are absolute
     * screen coordinates in 'Mickeys' as required by mouse_event.
     * In mickeys the screen size is always 65535x65535.
     */
    x=window_info.rcWindow.left+g_x;
    if (x<window_info.rcWindow.left || x>=window_info.rcWindow.right)
        x=(window_info.rcWindow.right+window_info.rcWindow.left)/2;
    x=(x << 16)/GetSystemMetrics(SM_CXSCREEN);

    y=window_info.rcWindow.top+g_y;
    if (y<window_info.rcWindow.top || y>=window_info.rcWindow.bottom)
        y=(window_info.rcWindow.bottom+window_info.rcWindow.top)/2;
    y=(y << 16)/GetSystemMetrics(SM_CYSCREEN);

    mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, x, y, 0, 0);
    if (down) {
        mouse_event(MOUSEEVENTF_ABSOLUTE | down, x, y, 0, 0);
        if ((g_dragto_x > 0) && (g_dragto_y > 0)) {
            int i;
            long dx, dy;
            long step_per_x, step_per_y;
            long dragto_x, dragto_y;

            dragto_x=window_info.rcWindow.left+g_dragto_x;
            if (dragto_x<window_info.rcWindow.left || dragto_x>=window_info.rcWindow.right)
                dragto_x=(window_info.rcWindow.right+window_info.rcWindow.left)/2;
            dragto_x=(dragto_x << 16)/GetSystemMetrics(SM_CXSCREEN);

            dragto_y=window_info.rcWindow.top+g_dragto_y;
            if (dragto_y<window_info.rcWindow.top || dragto_y>=window_info.rcWindow.bottom)
                dragto_y=(window_info.rcWindow.bottom+window_info.rcWindow.top)/2;
            dragto_y=(dragto_y << 16)/GetSystemMetrics(SM_CYSCREEN);

            dx = g_dragto_x - g_x;
            dy = g_dragto_y - g_y;
            step_per_x = dx / 4;
            step_per_y = dy / 4;
            for (i = 0; i < 4; i++) {
                mouse_event(MOUSEEVENTF_MOVE, step_per_x, step_per_y, 0, 0);
            }
            x=dragto_x;
            y=dragto_y;
        }
    }
    if (up)
       mouse_event(MOUSEEVENTF_ABSOLUTE | up, x, y, 0, 0);
}
开发者ID:GYGit,项目名称:reactos,代码行数:56,代码来源:wclickat.c


示例20: EnumWindowsProc

BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
	WINDOWINFO windowinfo;
	GetWindowInfo(hwnd,&windowinfo);
	char buf[256];
	buf[0]=buf[255]='\0';
	GetClassName(hwnd,buf,255);
	fprintf(swfp,"'%s' %x    %x\n",buf,hwnd,GetParent(hwnd));
	return true;
}
开发者ID:Thyfate,项目名称:melax,代码行数:10,代码来源:winsetup.cpp



注:本文中的GetWindowInfo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetWindowLong函数代码示例发布时间:2022-05-30
下一篇:
C++ GetWindowDC函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap