当前位置: 首页>>代码示例>>C++>>正文


C++ DestroyWindow函数代码示例

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


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

示例1: ASSERT

void CXTPPropertyGridInplaceList::Create(CXTPPropertyGridItem* pItem, CRect rect)
{
	ASSERT(pItem && pItem->GetGrid());
	if (!pItem)
		return;

	CRect rcValue(rect);
	rcValue.left = pItem->GetGrid()->GetDividerPos() + 1;

	CWnd* pParent = (CWnd*)pItem->GetGrid();
	m_pItem = pItem;

	DestroyWindow();

	if (!m_hWnd)
	{
		CListBox::CreateEx(WS_EX_TOOLWINDOW | (pParent->GetExStyle() & WS_EX_LAYOUTRTL), _T("LISTBOX"), _T(""),
			LBS_NOTIFY | WS_CHILD | WS_VSCROLL | WS_BORDER | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS, CRect(0, 0, 0, 0), pParent, 0);
		SetOwner(pParent);


		if (m_bShowShadow && XTPSystemVersion()->IsWinXPOrGreater())
			SetClassLongPtr(m_hWnd, GCL_STYLE, GetClassLongPtr(m_hWnd, GCL_STYLE) | 0x00020000);
	}
	SetFont(pParent->GetFont());

	ResetContent();

	CXTPPropertyGridItemConstraints* pList = pItem->GetConstraints();


	int dx = rect.right - rcValue.left;

	CWindowDC dc(pParent);
	CXTPFontDC font(&dc, pParent->GetFont());
	int nHeight = dc.GetTextExtent(_T(" "), 1).cy + 3;

	for (int i = 0; i < pList->GetCount(); i++)
	{
		CXTPPropertyGridItemConstraint* pConstraint = pList->GetConstraintAt(i);

		CString str = pConstraint->m_strConstraint;
		int nIndex = AddString(str);
		SetItemDataPtr(nIndex, pConstraint);

		CSize sz = pItem->OnMergeItemConstraint(&dc, pConstraint);

		dx = max(dx, sz.cx);
		nHeight = max(nHeight, sz.cy);

		if (pItem->GetValue() == str)
			SetCurSel(nIndex);
	}

	SetItemHeight(0, nHeight);

	rect.top = rect.bottom;
	rect.bottom += nHeight * __min(pItem->GetDropDownItemCount(), GetCount()) + 2;
	rect.left = rect.right - __min(dx, rect.Width() - XTP_PGI_EXPAND_BORDER);

	pParent->ClientToScreen(&rect);

	CRect rcWork = XTPMultiMonitor()->GetWorkArea(rect);
	if (rect.bottom > rcWork.bottom && rect.top > rcWork.CenterPoint().y)
	{
		rect.OffsetRect(0, - rect.Height() - rcValue.Height() - 1);
	}
	if (rect.left < rcWork.left) rect.OffsetRect(rcWork.left - rect.left, 0);
	if (rect.right > rcWork.right) rect.OffsetRect(rcWork.right - rect.right, 0);


	SetFocus();


	SetWindowLongPtr(m_hWnd, GWLP_HWNDPARENT, 0);
	ModifyStyle(WS_CHILD, WS_POPUP);
	SetWindowLongPtr(m_hWnd, GWLP_HWNDPARENT, (LONG_PTR)pParent->m_hWnd);

	SetWindowPos(&CWnd::wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOOWNERZORDER);

	CXTPMouseMonitor::SetupHook(this);
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:82,代码来源:XTPPropertyGridInplaceList.cpp

示例2: DestroyWindow

void CMainDlg::CloseDialog(int nVal)
{
	DestroyWindow();
	::PostQuitMessage(nVal);
}
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:5,代码来源:MainDlg.cpp

示例3: WndProc

//
//  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_COMMAND	- process the application menu
//  WM_PAINT	- Paint the main window
//  WM_DESTROY	- post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc,bmp_dc;
  HGDIOBJ oldbmp;
  OGUI::Image target(640, 480, (unsigned char*)bitmap_pixels);
  RECT rect;
  int x, y;

  rect.left = rect.top = 0;
  rect.right = 640;
  rect.bottom = 480;

	switch (message)
	{
	case WM_COMMAND:
		wmId    = LOWORD(wParam);
		wmEvent = HIWORD(wParam);
		// Parse the menu selections:
		switch (wmId)
		{
		case IDM_ABOUT:
			DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
			break;
		case IDM_EXIT:
			DestroyWindow(hWnd);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
		}
		break;
  case WM_TIMER:
    if (OGUI::OGUIManager::instance()->get_desktop()->draw(target, OGUI::Rect(0, 0, 640, 480)))
      InvalidateRect(hWnd, &rect, FALSE);
    break;
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &ps);
    bmp_dc = CreateCompatibleDC(hdc);
    oldbmp=SelectObject(bmp_dc, bitmap);
    BitBlt(hdc, 0, 0, 640, 480, bmp_dc, 0, 0, SRCCOPY);
    SelectObject(bmp_dc, oldbmp);
    DeleteDC(bmp_dc);
		EndPaint(hWnd, &ps);
		break;
  case WM_LBUTTONDOWN:
    x = GET_X_LPARAM(lParam);
    y = GET_Y_LPARAM(lParam);
    OGUI::OGUIManager::instance()->mouse_down(0, x, y);
    break;
  case WM_LBUTTONUP:
    x = GET_X_LPARAM(lParam);
    y = GET_Y_LPARAM(lParam);
    OGUI::OGUIManager::instance()->mouse_up(0, x, y);
    break;
  case WM_MOUSEMOVE:
    x = GET_X_LPARAM(lParam);
    y = GET_Y_LPARAM(lParam);
    OGUI::OGUIManager::instance()->mouse_move(x, y);
    break;
  case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}
