这篇教程C++ DestroyWindow函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DestroyWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ DestroyWindow函数的具体用法?C++ DestroyWindow怎么用?C++ DestroyWindow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DestroyWindow函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ASSERTvoid 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,
示例2: DestroyWindowvoid CMainDlg::CloseDialog(int nVal){ DestroyWindow(); ::PostQuitMessage(nVal);}
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:5,
示例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,
示例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,
示例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,
示例6: switchLRESULT 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,
示例7: PauseBox/* PauseBox */int WDPROCPauseBox(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,
示例8: CloseProgressDialogvoid CloseProgressDialog() { ReleaseDC(hWndMainWindow,hStartupDC); DestroyWindow(hStartupWindow); hStartupWindow=NULL; doinitprogress=true;}
开发者ID:Acrobot,项目名称:LK8000,代码行数:6,
示例9: switchBOOL 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,
示例10: DestroyWindowvoid SettingsEncoding::DestroyPane(){ DestroyWindow(hwnd); hwnd = NULL;}
开发者ID:btrim,项目名称:OBS,代码行数:5,
示例11: DestroyWindowvoid CModelessDialog::OnCancel(){ DestroyWindow();}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:4,
示例12: WinMainint 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,
示例13: ReleaseDC void WindowsPlatform::destroyWindow(void) { ReleaseDC(window, deviceContext); DestroyWindow(window); }
开发者ID:Blito,项目名称:myAHRS_plus,代码行数:5,
示例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,
示例15: PerfCounterDialogProcstatic 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,
示例16: WndProcLRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam){ static int nWidth, nHeight; switch(iMsg) { case WM_CREATE: { SpiderWnd.Create(hwnd, 0, WS_CHILD | WS_VISIBLE, 0, 0, 100, 100); dwDifficulty = IDC_DIF_ONECOLOR; CreateSpider(); SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOZORDER); dwAppStartTime = GetTickCount(); return 0; } case WM_DESTROY: PostQuitMessage(0); return 0; case WM_SIZE: nWidth = LOWORD(lParam); nHeight = HIWORD(lParam); MoveWindow(SpiderWnd, 0, 0, nWidth, nHeight, TRUE); return 0; case WM_GETMINMAXINFO: { MINMAXINFO *mmi; mmi = (MINMAXINFO *)lParam; mmi->ptMinTrackSize.x = NUM_STACKS * __cardwidth + (NUM_STACKS + 3) * X_BORDER + 12; // Border left and right of 6px mmi->ptMinTrackSize.y = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYMENU) + 2 * Y_BORDER + 3 * __cardheight + 6 * yRowStackCardOffset; return 0; } case WM_COMMAND: switch(LOWORD(wParam)) { case IDM_GAME_NEW: NewGame(); return 0; case IDM_GAME_DECK: ShowDeckOptionsDlg(hwnd); return 0; case IDM_HELP_CONTENTS: WinHelp(hwnd, szHelpPath, HELP_CONTENTS, 0);//HELP_KEY, (DWORD)"How to play"); return 0; case IDM_HELP_ABOUT: MessageBox(hwnd, MsgAbout, szAppName, MB_OK|MB_ICONINFORMATION); return 0; case IDM_GAME_EXIT: PostMessage(hwnd, WM_CLOSE, 0, 0); return 0; } return 0; case WM_CLOSE: if (fGameStarted == false) { DestroyWindow(hwnd); return 0; } else { int ret; ret = MessageBox(hwnd, MsgQuit, szAppName, MB_YESNO|MB_ICONQUESTION); if (ret == IDYES) { WinHelp(hwnd, szHelpPath, HELP_QUIT, 0); DestroyWindow(hwnd); } } return 0; } return DefWindowProc (hwnd, iMsg, wParam, lParam);}
开发者ID:GYGit,项目名称:reactos,代码行数:91,
示例17: KillGLWindowGLvoid KillGLWindow( GLvoid ) // Корректное разрушение окна{ if( fullscreen ) { // Мы в полноэкранном режиме? ChangeDisplaySettings( NULL, 0 ); // Если да, то переключаемся обратно в оконный режим ShowCursor( TRUE ); // Показать курсор мышки } if( hRC ) // Существует ли Контекст Рендеринга? { if( !wglMakeCurrent( NULL, NULL ) ) // Возможно ли освободить RC и DC? { MessageBox( NULL, "Release Of DC And RC Failed.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION ); } if( !wglDeleteContext( hRC ) ) // Возможно ли удалить RC? { MessageBox( NULL, "Release Rendering Context Failed.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION ); } hRC = NULL; // Установить RC в NULL } if( hDC && !ReleaseDC( hWnd, hDC ) ) // Возможно ли уничтожить DC? { MessageBox( NULL, "Release Device Context Failed.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION ); hDC = NULL; // Установить DC в NULL } if(hWnd && !DestroyWindow(hWnd)) // Возможно ли уничтожить окно? { MessageBox( NULL, "Could Not Release hWnd.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION ); hWnd = NULL; // Установить hWnd в NULL } if( !UnregisterClass( "OpenGL", hInstance ) ) // Возможно ли разрегистрировать класс { MessageBox( NULL, "Could Not Unregister Class.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION); hInstance = NULL; // Установить hInstance в NULL }}
开发者ID:stden,项目名称:comp_graph,代码行数:67,
示例18: destroy_control_window//// Destroys the control communication window.//static void destroy_control_window(){ DestroyWindow(cwindow); cwindow = NULL; UnregisterClass(klass.lpszClassName, klass.hInstance);}
开发者ID:jduck,项目名称:idarub,代码行数:9,
示例19: TSButtonWndProcstatic LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam){ MButtonCtrl *bct = (MButtonCtrl *) GetWindowLongPtr(hwndDlg, 0); switch (msg) { case WM_NCCREATE: { SetWindowLong(hwndDlg, GWL_STYLE, GetWindowLong(hwndDlg, GWL_STYLE) | BS_OWNERDRAW); bct = reinterpret_cast<MButtonCtrl *>(malloc(sizeof(MButtonCtrl))); if (bct == NULL) return FALSE; bct->hwnd = hwndDlg; bct->stateId = PBS_NORMAL; bct->focus = 0; bct->hFont = reinterpret_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT)); bct->arrow = NULL; bct->defbutton = 0; bct->hIcon = bct->hIconPrivate = 0; bct->iIcon = 0; bct->hIml = 0; bct->hBitmap = NULL; bct->pushBtn = 0; bct->pbState = 0; bct->hThemeButton = NULL; bct->hThemeToolbar = NULL; bct->cHot = 0; bct->flatBtn = 0; bct->bThemed = FALSE; bct->bSkinned = bct->bSendOnDown = 0; bct->buttonItem = NULL; LoadTheme(bct); SetWindowLongPtr(hwndDlg, 0, (LONG_PTR) bct); if (((CREATESTRUCTA *) lParam)->lpszName) SetWindowText(hwndDlg, ((CREATESTRUCT *) lParam)->lpszName); return TRUE; } case WM_DESTROY: { if (bct) { if (hwndToolTips) { TOOLINFO ti; ZeroMemory(&ti, sizeof(ti)); ti.cbSize = sizeof(ti); ti.uFlags = TTF_IDISHWND; ti.hwnd = bct->hwnd; ti.uId = (UINT_PTR) bct->hwnd; if (SendMessage(hwndToolTips, TTM_GETTOOLINFO, 0, (LPARAM) &ti)) { SendMessage(hwndToolTips, TTM_DELTOOL, 0, (LPARAM) &ti); } if (SendMessage(hwndToolTips, TTM_GETTOOLCOUNT, 0, (LPARAM) &ti) == 0) { DestroyWindow(hwndToolTips); hwndToolTips = NULL; } } if (bct->hIconPrivate) DestroyIcon(bct->hIconPrivate); DestroyTheme(bct); free(bct); } SetWindowLongPtr(hwndDlg, 0, 0); break; // DONT! fall thru } case WM_SETTEXT: { bct->cHot = 0; if ((char*) lParam) { char *tmp = (char *) lParam; while (*tmp) { if (*tmp == '&' && *(tmp + 1)) { bct->cHot = tolower(*(tmp + 1)); break; } tmp++; } InvalidateRect(bct->hwnd, NULL, TRUE); lstrcpyn(bct->szText, (TCHAR *)lParam, 127); bct->szText[127] = 0; } break; } case WM_SYSKEYUP: if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == tolower((int) wParam)) { if (bct->pushBtn) { if (bct->pbState) bct->pbState = 0; else bct->pbState = 1; InvalidateRect(bct->hwnd, NULL, TRUE); } if(!bct->bSendOnDown) SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg); return 0; } break; case WM_THEMECHANGED: { if (bct->bThemed) LoadTheme(bct); InvalidateRect(bct->hwnd, NULL, TRUE); // repaint it break;//.........这里部分代码省略.........
开发者ID:dineshkummarc,项目名称:miranda-im-v0.9.47-src,代码行数:101,
示例20: MainWndProc/////////////////////////////////////////////////////////////////////// Main window message procedure. This is the window manager for// the applicationLRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static HDC hDC = NULL; // GDI Device context static HGLRC hRC = NULL; // OpenGL Rendering context switch (message) { // Window is created, the application is starting case WM_CREATE: { hDC = GetDC(hWnd); static PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), // Size of struct 1, // Version of struct PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, // PFD_TYPE_RGBA, // Always put this 32, // Always put this, size of the color buffer 0,0,0,0,0,0,0,0,0,0,0,0,0, // You have no control over 16, // Depth of the Z buffer 8, // Stencil buffer 0,0,0,0,0,0 }; // Either obsolete, or we don't care about int nPF = ChoosePixelFormat(hDC, &pfd); SetPixelFormat(hDC, nPF, &pfd); // Create rendering context hRC = wglCreateContext(hDC); wglMakeCurrent(hDC, hRC); glRenderer.Initialize(); } break; // Do not validate, this is sent repeatedly case WM_PAINT: glRenderer.Render(); SwapBuffers(hDC); if(!glRenderer.GetAnimated()) ValidateRect(hWnd, NULL); break; case WM_SIZE: glRenderer.Resize(LOWORD(lParam), HIWORD(lParam)); break; // Window is destroyed, it's the end of the application case WM_DESTROY: // Cleanup glRenderer.Shutdown(); wglMakeCurrent(hDC, NULL); wglDeleteContext(hRC); ReleaseDC(hWnd, hDC); PostQuitMessage(0); break; // Window is either full screen, or not visible case WM_ACTIVATE: { // Only handled when full screen mode if(glRenderer.GetFullScreen()) { WINDOWPLACEMENT wndPlacement; wndPlacement.length = sizeof(WINDOWPLACEMENT); wndPlacement.flags = WPF_RESTORETOMAXIMIZED; wndPlacement.ptMaxPosition.x = 0; wndPlacement.ptMaxPosition.y = 0; wndPlacement.ptMinPosition.x = 0; wndPlacement.ptMinPosition.y = 0; wndPlacement.rcNormalPosition.bottom = gDevMode.dmPelsHeight; wndPlacement.rcNormalPosition.left = 0; wndPlacement.rcNormalPosition.top = 0; wndPlacement.rcNormalPosition.right = gDevMode.dmPelsWidth; if(LOWORD(wParam) == WA_INACTIVE) { wndPlacement.showCmd = SW_SHOWMINNOACTIVE; SetWindowPlacement(hWnd, &wndPlacement); ShowCursor(TRUE); } else { wndPlacement.showCmd = SW_RESTORE; SetWindowPlacement(hWnd, &wndPlacement); ShowCursor(FALSE); } } } break; // Handle keyboard input case WM_CHAR: // Close program on ESC key press if(wParam == 27) DestroyWindow(hWnd);//.........这里部分代码省略.........
开发者ID:coolsee,项目名称:opengl,代码行数:101,
示例21: WndProc//.........这里部分代码省略......... if (state == Animate) { step = STEP; SetTimer(hWnd, ID_TIMER, 10 , NULL); //update every 10 milliseconds } InvalidateRect (hWnd, NULL, TRUE) ; break; case ID_SHOW: show = !show; if (show) ShowWindow(msgbox, SW_SHOW); else ShowWindow(msgbox, SW_HIDE); UpdateWindow(msgbox); SetFocus(hWnd); break; case ID_DIFFICULTY_LEVEL1: maxDepth = 1; break; case ID_DIFFICULTY_LEVEL2: maxDepth = 4; break; case ID_DIFFICULTY_LEVEL3: maxDepth = 8; break; case ID_DIFFICULTY_LEVEL4: maxDepth = 15; break; 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_LBUTTONDOWN: if(state == Animate) break; // do not react while moving x_mouse = short(HIWORD (lParam)/LENGTH); y_mouse = short(LOWORD (lParam)/LENGTH); state = NextState(x_mouse,y_mouse,state,board,&role,&rc); if (state == Animate) { step = STEP; SetTimer(hWnd, ID_TIMER, 10 , NULL); //update every 10 milliseconds if (role == BLACK) start = time(0); } else if (state != GameStop) { hdc = GetWindowDC(msgbox); GetClientRect (msgbox, &rect) ; switch (state){ case MovePick: s.Format(L"Next Action: Pick a piece to move."); break; case MoveDrop: s.Format(L"Next Action: Drop a piece to move."); break; case JumpPick: s.Format(L"Next Action: Pick a piece to jump."); break; case JumpDrop: s.Format(L"Next Action: Drop a piece to jump."); break; case MultiJump: s.Format(L"Next Action: You can jump again."); break;
开发者ID:benyl,项目名称:Checkers,代码行数:67,
示例22: WndProc//// 函数: WndProc(HWND, UINT, WPARAM, LPARAM)//// 目的: 处理主窗口的消息。//// WM_COMMAND - 处理应用程序菜单// WM_PAINT - 绘制主窗口// WM_DESTROY - 发送退出消息并返回////LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; static HWND hwndNextViewer; HGLOBAL hGlobal; PTSTR pGlobal; RECT rect; switch (message) { case WM_CREATE: hwndNextViewer = SetClipboardViewer(hWnd); break; case WM_CHANGECBCHAIN: if((HWND)wParam == hwndNextViewer) hwndNextViewer = (HWND)lParam; else if(hwndNextViewer) SendMessage(hwndNextViewer, message, wParam, lParam); //return 0; break; case WM_DRAWCLIPBOARD: if(hwndNextViewer) SendMessage(hwndNextViewer, message, wParam, lParam); InvalidateRect(hWnd, NULL, TRUE); //return 0; break; case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // 分析菜单选择: 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_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: 在此添加任意绘图代码... // OpenClipboard, GetClipboardData, CloseClipboard GetClientRect(hWnd, &rect); OpenClipboard(hWnd);#ifdef UNICODE hGlobal = GetClipboardData(CF_UNICODETEXT);#else hGlobal = GetClipboardData(CF_TEXT);#endif if(hGlobal != NULL) { pGlobal = (PTSTR)GlobalLock(hGlobal); DrawText(hdc, pGlobal, -1, &rect, DT_EXPANDTABS); GlobalUnlock(hGlobal); } CloseClipboard(); EndPaint(hWnd, &ps); break; case WM_DESTROY: ChangeClipboardChain(hWnd, hwndNextViewer); PostQuitMessage(0); //return 0; break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0;}
开发者ID:e232e,项目名称:ClipboardMonitor,代码行数:86,
示例23: WndProcLRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; //RECT rect; int num=0; switch (message) { case WM_CREATE: StartUp(); break; case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_FILE_NEW: StartUp(); WinCheck(); if(wongame==true) StartUp(); InvalidateRect(hWnd,NULL,FALSE); break; case IDM_ABOUT: DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); //GetClientRect(hWnd,&rect); for(int i=0;i<4;i++) for(int j=0;j<4;j++) OnPaint(hdc,j*64,i*64,Pole[i][j]); // TODO: Add any drawing code here... EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; case WM_LBUTTONDOWN: POINT pt; GetCursorPos(&pt); ScreenToClient(hWnd,&pt); SwapNum((int)pt.x/64,(int)pt.y/64); InvalidateRect(hWnd,NULL,FALSE); if(wongame == true) MessageBox(hWnd,"You Won The Game!","Congradulations !",NULL); break; case WM_WINDOWPOSCHANGED: //case WM_MOVE: InvalidateRect(hWnd,NULL,FALSE); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0;}
开发者ID:maxya,项目名称:old_sources,代码行数:67,
示例24: 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; static RECT rcce = { 0 }; static RECT rcst = { 0 }; static RECT rcsd = { 200, 200, 200, 200 }; 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_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; case WM_NCLBUTTONDOWN: { POINT pt = { 0 }; pt.x = GET_X_LPARAM(lParam); pt.y = GET_Y_LPARAM(lParam); RECT rc = { 0 }; ::GetWindowRect(hWnd, &rc); // Cursor to edge rcce.left = rc.left - pt.x; rcce.top = rc.top - pt.y; rcce.right = rc.right - pt.x; rcce.bottom = rc.bottom - pt.y; return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_ENTERSIZEMOVE: { // Snap zone = Work area ::SystemParametersInfo(SPI_GETWORKAREA, 0, &rcst, 0); } break; case WM_EXITSIZEMOVE: break; case WM_MOVING: { LPRECT lprc = (LPRECT)lParam; POINT pt = { 0 }; ::GetCursorPos(&pt); ::SnapUnsnapRect(lprc, &pt, &rcce, &rcst, &rcsd); } break; case WM_SIZING: { PRECT prc = (PRECT)lParam; switch (wParam) { case WMSZ_LEFT: if (prc->left < rcst.left + rcsd.left) prc->left = rcst.left; break; case WMSZ_RIGHT: if (prc->right > rcst.right - rcsd.right) prc->right = rcst.right; break; case WMSZ_TOP: if (prc->top < rcst.top + rcsd.top)//.........这里部分代码省略.........
开发者ID:dranger003,项目名称:Win32Project3,代码行数:101,
示例25: DestroyWindowvoid SettingsAdvanced::DestroyPane(){ DestroyWindow(hwnd); hwnd = NULL;}
开发者ID:kitez,项目名称:OBS,代码行数:5,
示例26: DestroyWindow//取消void CDlgInsureGame::OnCancel(){ DestroyWindow();}
开发者ID:lonyzone,项目名称:oathx-ogrex-editor,代码行数:5,
示例27: DlgProc//.........这里部分代码省略......... SetDlgItemText(hDlg, IDC_BTN_REFRESH, szTemp); } ShowWindow(GetDlgItem(hDlg, IDC_BTN_REFRESH), SW_SHOW); } char* pTemp = 0; if (AllocAndCopyTCtoMB(&pTemp, g_tcRawFilepath, MAX_PATH)) { StringCbCopyA(sRawFilepath, MAX_PATH, pTemp); delete[] pTemp; } pTemp = 0; if (AllocAndCopyTCtoMB(&pTemp, g_tcUrl, MAX_PATH)) { StringCbCopyA(sUrl, MAX_PATH, pTemp); delete[] pTemp; } StringCbCopyA(szVariable, MAX_LOADSTRING, "filearg"); UpdateField(hDlg, IDC_EDT_FILEPATH, sRawFilepath, MAX_PATH, true); UpdateField(hDlg, IDC_EDT_SEND_URL, sUrl, MAX_PATH, true); } return TRUE; case WM_TIMER: switch (wParam) { case IDT_REFRESH_CHROME_STATUS: if(DetectChrome(&chromeInfo, g_tcImageName)){ os.str(TEXT("")); os.clear(); os<<ltcChromeDetected<<" (pid: "<<chromeInfo.dwProcId<<")"<<std::endl; SetDlgItemText(hDlg, IDC_LBL_CHROME_STATUS, os.str().c_str()); } else { SetDlgItemText(hDlg, IDC_LBL_CHROME_STATUS, ltcChromeNotDetected); } return TRUE; } break; case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); switch (wmId) { case IDCANCEL: SendMessage(hDlg, WM_CLOSE, 0, 0); return TRUE; case IDC_BTN_SEND:{ UpdateField(hDlg, IDC_EDT_FILEPATH, sRawFilepath, MAX_PATH); UpdateField(hDlg, IDC_EDT_SEND_URL, sUrl, MAX_PATH); TCHAR tcRawFilepath[MAX_PATH]; TCHAR tcUrl[MAX_PATH]; TCHAR* pTemp = 0; if (AllocAndCopyMBtoTC(&pTemp, sUrl, MAX_PATH)) { StringCbCopy(tcUrl, MAX_PATH, pTemp); delete[] pTemp; } pTemp = 0; if (AllocAndCopyMBtoTC(&pTemp, sRawFilepath, MAX_PATH)) { StringCbCopy(tcRawFilepath, MAX_PATH, pTemp); delete[] pTemp; } TCHAR tcFullPath[MAX_PATH]; TCHAR *tcFilenamePart; if(CreateFullPath(tcRawFilepath, tcFullPath, sizeof(tcFullPath)/ sizeof(TCHAR), &tcFilenamePart) ) { char* pFilenamePart = 0; if (AllocAndCopyTCtoMB(&pFilenamePart, tcFilenamePart, MAX_PATH)) if(SendFile(GetFile(tcFullPath), tcUrl, szVariable, pFilenamePart)) { SetDlgItemText(hDlg, IDC_LBL_SEND_STATUS, ltcSendSuccess); } else { SetDlgItemText(hDlg, IDC_LBL_SEND_STATUS, ltcSendFailed); } if(pFilenamePart) delete[] pFilenamePart; } } return TRUE; case IDC_BTN_REFRESH: if(DetectChrome(&chromeInfo, g_tcImageName, true)){ SetDlgItemText(hDlg, IDC_LBL_CHROME_STATUS, ltcChromeDetected); } else { SetDlgItemText(hDlg, IDC_LBL_CHROME_STATUS, ltcChromeNotDetected); } return TRUE; } break; case WM_CLOSE: KillTimer(hDlg, IDT_REFRESH_CHROME_STATUS); DestroyWindow(hDlg); return TRUE; case WM_DESTROY: PostQuitMessage(0); return TRUE; } return FALSE;}
开发者ID:Kerogi,项目名称:swas,代码行数:101,
示例28: WndProc//.........这里部分代码省略......... switch (message) { case WM_CREATE: hInstance = (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE); wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = NULL; wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wndclass.lpszMenuName = NULL; for (i = 0; i < 4; i++) { wndclass.lpfnWndProc = ChildProc[i]; wndclass.lpszClassName = szChildClass[i]; RegisterClass(&wndclass); hwndChild[i] = CreateWindow(szChildClass[i], NULL, WS_CHILDWINDOW | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0, hwnd, (HMENU)i, hInstance, NULL); } return 0; case WM_SIZE: cxClient = LOWORD(lParam); cyClient = HIWORD(lParam); for (i = 0; i < 4; i++) MoveWindow(hwndChild[i], (i % 2) * cxClient / 2, (i > 1) * cyClient / 2, cxClient / 2, cyClient / 2, TRUE); return 0; case WM_CHAR: if (wParam == '/x1B') DestroyWindow(hwnd); return 0; case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, message, wParam, lParam);}
开发者ID:wakqaz4,项目名称:MyGame,代码行数:101,
示例29: DlgProc//.........这里部分代码省略......... if (SUCCEEDED(hr)) { // Get the recognizer's friendly name BSTR bstr; if (SUCCEEDED(pIInkRecognizer->get_Name(&bstr))) { SetDlgItemTextW(hwnd, IDC_HWR_NAME, bstr); SysFreeString(bstr); } else { SetDlgItemTextW(hwnd, IDC_HWR_NAME, L"Failed"); } // Get the recognizer's vendor info if (SUCCEEDED(pIInkRecognizer->get_Vendor(&bstr))) { SetDlgItemTextW(hwnd, IDC_HWR_VENDOR, bstr); SysFreeString(bstr); } else { SetDlgItemTextW(hwnd, IDC_HWR_VENDOR, L"Failed"); } // Release it pIInkRecognizer->Release(); pIInkRecognizer = NULL; } // Release the collection object pIInkRecognizers->Release(); pIInkRecognizers = NULL; } // Find out the name and the version of the default speech recognizer // Open key to find path of application HKEY hkeySpeech; if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, gc_wszSpeechKey, 0, KEY_READ, &hkeySpeech) == ERROR_SUCCESS) { // Query value of key to get the name of the component WCHAR wchValue[265]; ULONG cSize = sizeof(wchValue); if (RegQueryValueExW(hkeySpeech, L"DefaultDefaultTokenId", NULL, NULL, (BYTE*)wchValue, &cSize) == ERROR_SUCCESS) { int ndx = lstrlenW(L"HKEY_LOCAL_MACHINE//"); int len = lstrlenW(wchValue); if (ndx < len && RegOpenKeyExW(HKEY_LOCAL_MACHINE, &wchValue[ndx], 0, KEY_READ, &hkeySpeech) == ERROR_SUCCESS) { cSize = sizeof(wchValue); if (RegQueryValueExW(hkeySpeech, NULL, NULL, NULL, (BYTE*)wchValue, &cSize) == ERROR_SUCCESS) { SetDlgItemTextW(hwnd, IDC_SPR_NAME, wchValue); } } } } // Find out which of the controls are installed and show their version info for (int i = 0, j = 0; i < NUM_CONTROLS; i++) { // Get the component info CLSID clsid; if (SUCCEEDED(CLSIDFromProgID(gc_wszProgId[i], &clsid)) && GetComponentInfo(clsid, info) == TRUE) { SetDlgItemTextW(hwnd, gc_uiCtrlId[j][0], info.wchName); SetDlgItemTextW(hwnd, gc_uiCtrlId[j][1], info.wchVersion); j++; } } // Done with the COM CoUninitialize(); break; } case WM_DESTROY: PostQuitMessage(0); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDCLOSE: // User clicked on the "Close" button in the dialog. case IDCANCEL: // User clicked the close button ([X]) in the caption // or pressed Alt+F4. DestroyWindow(hwnd); bReturn = TRUE; break; } break; } return bReturn;}
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:101,
示例30: window_proc//.........这里部分代码省略......... ; if(!section) return TRUE; if(save_text_file(section->file, section->chain)) return TRUE;#ifndef _WIN32_WCE if(main_menu_handle) CheckMenuItem(main_menu_handle, wParam, MF_CHECKED);#endif if(tray_menu_handle) CheckMenuItem(tray_menu_handle, wParam, MF_CHECKED); message_box(section->help, MB_ICONINFORMATION); return TRUE; } switch(wParam) { case IDM_ABOUT: DialogBox(ghInst, TEXT("AboutBox"), main_window_handle, (DLGPROC)about_proc); break; case IDM_SHOW_LOG: if(visible) { ShowWindow(main_window_handle, SW_HIDE); /* hide window */ } else { ShowWindow(main_window_handle, SW_SHOWNORMAL); /* show window */ SetForegroundWindow(main_window_handle); /* bring on top */ } break; case IDM_CLOSE: ShowWindow(main_window_handle, SW_HIDE); /* hide window */ break; case IDM_EXIT: if(!error_mode) /* signal_pipe is active */ signal_post(SIGNAL_TERMINATE); DestroyWindow(main_window_handle); break; case IDM_SAVE_LOG: if(!cmdline.service) /* security */ save_log(); break; case IDM_EDIT_CONFIG:#ifndef _WIN32_WCE if(!cmdline.service) /* security */ edit_config(main_window_handle);#endif break; case IDM_RELOAD_CONFIG: if(error_mode) /* unlock daemon_thread */ SetEvent(config_ready); else /* signal_pipe is active */ signal_post(SIGNAL_RELOAD_CONFIG); break; case IDM_REOPEN_LOG: signal_post(SIGNAL_REOPEN_LOG); break; case IDM_MANPAGE:#ifndef _WIN32_WCE if(!cmdline.service) /* security */ ShellExecute(main_window_handle, TEXT("open"), TEXT("stunnel.html"), NULL, NULL, SW_SHOWNORMAL);#endif break; case IDM_HOMEPAGE:#ifndef _WIN32_WCE if(!cmdline.service) /* security */ ShellExecute(main_window_handle, TEXT("open"), TEXT("http://www.stunnel.org/"), NULL, NULL, SW_SHOWNORMAL);
开发者ID:pantheon-systems,项目名称:stunnel-dev,代码行数:67,
注:本文中的DestroyWindow函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ Detach函数代码示例 C++ DestroyTree函数代码示例 |