开发者ID:GamingAtheist,项目名称:ogui,代码行数:78,代码来源:wmain.cpp

示例4: mfd_OnCommand

/*
 * OnCommand()
 */
void mfd_OnCommand(HWND mtfDlg, UINT ctrlID, HWND ctrl, UINT notify)
{
    switch (ctrlID) {
        /*
         * Menus
         */
        case IDM_RETRIEVE_MTF:
            TX81Z_RetrieveData(Prog_midi, REQ_MTF, &Prog_snapshot);
            SendMessage(Prog_mainWnd, WM_COMMAND
                    , MAKEWPARAM(IDD_MTFDLG, EDN_CHANGE)
                    , (LPARAM) mtfDlg);
            MTGen_InitControlValues(&mfd_dlgData);
            break;
        case IDM_TRANSMIT_MTF:
            TX81Z_SendData(Prog_midi, REQ_MTF, &Prog_snapshot);
            break;
        case IDM_EXIT:
            PostMessage(Prog_mainWnd, WM_COMMAND, IDM_EXIT, 0L);
        case IDM_CLOSE:
        case IDCANCEL:
            DestroyWindow(mtfDlg);
            return;
        case IDM_UNDO:
            Undo_Undo(mfd_dlgData.undo, MTGen_Undo, mtfDlg);
            goto UpdateUndoMenus;
        case IDM_REDO:
            Undo_Redo(mfd_dlgData.undo, MTGen_Redo, mtfDlg);
UpdateUndoMenus:
            EnableMenuItem(mfd_dlgData.menu, IDM_UNDO
                    , MF_BYCOMMAND | (Undo_AnyUndoes(mfd_dlgData.undo)
                        ? MF_ENABLED : MF_GRAYED));
            EnableMenuItem(mfd_dlgData.menu, IDM_REDO
                    , MF_BYCOMMAND | (Undo_AnyRedoes(mfd_dlgData.undo)
                        ? MF_ENABLED : MF_GRAYED));
            return;
        case IDM_KYBDDLG:
        case IDM_REMOTEWND:
        case IDM_MAINWND:
        case IDM_VOICEDLG:
        case IDM_PFMDLG:
        case IDM_FXDLG:
        case IDM_PCDLG:
        case IDM_MTODLG:
        case IDM_MTFDLG:
        case IDM_SYSDLG:
            SendMessage(Prog_mainWnd, WM_COMMAND, ctrlID, 0);
            return;
        case IDM_HELP:
            Prog_OpenHelp(mtfDlg, _T("microtunings_editors.html"));
            return;
    }
    /*
     * Init microtunings menu items.
     */
    if (ctrlID >= IDM_EQUAL_TEMPERED && ctrlID <= IDM_1_8_TONE) {
        memcpy(&Prog_snapshot.mtf.data
                , &TX81Z_initMtf[ctrlID - IDM_EQUAL_TEMPERED][0]
                , mfd_initCnt << 1);
        TX81Z_SendData(Prog_midi, REQ_MTF, &Prog_snapshot);
        MTGen_InitControlValues(&mfd_dlgData);
        SendNotification(Prog_mainWnd, IDD_MTFDLG, mtfDlg, EDN_CHANGE);
    }
    /*
     * LCD Controls
     */
    if (ctrlID >= IDC_MT_NOTE_1 && ctrlID < IDC_MT_FREQ_1
            && notify == LCN_SELCHANGE)
    {
        int value = LcdCtrl_GetValue(ctrl);

        /*
         * If the control is a full tuning LCD.
         */
        if (ctrlID >= IDC_MT_FULL_1 && ctrlID < IDC_MT_FREQ_1) {
            MTGen_FullLcdChange(&mfd_dlgData, ctrlID, value);
        /*
         * If the control is a note LCD.
         */
        } else if ((ctrlID & 1) == 0) {
            MTGen_NoteLcdChange(&mfd_dlgData, ctrlID, value);
        /*
         * Else the control is a fine frequency LCD.
         */
        } else {
            MTGen_FineLcdChange(&mfd_dlgData, ctrlID, value);
        }
    }
}
开发者ID:fourks,项目名称:tx81z-programmer,代码行数:91,代码来源:mtfdlg.c

示例5: WndProc

//
//  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_COMMAND  - process the application menu
//  WM_PAINT    - Paint the main window
//  WM_DESTROY  - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
	case 1998:
	{
		SetWindowText(hWnd, L"Catch");
		if (!hNew)
		{
			hNew = CreateWindow(TEXT("BUTTON"), TEXT("NEW"), WS_CHILD | WS_VISIBLE, x1, y1, x2, y2, ::hWnd, (HMENU)995, nullptr, nullptr);
		}
		else 
		{
			DestroyWindow(hNew);
			hNew = CreateWindow(TEXT("BUTTON"), TEXT("NEW"), WS_CHILD | WS_VISIBLE, x1, y1, x2, y2, ::hWnd, (HMENU)995, nullptr, nullptr);
		}
		//InvalidateRect(hNew, NULL, FALSE);
		//UpdateWindow(hWnd);
		break;
	}
	case WM_COMMAND:
	{
		int wmId = LOWORD(wParam);
		// Parse the menu selections:
		switch (wmId)
		{
		case 999:
		{
			if (!hDlg)
			{
				hDlg = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DIALOG1), hWnd, DLGPROC(DlgProc));
			}
			else
			{
				DestroyWindow(hDlg);
				hDlg = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DIALOG1), hWnd, DLGPROC(DlgProc));
			}
			SetWindowText(hWnd, L"Wait enter...");
			ShowWindow(hDlg, 1);
		}
		break;
		case IDM_EXIT:
			DestroyWindow(hWnd);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
		}
	}
	break;
	case WM_PAINT:
	{
		PAINTSTRUCT ps;
		HDC hdc = BeginPaint(hWnd, &ps);
		// TODO: Add any drawing code that uses hdc here...
		EndPaint(hWnd, &ps);
	}
	break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}
开发者ID:haiirost,项目名称:DrawButton,代码行数:75,代码来源:DrawButton.cpp

示例6: switch

LRESULT CALLBACK DeviceStatus::WindowsMessageCallback(  HWND hwnd, 
                                                        UINT message, 
                                                        WPARAM wParam, 
                                                        LPARAM lParam)
{

	switch (message)
	{
	case WM_CREATE:
		{
			// Setup window user data with device status object pointer.
			LPCREATESTRUCT create_struct = reinterpret_cast<LPCREATESTRUCT>(lParam);
			void *lpCreateParam = create_struct->lpCreateParams;
			DeviceStatus *pDeviceStatus = reinterpret_cast<DeviceStatus*>(lpCreateParam);

			SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pDeviceStatus));
		}
		return 0;	// Return 0 for successfully handled WM_CREATE.

	case WM_DEVICECHANGE:
		{
			WORD loword = LOWORD(wParam);

			if (loword != DBT_DEVICEARRIVAL &&
				loword != DBT_DEVICEREMOVECOMPLETE) 
			{
				// Ignore messages other than device arrive and remove complete 
                // (we're not handling intermediate ones).
				return TRUE;	// Grant WM_DEVICECHANGE request.
			}

			DEV_BROADCAST_DEVICEINTERFACE* hdr;
			hdr = (DEV_BROADCAST_DEVICEINTERFACE*) lParam;

			if (hdr->dbcc_devicetype != DBT_DEVTYP_DEVICEINTERFACE) 
			{
				// Ignore non interface device messages.
				return TRUE;	// Grant WM_DEVICECHANGE request.
			}

			LONG_PTR userData = GetWindowLongPtr(hwnd, GWLP_USERDATA);
			OVR_ASSERT(userData != NULL);

			// Call callback on device messages object with the device path.
			DeviceStatus* pDeviceStatus = (DeviceStatus*) userData;
			String devicePathStr(hdr->dbcc_name);
			pDeviceStatus->MessageCallback(loword, devicePathStr);
		}
		return TRUE;	// Grant WM_DEVICECHANGE request.

	case WM_CLOSE:
		{
			LONG_PTR userData = GetWindowLongPtr(hwnd, GWLP_USERDATA);
			OVR_ASSERT(userData != NULL);
			DeviceStatus* pDeviceStatus = (DeviceStatus*) userData;
			pDeviceStatus->hMessageWindow = NULL;

			DestroyWindow(hwnd);
		}
		return 0;	// We processed the WM_CLOSE message.

	case WM_DESTROY:
		PostQuitMessage(0);
		return 0;	// We processed the WM_DESTROY message.
	}

	return DefWindowProc(hwnd, message, wParam, lParam);
}
开发者ID:PostalDude,项目名称:vrquake3,代码行数:68,代码来源:OVR_Win32_DeviceStatus.cpp

示例7: PauseBox

/* PauseBox */
int WDPROC
PauseBox(LPPW lppw)
{
	HDC hdc;
	int width, height;
	TEXTMETRIC tm;
	RECT rect;
	char *current_pause_title = lppw->Title;

#ifdef USE_MOUSE
	/* Do not try to wait for mouse events when there's no graph window open. */
	if (paused_for_mouse && !MousableWindowOpened())
		paused_for_mouse = 0;

	if (!paused_for_mouse)
#endif
	{
		if (!lppw->hPrevInstance)
			CreatePauseClass(lppw);
		GetWindowRect(GetDesktopWindow(), &rect);
		if ((lppw->Origin.x == CW_USEDEFAULT) || (lppw->Origin.x == 0))
		     lppw->Origin.x = (rect.right + rect.left) / 2;
		if ((lppw->Origin.y == CW_USEDEFAULT) || (lppw->Origin.y == 0))
		    lppw->Origin.y = (rect.bottom + rect.top) / 2;

		hdc = GetDC(NULL);
		SelectObject(hdc, GetStockObject(SYSTEM_FONT));
		GetTextMetrics(hdc, &tm);
		width  = max(24, 4 + strlen(lppw->Message)) * tm.tmAveCharWidth;
		width = min(width, rect.right-rect.left);
		height = 28 * (tm.tmHeight + tm.tmExternalLeading) / 4;
		ReleaseDC(NULL,hdc);

		lppw->hWndPause = CreateWindowEx(
		    WS_EX_DLGMODALFRAME | WS_EX_APPWINDOW,
		    szPauseClass, current_pause_title,
		    /* HBB 981202: WS_POPUPWINDOW would have WS_SYSMENU in it, but we don't
		     * want, nor need, a System menu in our Pause windows. */
		    WS_POPUP | WS_BORDER | WS_CAPTION,
		    lppw->Origin.x - width/2, lppw->Origin.y - height/2,
		    width, height,
		    lppw->hWndParent, NULL, lppw->hInstance, lppw);
		ShowWindow(lppw->hWndPause, SW_SHOWNORMAL);
		BringWindowToTop(lppw->hWndPause);
		UpdateWindow(lppw->hWndPause);

		lppw->bPause = TRUE;
		lppw->bPauseCancel = IDCANCEL;

		while (lppw->bPause && !ctrlc_flag) {
			if (term->waitforinput == NULL) {
				/* Only handle message queue events */ 
				WinMessageLoop();
				if (lppw->bPause && !ctrlc_flag)
					WaitMessage();
			} else {
				/* Call the non-blocking sleep function,
				   which also handles console input (caca terminal)
				   and mousing of the current terminal (e.g. qt) */
				win_sleep(50);
			}
		}

		DestroyWindow(lppw->hWndPause);
		return lppw->bPauseCancel;
	}
#ifdef USE_MOUSE
	else {
		/* Don't show the pause "OK CANCEL" dialog for "pause mouse ..."
		   Note: maybe gnuplot should display a message like
		     "gnuplot pausing (waiting for mouse click)"
		   in the window status or title bar or somewhere else. 
		*/

		while (paused_for_mouse && !ctrlc_flag) {
			if (term->waitforinput == NULL) {
				/* Only handle message queue events */ 
				WinMessageLoop();
				if (paused_for_mouse && !ctrlc_flag)
					WaitMessage();
			} else {
				/* Call the non-blocking sleep function,
				   which also handles console input (caca terminal)
				   and mousing of the current terminal (e.g. qt) */
				win_sleep(50);
			}
		}
		return !ctrlc_flag;
	}
#endif
}
开发者ID:ConstantB,项目名称:gnuplot,代码行数:92,代码来源:wpause.c

示例8: CloseProgressDialog

void CloseProgressDialog() {
   ReleaseDC(hWndMainWindow,hStartupDC); 
   DestroyWindow(hStartupWindow);
   hStartupWindow=NULL;
   doinitprogress=true;
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:6,代码来源:Progress.cpp

示例9: switch

BOOL ipod_browse_photo_dialog::DialogProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp)
{
	switch(msg)
	{
	case WM_INITDIALOG:
		{
			m_this=this;
			//m_wnd=wnd;
			ShowWindow(m_viewer.create(wnd, NULL), SW_SHOWNORMAL);
			modeless_dialog_manager::g_add(wnd);
			RECT rc;
			GetClientRect(wnd, &rc);
			on_size(wnd, rc.right, rc.bottom);
			refresh_photo();
		}
		break;
	case WM_COMMAND:
		switch (wp)
		{
		case IDCANCEL:
			DestroyWindow(wnd);
			return 0;
		case IDC_NEXT:
			if (m_index + 1< m_library.artwork_object.image_list.get_count())
			{
				m_index++;
				m_format=0;
				refresh_photo();
			}
			return 0;
		case IDC_LAST:
			if (m_library.artwork_object.image_list.get_count())
			{
				m_index = m_library.artwork_object.image_list.get_count()-1;
				m_format=0;
				refresh_photo();
			}
			return 0;
		case IDC_PREVIOUS:
			if (m_index)
			{
				m_index--;
				m_format=0;
				refresh_photo();
			}
			return 0;
		case IDC_PREVIOUS_FORMAT:
			if (m_format)
			{
				m_format--;
				refresh_photo();
			}
			return 0;
		case IDC_NEXT_FORMAT:
			if (m_index < m_library.artwork_object.image_list.get_count() && m_format + 1 < m_library.artwork_object.image_list[m_index].image_names.get_count())
			{
				m_format++;
				refresh_photo();
			}
			return 0;
		}
		break;
	case WM_SIZE:
		on_size (wnd, LOWORD(lp), HIWORD(lp));
		return 0;
	case WM_DESTROY:
		m_viewer.destroy();
		return 0;
	case WM_NCDESTROY:
		modeless_dialog_manager::g_remove(wnd);
		SetWindowLongPtr(wnd, DWL_USER, NULL);
		m_this.release();
		break;
	}
	return FALSE;
}
开发者ID:reupen,项目名称:ipod_manager,代码行数:76,代码来源:photo_browser.cpp

示例10: DestroyWindow

void SettingsEncoding::DestroyPane()
{
    DestroyWindow(hwnd);
    hwnd = NULL;
}
开发者ID:btrim,项目名称:OBS,代码行数:5,代码来源:SettingsEncoding.cpp

示例11: DestroyWindow

void CModelessDialog::OnCancel()
{
    DestroyWindow();
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:4,代码来源:DebugShadersDlg.cpp

示例12: WinMain

int WINAPI WinMain (HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpCmdLine,
                    int iCmdShow)
{
    WNDCLASS wc;
    HWND hWnd;
    HDC hDC;
    HGLRC hRC;        
    MSG msg;
    BOOL bQuit = FALSE;
    float theta = 0.0f;

    /* register window class */
    wc.style = CS_OWNDC;
    wc.lpfnWndProc = WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH);
    wc.lpszMenuName = NULL;
    wc.lpszClassName = "GLSample";
    RegisterClass (&wc);

    /* create main window */
    hWnd = CreateWindow (
      "GLSample", "OpenGL Sample", 
      WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE,
      0, 0, 256, 256,
      NULL, NULL, hInstance, NULL);

    /* enable OpenGL for the window */
    EnableOpenGL (hWnd, &hDC, &hRC);

    /* program main loop */
    while (!bQuit)
    {
        /* check for messages */
        if (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
        {
            /* handle or dispatch messages */
            if (msg.message == WM_QUIT)
            {
                bQuit = TRUE;
            }
            else
            {
                TranslateMessage (&msg);
                DispatchMessage (&msg);
            }
        }
        else
        {
            /* OpenGL animation code goes here */

            glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
            glClear (GL_COLOR_BUFFER_BIT);

            glPushMatrix ();
            glRotatef (theta, 0.0f, 0.0f, 1.0f);
            glBegin (GL_TRIANGLES);
            glColor3f (1.0f, 0.0f, 0.0f);   glVertex2f (0.0f, 1.0f);
            glColor3f (0.0f, 1.0f, 0.0f);   glVertex2f (0.87f, -0.5f);
            glColor3f (0.0f, 0.0f, 1.0f);   glVertex2f (-0.87f, -0.5f);
            glEnd ();
            glPopMatrix ();

            SwapBuffers (hDC);

            theta += .5f;
            Sleep (1);
        }
    }

    /* shutdown OpenGL */
    DisableOpenGL (hWnd, hDC, hRC);

    /* destroy the window explicitly */
    DestroyWindow (hWnd);

    return msg.wParam;
}
开发者ID:gnanasekarvelu,项目名称:miscellaneous,代码行数:84,代码来源:opengl_in_dec-cpp.c

示例13: ReleaseDC

 void WindowsPlatform::destroyWindow(void)
 {
     ReleaseDC(window, deviceContext);
     DestroyWindow(window);
 }
开发者ID:Blito,项目名称:myAHRS_plus,代码行数:5,代码来源:WindowsPlatform.cpp

示例14: DialogProc


//.........这里部分代码省略.........
			// add weapons slots to their combo box
			SendMessage(comboControl2,CB_ADDSTRING,0,reinterpret_cast<LPARAM>((LPCTSTR)"1"));
			SendMessage(comboControl2,CB_ADDSTRING,0,reinterpret_cast<LPARAM>((LPCTSTR)"2"));
			SendMessage(comboControl2,CB_ADDSTRING,0,reinterpret_cast<LPARAM>((LPCTSTR)"3"));

			// select fist item in list
			SendMessage(comboControl2, CB_SETCURSEL, last_weaponslot_selected_index, 0);


			// add inventory slots to their combo box
			for(int i = 0; i < JABIA_CHARACTER_INV_SLOTS; i++) {
				char buf[5];
				//wsprintf(buf, "%i", i);
				SendMessage(comboControl3,CB_ADDSTRING,0,reinterpret_cast<LPARAM>((LPCTSTR)buf));
			}

			// select fist item in list
			SendMessage(comboControl3, CB_SETCURSEL, 0, 0);

			break;
        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
				case IDC_COMBO1:
					switch(HIWORD(wParam))
					{
						case CBN_CLOSEUP:
							// use combo box selected index to get a character out of the vector
							last_character_selected_index = SendMessage(comboControl1, CB_GETCURSEL, 0, 0);
							ptr = jabia_characters.at(last_character_selected_index);
							fillDialog(hwnd, ptr);
							break;
					}
					break;
				case IDC_COMBO2:
					switch(HIWORD(wParam))
					{
						case CBN_CLOSEUP:
							// use combo box selected index to get weapon from inventory
							last_weaponslot_selected_index = SendMessage(comboControl2, CB_GETCURSEL, 0, 0);
							ptr = jabia_characters.at(last_character_selected_index);
							fillDialog(hwnd, ptr);
							break;
					}
					break;
				case IDC_COMBO3:
					switch(HIWORD(wParam))
					{
						case CBN_CLOSEUP:
							// use combo box selected index to get weapon from inventory
							last_inventory_selected_index = SendMessage(comboControl3, CB_GETCURSEL, 0, 0);
							ptr = jabia_characters.at(last_character_selected_index);
							fillDialog(hwnd, ptr);
							break;
					}
					break;
                case IDSET:
					//char buf[50];
					//wsprintf(buf, "Setting");
					ptr = jabia_characters.at(last_character_selected_index);
					setCharacter(hwnd, ptr);
					break;
				case IDM_HEAL_CHARACTER:					
					ptr = jabia_characters.at(last_character_selected_index);
					heal_character(ptr);
					fillDialog(hwnd, ptr);
					break;
				case IDM_KILL_CHARACTER:					
					ptr = jabia_characters.at(last_character_selected_index);
					kill_character(ptr);
					fillDialog(hwnd, ptr);
					break;
				case IDM_STUN_CHARACTER:
					ptr = jabia_characters.at(last_character_selected_index);
					stun_character(ptr);
					fillDialog(hwnd, ptr);
					break;
				case IDM_EQUIPMENT1:
					ptr = jabia_characters.at(last_character_selected_index);
					give_equipment1(ptr);
					fillDialog(hwnd, ptr);
					break;
				case IDM_DUMP_CHARACTER:					
					ptr = jabia_characters.at(last_character_selected_index);
					dump_current_character(hwnd, ptr);
					break;
				case IDM_DUMP_ALL:				
					dump_all_characters(hwnd);
					break;
                case IDCANCEL:
                    DestroyWindow(hwnd);
					PostQuitMessage(0);
					break;
            }
        break;
        default:
            return FALSE;
    }
    return FALSE;
}
开发者ID:jamesking0005,项目名称:JA-BiA-Tools,代码行数:101,代码来源:JABIA_debug.cpp

示例15: PerfCounterDialogProc

static INT_PTR CALLBACK PerfCounterDialogProc(
    _In_ HWND hwndDlg,
    _In_ UINT uMsg,
    _In_ WPARAM wParam,
    _In_ LPARAM lParam
    )
{
    PPH_PERFMON_SYSINFO_CONTEXT context = NULL;

    if (uMsg == WM_INITDIALOG)
    {
        context = (PPH_PERFMON_SYSINFO_CONTEXT)lParam;

        SetProp(hwndDlg, L"Context", (HANDLE)context);
    }
    else
    {
        context = (PPH_PERFMON_SYSINFO_CONTEXT)GetProp(hwndDlg, L"Context");

        if (uMsg == WM_DESTROY)
        {
            PhDeleteLayoutManager(&context->LayoutManager);

            PhDeleteGraphState(&context->GraphState);

            if (context->GraphHandle)
                DestroyWindow(context->GraphHandle);

            PhUnregisterCallback(&PhProcessesUpdatedEvent, &context->ProcessesUpdatedRegistration);

            RemoveProp(hwndDlg, L"Context");
        }
    }

    if (context == NULL)
        return FALSE;

    switch (uMsg)
    {
    case WM_INITDIALOG:
        {
            PPH_LAYOUT_ITEM panelItem;

            context->WindowHandle = hwndDlg;

            // Create the graph control.
            context->GraphHandle = CreateWindow(
                PH_GRAPH_CLASSNAME,
                NULL,
                WS_VISIBLE | WS_CHILD | WS_BORDER,
                0,
                0,
                3,
                3,
                hwndDlg,
                NULL,
                (HINSTANCE)PluginInstance->DllBase,
                NULL
                );
            Graph_SetTooltip(context->GraphHandle, TRUE);

            PhInitializeGraphState(&context->GraphState);
            PhInitializeLayoutManager(&context->LayoutManager, hwndDlg);

            PhAddLayoutItem(&context->LayoutManager, GetDlgItem(hwndDlg, IDC_COUNTERNAME), NULL, PH_ANCHOR_LEFT | PH_ANCHOR_TOP | PH_ANCHOR_RIGHT | PH_LAYOUT_FORCE_INVALIDATE);
            panelItem = PhAddLayoutItem(&context->LayoutManager, GetDlgItem(hwndDlg, IDC_GRAPH_LAYOUT), NULL, PH_ANCHOR_ALL);
            PhAddLayoutItemEx(&context->LayoutManager, context->GraphHandle, NULL, PH_ANCHOR_ALL, panelItem->Margin);

            SendMessage(GetDlgItem(hwndDlg, IDC_COUNTERNAME), WM_SETFONT, (WPARAM)context->SysinfoSection->Parameters->LargeFont, FALSE);
            SetDlgItemText(hwndDlg, IDC_COUNTERNAME, context->SysinfoSection->Name.Buffer);

            PhRegisterCallback(
                &PhProcessesUpdatedEvent,
                ProcessesUpdatedHandler,
                context,
                &context->ProcessesUpdatedRegistration
                );

            PerfCounterUpdateGraphs(context);
        }
        break;
    case WM_SIZE:
        PhLayoutManagerLayout(&context->LayoutManager);
        break;
    case WM_NOTIFY:
        {
            NMHDR* header = (NMHDR*)lParam;

            if (header->hwndFrom == context->GraphHandle)
            {
                switch (header->code)
                {
                case GCN_GETDRAWINFO:
                    {
                        PPH_GRAPH_GETDRAWINFO getDrawInfo = (PPH_GRAPH_GETDRAWINFO)header;
                        PPH_GRAPH_DRAW_INFO drawInfo = getDrawInfo->DrawInfo;

                        drawInfo->Flags = PH_GRAPH_USE_GRID;
                        context->SysinfoSection->Parameters->ColorSetupFunction(drawInfo, PhGetIntegerSetting(L"ColorCpuKernel"), 0);

//.........这里部分代码省略.........
开发者ID:chosen1,项目名称:ProcessHacker,代码行数:101,代码来源:graph.c


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