这篇教程C++ IsIconic函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中IsIconic函数的典型用法代码示例。如果您正苦于以下问题:C++ IsIconic函数的具体用法?C++ IsIconic怎么用?C++ IsIconic使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了IsIconic函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: directx_wnd_proc/* directx_wnd_proc: * Window procedure for the Allegro window class. */static LRESULT CALLBACK directx_wnd_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam){ PAINTSTRUCT ps; if (message == msg_call_proc) return ((int (*)(void))wparam) (); if (message == msg_suicide) { DestroyWindow(wnd); return 0; } /* See get_reverse_mapping() in wkeybd.c to see what this is for. */ if (FALSE && (message == WM_KEYDOWN || message == WM_SYSKEYDOWN)) { static char name[256]; TCHAR str[256]; WCHAR wstr[256]; GetKeyNameText(lparam, str, sizeof str); MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, str, -1, wstr, sizeof wstr); uconvert((char *)wstr, U_UNICODE, name, U_CURRENT, sizeof name); _TRACE(PREFIX_I" key[%s] = 0x%08lx;/n", name, lparam & 0x1ff0000); } switch (message) { case WM_CREATE: if (!user_wnd_proc) allegro_wnd = wnd; break; case WM_DESTROY: if (user_wnd_proc) { exit_window_modules(NULL); _win_reset_switch_mode(); } else { PostQuitMessage(0); } allegro_wnd = NULL; break; case WM_SETCURSOR: if (!user_wnd_proc || _mouse_installed) { mouse_set_syscursor(); return 1; /* not TRUE */ } break; case WM_ACTIVATE: if (LOWORD(wparam) == WA_INACTIVE) { _win_switch_out(); } else { /* Ignore the WM_ACTIVATE event if the window is minimized. */ if (HIWORD(wparam)) break; if (gfx_driver && !gfx_driver->windowed) { /* 1.2s delay to let Windows complete the switch in fullscreen mode */ SetTimer(allegro_wnd, SWITCH_TIMER, 1200, NULL); } else { /* no delay in windowed mode */ _win_switch_in(); } } break; case WM_TIMER: if (wparam == SWITCH_TIMER) { KillTimer(allegro_wnd, SWITCH_TIMER); _win_switch_in(); return 0; } break; case WM_ENTERSIZEMOVE: if (win_gfx_driver && win_gfx_driver->enter_sysmode) win_gfx_driver->enter_sysmode(); break; case WM_EXITSIZEMOVE: if (win_gfx_driver && win_gfx_driver->exit_sysmode) win_gfx_driver->exit_sysmode(); break; case WM_MOVE: if (GetActiveWindow() == allegro_wnd) { if (!IsIconic(allegro_wnd)) { wnd_x = (short) LOWORD(lparam); wnd_y = (short) HIWORD(lparam); if (win_gfx_driver && win_gfx_driver->move) win_gfx_driver->move(wnd_x, wnd_y, wnd_width, wnd_height); }//.........这里部分代码省略.........
开发者ID:Aquilon96,项目名称:ags,代码行数:101,
示例2: UpdaterWndProcINT_PTR CALLBACK UpdaterWndProc( __in HWND hwndDlg, __in UINT uMsg, __in WPARAM wParam, __in LPARAM lParam ){ switch (uMsg) { case WM_INITDIALOG: { LOGFONT lHeaderFont = { 0 }; // load the PH main icon using the 'magic' resource id. HANDLE hPhIcon = LoadImage( GetModuleHandle(NULL), MAKEINTRESOURCE(PHAPP_IDI_PROCESSHACKER), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_SHARED ); // Set our initial state as download PhUpdaterState = Download; // Set the window icon. SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hPhIcon); lHeaderFont.lfHeight = -15; lHeaderFont.lfWeight = FW_MEDIUM; lHeaderFont.lfQuality = CLEARTYPE_QUALITY | ANTIALIASED_QUALITY; // We don't check if Segoe exists, CreateFontIndirect does this for us. wcscpy_s( lHeaderFont.lfFaceName, _countof(lHeaderFont.lfFaceName), L"Segoe UI" ); // Create the font handle. FontHandle = CreateFontIndirectW(&lHeaderFont); // Set the header font. SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), WM_SETFONT, (WPARAM)FontHandle, FALSE); // Center the update window on PH if visible and not mimimized else center on desktop. PhCenterWindow(hwndDlg, (IsWindowVisible(GetParent(hwndDlg)) && !IsIconic(GetParent(hwndDlg))) ? GetParent(hwndDlg) : NULL); // Create our update check thread. UpdateCheckThreadHandle = PhCreateThread(0, (PUSER_THREAD_START_ROUTINE)CheckUpdateThreadStart, hwndDlg); } break; case WM_SHOWDIALOG: { if (IsIconic(hwndDlg)) ShowWindow(hwndDlg, SW_RESTORE); else ShowWindow(hwndDlg, SW_SHOW); SetForegroundWindow(hwndDlg); } break; case WM_CTLCOLORBTN: case WM_CTLCOLORDLG: case WM_CTLCOLORSTATIC: { HDC hDC = (HDC)wParam; HWND hwndChild = (HWND)lParam; // Check for our static label and change the color. if (GetDlgCtrlID(hwndChild) == IDC_MESSAGE) { SetTextColor(hDC, RGB(19, 112, 171)); } // Set a transparent background for the control backcolor. SetBkMode(hDC, TRANSPARENT); // set window background color. return (INT_PTR)GetSysColorBrush(COLOR_WINDOW); } case WM_COMMAND: { switch (LOWORD(wParam)) { case IDCANCEL: case IDOK: { PostQuitMessage(0); } break; case IDC_DOWNLOAD: { switch (PhUpdaterState) { case Download: { if (PhInstalledUsingSetup()) {//.........这里部分代码省略.........
开发者ID:john-peterson,项目名称:processhacker,代码行数:101,
示例3: set_active_window/******************************************************************* * set_active_window */static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ){ HWND previous = GetActiveWindow(); BOOL ret; DWORD old_thread, new_thread; CBTACTIVATESTRUCT cbt; if (previous == hwnd) { if (prev) *prev = hwnd; return TRUE; } /* call CBT hook chain */ cbt.fMouse = mouse; cbt.hWndActive = previous; if (HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hwnd, (LPARAM)&cbt, TRUE )) return FALSE; if (IsWindow(previous)) { SendMessageW( previous, WM_NCACTIVATE, FALSE, (LPARAM)hwnd ); SendMessageW( previous, WM_ACTIVATE, MAKEWPARAM( WA_INACTIVE, IsIconic(previous) ), (LPARAM)hwnd ); } SERVER_START_REQ( set_active_window ) { req->handle = wine_server_user_handle( hwnd ); if ((ret = !wine_server_call_err( req ))) previous = wine_server_ptr_handle( reply->previous ); } SERVER_END_REQ; if (!ret) return FALSE; if (prev) *prev = previous; if (previous == hwnd) return TRUE; if (hwnd) { /* send palette messages */ if (SendMessageW( hwnd, WM_QUERYNEWPALETTE, 0, 0 )) SendMessageTimeoutW( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0, SMTO_ABORTIFHUNG, 2000, NULL ); if (!IsWindow(hwnd)) return FALSE; } old_thread = previous ? GetWindowThreadProcessId( previous, NULL ) : 0; new_thread = hwnd ? GetWindowThreadProcessId( hwnd, NULL ) : 0; if (old_thread != new_thread) { HWND *list, *phwnd; if ((list = WIN_ListChildren( GetDesktopWindow() ))) { if (old_thread) { for (phwnd = list; *phwnd; phwnd++) { if (GetWindowThreadProcessId( *phwnd, NULL ) == old_thread) SendMessageW( *phwnd, WM_ACTIVATEAPP, 0, new_thread ); } } if (new_thread) { for (phwnd = list; *phwnd; phwnd++) { if (GetWindowThreadProcessId( *phwnd, NULL ) == new_thread) SendMessageW( *phwnd, WM_ACTIVATEAPP, 1, old_thread ); } } HeapFree( GetProcessHeap(), 0, list ); } } if (IsWindow(hwnd)) { SendMessageW( hwnd, WM_NCACTIVATE, (hwnd == GetForegroundWindow()), (LPARAM)previous ); SendMessageW( hwnd, WM_ACTIVATE, MAKEWPARAM( mouse ? WA_CLICKACTIVE : WA_ACTIVE, IsIconic(hwnd) ), (LPARAM)previous ); if (GetAncestor( hwnd, GA_PARENT ) == GetDesktopWindow()) PostMessageW( GetDesktopWindow(), WM_PARENTNOTIFY, WM_NCACTIVATE, (LPARAM)hwnd ); if (hwnd == GetForegroundWindow() && !IsIconic( hwnd )) USER_Driver->pSetActiveWindow( hwnd ); } /* now change focus if necessary */ if (focus) { GUITHREADINFO info; info.cbSize = sizeof(info); GetGUIThreadInfo( GetCurrentThreadId(), &info ); /* Do not change focus if the window is no more active */ if (hwnd == info.hwndActive) {//.........这里部分代码省略.........
开发者ID:elppans,项目名称:wine-staging-1.9.15_IndexVertexBlending-1.9.11,代码行数:101,
示例4: d3d_framestatic bool d3d_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg){ d3d_video_t *d3d = (d3d_video_t*)data; if (!frame) return true; RARCH_PERFORMANCE_INIT(d3d_frame); RARCH_PERFORMANCE_START(d3d_frame); // We cannot recover in fullscreen. if (d3d->needs_restore && IsIconic(d3d->hWnd)) return true; if (d3d->needs_restore && !d3d_restore(d3d)) { RARCH_ERR("[D3D]: Failed to restore./n"); return false; } if (d3d->should_resize) { d3d_calculate_rect(d3d, d3d->screen_width, d3d->screen_height, d3d->video_info.force_aspect, g_extern.system.aspect_ratio); renderchain_set_final_viewport(d3d->chain, &d3d->final_viewport); d3d_recompute_pass_sizes(d3d); d3d->should_resize = false; } // render_chain() only clears out viewport, clear out everything. D3DVIEWPORT screen_vp; screen_vp.X = 0; screen_vp.Y = 0; screen_vp.MinZ = 0; screen_vp.MaxZ = 1; screen_vp.Width = d3d->screen_width; screen_vp.Height = d3d->screen_height; d3d->dev->SetViewport(&screen_vp); d3d->dev->Clear(0, 0, D3DCLEAR_TARGET, 0, 1, 0); // Insert black frame first, so we can screenshot, etc. if (g_settings.video.black_frame_insertion) { if (d3d->dev->Present(NULL, NULL, NULL, NULL) != D3D_OK) { RARCH_ERR("[D3D]: Present() failed./n"); d3d->needs_restore = true; return true; } d3d->dev->Clear(0, 0, D3DCLEAR_TARGET, 0, 1, 0); } if (!renderchain_render(d3d->chain, frame, width, height, pitch, d3d->dev_rotation)) { RARCH_ERR("[D3D]: Failed to render scene./n"); return false; } if (d3d->font_ctx && d3d->font_ctx->render_msg) { font_params_t font_parms = {0};#ifdef _XBOX#if defined(_XBOX1) float msg_width = 60; float msg_height = 365;#elif defined(_XBOX360) float msg_width = (g_extern.lifecycle_state & (1ULL << MODE_MENU_HD)) ? 160 : 100; float msg_height = 120;#endif font_parms.x = msg_width; font_parms.y = msg_height; font_parms.scale = 21;#endif d3d->font_ctx->render_msg(d3d, msg, &font_parms); }#ifdef HAVE_MENU if (d3d->rgui && d3d->rgui->enabled) d3d_overlay_render(d3d, d3d->rgui);#endif#ifdef HAVE_OVERLAY if (d3d->overlays_enabled) { for (unsigned i = 0; i < d3d->overlays.size(); i++) d3d_overlay_render(d3d, &d3d->overlays[i]); }#endif RARCH_PERFORMANCE_STOP(d3d_frame);#ifdef HAVE_MENU if (g_extern.lifecycle_state & (1ULL << MODE_MENU) && driver.menu_ctx && driver.menu_ctx->frame) driver.menu_ctx->frame(d3d);#endif if (d3d && d3d->ctx_driver && d3d->ctx_driver->update_window_title) d3d->ctx_driver->update_window_title(d3d);//.........这里部分代码省略.........
开发者ID:OV2,项目名称:RetroArch,代码行数:101,
示例5: WindowProcLRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ if ( wmode ) { // Perform W-Mode only functionality switch ( uMsg ) { case WM_SIZING: { SIZE border; GetBorderSize(hWnd, &border); RECT *rct = (RECT*)lParam; SIZE ws = { rct->right - rct->left - border.cx, rct->bottom - rct->top - border.cy }; if ( ws.cx < WMODE_MIN_WIDTH ) { ws.cx = WMODE_MIN_WIDTH; CorrectWindowWidth(wParam, &ws, rct, &border); } if ( ws.cy < WMODE_MIN_HEIGHT ) { ws.cy = WMODE_MIN_HEIGHT; CorrectWindowHeight(wParam, &ws, rct, &border); } if ( GetKeyState(VK_CONTROL) & 0x8000 && ws.cy != ws.cx * 3 / 4 ) { if ( wParam == WMSZ_TOP || wParam == WMSZ_BOTTOM ) { ws.cx = ws.cy * 4 / 3; CorrectWindowWidth(WMSZ_RIGHT, &ws, rct, &border); } else { ws.cy = ws.cx * 3 / 4; CorrectWindowHeight( (wParam == WMSZ_RIGHT || wParam == WMSZ_LEFT) ? WMSZ_BOTTOM : wParam, &ws, rct, &border); } } if ( isCorrectVersion ) // must be correct version to reference BWDATA { if ( ws.cx >= BW::BWDATA::GameScreenBuffer.width() - WMODE_SNAP_RANGE && ws.cx <= BW::BWDATA::GameScreenBuffer.width() + WMODE_SNAP_RANGE ) { ws.cx = BW::BWDATA::GameScreenBuffer.width(); CorrectWindowWidth( (wParam == WMSZ_TOP || wParam == WMSZ_BOTTOM) ? WMSZ_RIGHT : wParam, &ws, rct, &border); } if ( ws.cy >= BW::BWDATA::GameScreenBuffer.height() - WMODE_SNAP_RANGE && ws.cy <= BW::BWDATA::GameScreenBuffer.height() + WMODE_SNAP_RANGE ) { ws.cy = BW::BWDATA::GameScreenBuffer.height(); CorrectWindowHeight( (wParam == WMSZ_RIGHT || wParam == WMSZ_LEFT) ? WMSZ_BOTTOM : wParam, &ws, rct, &border); } } break; } // case WM_SIZING case WM_SIZE: { switch ( wParam ) { case SIZE_RESTORED: { RECT tempRect; GetClientRect(hWnd, &tempRect); windowRect.right = tempRect.right; windowRect.bottom = tempRect.bottom; WriteConfig("window", "width", tempRect.right); WriteConfig("window", "height", tempRect.bottom); break; } }// wParam switch break; } // case WM_SIZE case WM_MOVE: { RECT tempRect; GetWindowRect(hWnd, &tempRect); if ( tempRect.right > 0 && tempRect.bottom > 0 && tempRect.left < GetSystemMetrics(SM_CXFULLSCREEN) && tempRect.top < GetSystemMetrics(SM_CYFULLSCREEN) ) { windowRect.left = tempRect.left; windowRect.top = tempRect.top; WriteConfig("window", "left", tempRect.left); WriteConfig("window", "top", tempRect.top); } break; } // case WM_MOVE case WM_PAINT: if ( gbWantUpdate && pBits) { static DWORD dwLastUpdate = 0; DWORD dwNewTick = GetTickCount(); if ( dwLastUpdate + (IsIconic(hWnd) ? 200 : 20) > dwNewTick ) break; dwLastUpdate = dwNewTick; gbWantUpdate = false; // begin paint//.........这里部分代码省略.........
开发者ID:Maiven,项目名称:bwapi,代码行数:101,
示例6: update_subwindowstatic int update_subwindow(void){ int x,y; RECT rd; WINDOWPOS wp; if(!sub_window) { WinID = -1; if(IsWindowVisible(mygui->subwindow) && guiInfo.sh_video && guiInfo.Playing) { ShowWindow(mygui->subwindow, SW_HIDE); return 0; } else if(!guiInfo.VideoWindow) return 0; else ShowWindow(mygui->subwindow, SW_SHOW); } /* we've come out of fullscreen at the end of file */ if((!IsWindowVisible(mygui->subwindow) || IsIconic(mygui->subwindow)) && guiInfo.VideoWindow) ShowWindow(mygui->subwindow, SW_SHOWNORMAL); /* get our current window coordinates */ GetWindowRect(mygui->subwindow, &rd); x = rd.left; y = rd.top; /* restore sub window position when coming out of fullscreen */ if(x <= 0) x = old_rect.left; if(y <= 0) y = old_rect.top; if(!guiInfo.Playing) { window *desc = NULL; int i; for (i=0; i<mygui->skin->windowcount; i++) if(mygui->skin->windows[i]->type == wiSub) desc = mygui->skin->windows[i]; rd.right = rd.left+desc->base->bitmap[0]->width; rd.bottom = rd.top+desc->base->bitmap[0]->height; sub_aspect = (float)(rd.right-rd.left)/(rd.bottom-rd.top); } else { rd.right = rd.left+guiInfo.VideoWidth; rd.bottom = rd.top+guiInfo.VideoHeight; if (movie_aspect > 0.0) // forced aspect from the cmdline sub_aspect = movie_aspect; } AdjustWindowRect(&rd, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, 0); SetWindowPos(mygui->subwindow, 0, x, y, rd.right-rd.left, rd.bottom-rd.top, SWP_NOOWNERZORDER); wp.hwnd = mygui->subwindow; wp.x = rd.left; wp.y = rd.top; wp.cx = rd.right-rd.left; wp.cy = rd.bottom-rd.top; wp.flags = SWP_NOOWNERZORDER | SWP_SHOWWINDOW; /* erase the bitmap image if there's video */ if(guiInfo.Playing != GUI_STOP && guiInfo.sh_video) SendMessage(mygui->subwindow, WM_ERASEBKGND, (WPARAM)GetDC(mygui->subwindow), 0); /* reset the window aspect */ SendMessage(mygui->subwindow, WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp); return 0;}
开发者ID:lcrs,项目名称:balls-mplayer,代码行数:75,
示例7: return //--------------------------------------------------------------------- bool D3D10RenderWindow::isVisible() const { return (mHWnd && !IsIconic(mHWnd)); }
开发者ID:milram,项目名称:ogre-1.7.4-osx,代码行数:5,
示例8: HostWndProcW//.........这里部分代码省略......... case WM_MOUSEMOVE: recordMouseEvent(lastMessage); break; case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: case WM_MBUTTONDOWN: if(GetFocus() != hwnd) SetFocus(hwnd); SetCapture(hwnd); /* capture mouse input */ recordMouseEvent(lastMessage); break; case WM_LBUTTONUP: case WM_RBUTTONUP: case WM_MBUTTONUP: if(GetFocus() != hwnd) SetFocus(hwnd); ReleaseCapture(); /* release mouse capture */ recordMouseEvent(lastMessage); break; /*keyboard events*/ case WM_KEYDOWN: case WM_SYSKEYDOWN: case WM_KEYUP: case WM_SYSKEYUP: case WM_CHAR: case WM_SYSCHAR: recordKeyboardEvent(lastMessage); break; /*window events*/ case WM_MOVE: case WM_SIZE: if ((GetWindowRect(hwnd, &boundingRect)) != 0){ sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); windowevent->action = WindowEventMetricChange; windowevent->value1 = boundingRect.left ; windowevent->value2 = boundingRect.top; windowevent->value3 = boundingRect.right; windowevent->value4 = boundingRect.bottom; windowevent->windowIndex =(int) hwnd; } break; case WM_PAINT: if ((GetWindowRect(hwnd, &boundingRect)) != 0){ sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); windowevent->action = WindowEventPaint; windowevent->value1 = boundingRect.left ; windowevent->value2 = boundingRect.top; windowevent->value3 = boundingRect.right; windowevent->value4 = boundingRect.bottom; windowevent->windowIndex =(int) hwnd; } break; case WM_CLOSE: { sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); windowevent->action = WindowEventClose; windowevent->windowIndex =(int) hwnd; } break; case WM_ACTIVATE: { sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); if (wParam == WA_INACTIVE) windowevent->action = WindowEventIconise; else windowevent->action = WindowEventActivated; windowevent->windowIndex =(int) hwnd; } break; case WM_GETMINMAXINFO: { sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); if (IsIconic(hwnd) != 0)windowevent->action = WindowEventIconise; else windowevent->action = WindowEventActivated; windowevent->windowIndex =(int) hwnd; } break; } return DefWindowProcW(hwnd,message,wParam,lParam);}
开发者ID:JeanBaptisteArnaud,项目名称:RaspLocalDebug,代码行数:101,
示例9: switchLRESULT CALLBACK Explorerplusplus::TabProxyWndProc(HWND hwnd,UINT Msg,WPARAM wParam,LPARAM lParam,int iTabId){ switch(Msg) { case WM_ACTIVATE: /* Restore the main window if necessary, and switch to the actual tab. */ if(IsIconic(m_hContainer)) { ShowWindow(m_hContainer,SW_RESTORE); } OnSelectTab(iTabId,FALSE); return 0; break; case WM_SETFOCUS: SetFocus(m_hListView[iTabId]); break; case WM_SYSCOMMAND: switch(wParam) { case SC_CLOSE: break; default: SendMessage(m_hListView[iTabId],WM_SYSCOMMAND,wParam,lParam); break; } break; /* Generate a thumbnail of the current tab. Basic procedure: 1. Generate a full-scale bitmap of the main window. 2. Overlay a bitmap of the specified tab onto the main window bitmap. 3. Shrink the resulting bitmap down to the correct thumbnail size. A thumbnail will be dynamically generated, provided the main window is not currently minimized (as we won't be able to grap a screenshot of it). If the main window is minimized, we'll use a cached screenshot of the tab (taken before the main window was minimized). */ case WM_DWMSENDICONICTHUMBNAIL: { HDC hdc; HDC hdcSrc; HBITMAP hbmTab = NULL; HBITMAP hPrevBitmap; Gdiplus::Color color(0,0,0); HRESULT hr; int iBitmapWidth; int iBitmapHeight; int iWidth; int iHeight; int iMaxWidth; int iMaxHeight; iMaxWidth = HIWORD(lParam); iMaxHeight = LOWORD(lParam); /* If the main window is minimized, it won't be possible to generate a thumbnail for any of the tabs. In that case, use a static 'No Preview Available' bitmap. */ if(IsIconic(m_hContainer)) { hbmTab = (HBITMAP)LoadImage(GetModuleHandle(0),MAKEINTRESOURCE(IDB_NOPREVIEWAVAILABLE),IMAGE_BITMAP,0,0,0); SetBitmapDimensionEx(hbmTab,223,130,NULL); } else { hbmTab = CaptureTabScreenshot(iTabId); } SIZE sz; GetBitmapDimensionEx(hbmTab,&sz); iBitmapWidth = sz.cx; iBitmapHeight = sz.cy; /* Shrink the bitmap. */ HDC hdcThumbnailSrc; HBITMAP hbmThumbnail; POINT pt; hdc = GetDC(m_hContainer); hdcSrc = CreateCompatibleDC(hdc); SelectObject(hdcSrc,hbmTab); hdcThumbnailSrc = CreateCompatibleDC(hdc); /* If the current height of the main window is less than the width, we'll create a thumbnail of maximum width; else maximum height. */ if((iBitmapWidth / iMaxWidth) > (iBitmapHeight / iMaxHeight)) { iWidth = iMaxWidth;//.........这里部分代码省略.........
开发者ID:hollylee,项目名称:explorerplusplus,代码行数:101,
示例10: MainWindowProc/* * MainWindowProc - procedure for main (root) window */WINEXPORT LRESULT CALLBACK MainWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ){ RECT rect; vi_rc rc; HANDLE hfileinfo; int cnt, i; char *buff; switch( msg ) { case WM_CREATE: root_window_id = hwnd; GetClientRect( hwnd, &rect ); edit_container_id = CreateContainerWindow( &rect ); InitWindows(); DragAcceptFiles( hwnd, TRUE ); timerID = SetTimer( hwnd, TIMER_ID, 60L * 1000L, NULL ); break; case WM_DROPFILES: hfileinfo = (HANDLE) wparam; cnt = DragQueryFile( hfileinfo, (UINT)-1, NULL, 0 ); buff = alloca( FILENAME_MAX + 2 ); /* we add a " at the beginning and at the end so we can handle path- and filenames with spaces */ if( buff != NULL ) { buff[0] = '"'; /* one " at the beginning of the filename */ for( i = 0; i < cnt; i++ ) { if( DragQueryFile( hfileinfo, i, buff + 1, FILENAME_MAX ) == (UINT)-1 ) { break; } strcat( buff, SingleQuote ); rc = EditFile( buff, false ); if( rc > ERR_NO_ERR ) { Error( GetErrorMsg( rc ) ); } } } DragFinish( hfileinfo ); break; case WM_TIMER: UpdateStatusWindow(); break; case WM_KEYDOWN: if( WindowsKeyPush( wparam, HIWORD( lparam ) ) ) { return( 0 ); } break; case WM_SIZE: DefFrameProc( hwnd, edit_container_id, msg, wparam, lparam ); RootState = wparam; if( wparam != SIZE_MINIMIZED ) { ResizeRoot(); GetWindowRect( hwnd, &RootRect ); if( wparam != SIZE_MAXIMIZED ) { RootState = 0; } } return( 0 ); case WM_MOVE: DefFrameProc( hwnd, edit_container_id, msg, wparam, lparam ); if( RootState != SIZE_MINIMIZED ) { GetWindowRect( hwnd, &RootRect ); } return( 0 ); case WM_ACTIVATEAPP: if( BAD_ID( current_window_id ) ) { break; } SetFocus( root_window_id );#if 0 if( !wparam ) { InactiveWindow( current_window_id ); } else { SendMessage( edit_container_id, WM_MDIACTIVATE, (WPARAM)current_window_id, 0L ); }#endif if( wparam ) { ResetEditWindowCursor( current_window_id ); } else { GoodbyeCursor( current_window_id ); } break; case WM_MOUSEACTIVATE: SetFocus( hwnd ); return( MA_ACTIVATE ); case WM_SETFOCUS: if( BAD_ID( current_window_id ) ) { break; } if( !IsIconic( current_window_id ) ) { SendMessage( edit_container_id, WM_MDIACTIVATE, (WPARAM)current_window_id, 0L ); DCUpdate(); SetWindowCursor(); SetWindowCursorForReal(); return( 0 ); } break; case WM_NCLBUTTONDBLCLK: break; case WM_COMMAND://.........这里部分代码省略.........
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:101,
示例11: winMWExtWMWindowProc//.........这里部分代码省略......... && winIsInternalWMRunning(pScreenInfo)) {#if CYGMULTIWINDOW_DEBUG winDebug("/twindow z order was changed/n");#endif if (pWinPos->hwndInsertAfter == HWND_TOP || pWinPos->hwndInsertAfter == HWND_TOPMOST || pWinPos->hwndInsertAfter == HWND_NOTOPMOST) {#if CYGMULTIWINDOW_DEBUG winDebug("/traise to top/n");#endif /* Raise the window to the top in Z order */ wmMsg.msg = WM_WM_RAISE; if (fWMMsgInitialized) winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); }#if 1 else if (pWinPos->hwndInsertAfter == HWND_BOTTOM) { } else { /* Check if this window is top of X windows. */ HWND hWndAbove = NULL; DWORD dwCurrentProcessID = GetCurrentProcessId(); DWORD dwWindowProcessID = 0; for (hWndAbove = pWinPos->hwndInsertAfter; hWndAbove != NULL; hWndAbove = GetNextWindow(hWndAbove, GW_HWNDPREV)) { /* Ignore other XWin process's window */ GetWindowThreadProcessId(hWndAbove, &dwWindowProcessID); if ((dwWindowProcessID == dwCurrentProcessID) && GetProp(hWndAbove, WIN_WINDOW_PROP) && !IsWindowVisible(hWndAbove) && !IsIconic(hWndAbove)) /* ignore minimized windows */ break; } /* If this is top of X windows in Windows stack, raise it in X stack. */ if (hWndAbove == NULL) {#if CYGMULTIWINDOW_DEBUG winDebug("/traise to top/n");#endif /* Raise the window to the top in Z order */ wmMsg.msg = WM_WM_RAISE; if (fWMMsgInitialized) winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); } }#endif } if (!(pWinPos->flags & SWP_NOSIZE)) { if (IsIconic(hwnd)) {#if CYGMULTIWINDOW_DEBUG winDebug("/tIconic -> MINIMIZED/n");#endif if (winIsInternalWMRunning(pScreenInfo)) { /* Raise the window to the top in Z order */ wmMsg.msg = WM_WM_LOWER; if (fWMMsgInitialized) winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); } winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, WindowsWMMinimizeWindow,
开发者ID:Agnesa,项目名称:xserver,代码行数:67,
示例12: dcvoid CTwoOptDlg::OnPaint(){ // device context for painting //CDC memDC ; // buffer context CPaintDC dc(this); if (IsIconic()) { SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { if ( CoordsMatrix_.size() < 1 ) return; // device context for painting CPen penDot(PS_DOT,1,RGB(255,0,0)); CPen penblack(PS_SOLID,3,RGB(0,0,0)); CRect rect; GetClientRect(&rect); int rectx1 = rect.left + 20; int rectx2 = rect.right - 170; int recty1 = rect.top + 25; int recty2 = rect.bottom - bottom_limit; dc.Rectangle(rectx1-5,recty1-5,rectx2+5,recty2+5); // Plot each node size_t tour_size = CoordsMatrix_.size(); for ( count = 0; count < tour_size; count++ ) { Coords mat = CoordsMatrix_[count]; xc1 =static_cast<int>(mat.GetX()); yc1 = static_cast<int>(mat.GetY()); xn1 = (float) ( xc1 - MinX ) / (float) ( MaxX - MinX ); yn1 = (float) ( yc1 - MinY ) / (float) ( MaxY - MinY ); xcoord1 = rectx1 + (int) (float) ( xn1 * abs( rectx1 - rectx2 ) ); ycoord1 = recty2 - (int) (float) ( yn1 * abs( recty1 - recty2 ) ); dc.SelectObject(&penblack); dc.Ellipse( xcoord1 - 2, ycoord1 - 2, xcoord1 + 2, ycoord1 + 2 ); //draw lines dc.SelectObject(&penDot); //draw last tour if ( hasRun && count < tour_size - 1 && m_lasttour.Tour.size()) { m_lasttour.Tour[count]; cc1 = static_cast<int>(m_lasttour.Tour[count]); cc2 = static_cast<int>(m_lasttour.Tour[count +1]); DrawNodes(cc1 , cc2, rectx1, rectx2, recty2, recty1, dc); } dc.SelectObject(&penblack); if ( hasRun && count < tour_size - 1 && m_besttour.Tour.size()) { cc1 = static_cast<int>(m_besttour.Tour[count]); cc2 = static_cast<int>(m_besttour.Tour[count +1]); DrawNodes(cc1 , cc2, rectx1, rectx2, recty2, recty1, dc); } } // Draw final link if ( hasRun ) { if(m_lasttour.Tour.size()) { cc1 = static_cast<int>(m_lasttour.Tour[tour_size-1]); cc2 = static_cast<int>( m_lasttour.Tour[0]); dc.SelectObject(&penDot); DrawNodes(cc1 , cc2, rectx1, rectx2, recty2, recty1, dc); } if(m_besttour.Tour.size()) { dc.SelectObject(&penblack); cc1 = static_cast<int>(m_besttour.Tour[tour_size-1]); cc2 = static_cast<int>(m_besttour.Tour[0]); DrawNodes(cc1 , cc2, rectx1, rectx2, recty2, recty1, dc); }//.........这里部分代码省略.........
开发者ID:d13125710,项目名称:ANTSGUI_old,代码行数:101,
示例13: TWIN_DriverMessageBOOLTWIN_DriverMessage(LPMSG lpMsg, HWND hWnd, UINT uMin, UINT uMax,UINT uFlg,BOOL bNoWait){ DWORD dwerv; HANDLE hTask; LPQUEUE lpQueue; if (hWnd && !IsWindow(hWnd)) hWnd = 0; if (hWnd) hTask = GetWindowTask(hWnd); else hTask = GetCurrentTask(); lpQueue = QueueGetPtr(hTask); /******************************************/ /* what is this? it is not called... */ /*hFocusTask = GetWindowTask(GetFocus()); */ /******************************************/ lpMsg->hwnd = 0; labLoop: while(1) { while (lpSendMessageStack && lpSendMessageStack->hReceivingTask == GetCurrentTask() && !lpSendMessageStack->bSendReceived) { TWIN_ReceiveMessage(FALSE); } /* try for a message from application queue */ if (QueueGetMsg(lpQueue, lpMsg, hWnd, uMin, uMax, uFlg)) { break; } /* try for a message from system queue */ if (QueueGetMsg(0,lpMsg,hWnd,uMin,uMax,uFlg)) { break; } if (uMin <= WM_PAINT && (!uMax || uMax >= WM_PAINT)) { /* finally, check if the window needs a paint message */ if(lpQueue->wQueueFlags & QFPAINT) { labTryNext: if((lpMsg->hwnd = InternalUpdateWindows())) { if (TestWF(lpMsg->hwnd, WFNCDIRTY)) { if (NonEmptyNCRect(lpMsg->hwnd)) { lpMsg->message = WM_NCPAINT; lpMsg->wParam = 0; lpMsg->lParam = 0L; break; } else { ClearWF(lpMsg->hwnd, WFNCDIRTY); } } if (TestWF(lpMsg->hwnd, WFDIRTY)) { if (IsIconic(lpMsg->hwnd) && GetClassIcon(lpMsg->hwnd)) { lpMsg->message = WM_PAINTICON; lpMsg->wParam = 1; } else { lpMsg->message = WM_PAINT; lpMsg->wParam = 0; } lpMsg->lParam = 0L; break; } else goto labTryNext; } lpQueue->wQueueFlags &= ~QFPAINT; } } if ((uMin <= WM_TIMER && (!uMax || uMax >= WM_TIMER)) || (uMin <= WM_SYSTIMER && (!uMax || uMax >= WM_SYSTIMER))) { if(lpQueue->wQueueFlags & QFTIMER) { if (TWIN_GetTimerMsg(hWnd,hTask,lpMsg,uFlg)) { break; } } } /* none of the above, so see if system is ready. */ if (!TWIN_InDriverWait) { TWIN_InDriverWait = TRUE; dwerv = DriverWaitEvent(TRUE); TWIN_InDriverWait = FALSE; if (!dwerv && !bNoWait) { /* * The code here used to call ReadyTask(GetCurrentTask()) * before calling InternalYield(), but that results in//.........这里部分代码省略.........
开发者ID:ErisBlastar,项目名称:osfree,代码行数:101,
示例14: OnSizevoid CImageWnd::OnSize(BOOL refreshNow){ if (m_pAppWnd == NULL) return; // If application window is being iconified, hide the current view if (IsIconic(m_pAppWnd->m_hWnd)) { if (m_pView) m_pView->Hide(); return; } // Get application rectangle CRect appRect; m_pAppWnd->GetClientRect(appRect); // Get view rectangle CRect viewRect; if (m_pViewWnd != NULL) { m_pViewWnd->GetWindowRect(viewRect); m_pAppWnd->ScreenToClient(viewRect); } else { viewRect = appRect; } if (m_pViewWnd != NULL && m_pHorzScr != NULL && m_pVertScr != NULL) { // Get scroll bars rectangles CRect horzRect, vertRect; m_pHorzScr->GetWindowRect(horzRect); m_pVertScr->GetWindowRect(vertRect); m_pAppWnd->ScreenToClient(horzRect); m_pAppWnd->ScreenToClient(vertRect); // Adjust windows' position viewRect.right = appRect.right - 5 - vertRect.Width(); viewRect.bottom = appRect.bottom - 5 - horzRect.Height(); m_pViewWnd->MoveWindow(viewRect.left, viewRect.top, viewRect.Width(), viewRect.Height(), TRUE); horzRect.top = viewRect.bottom; horzRect.right = viewRect.right; horzRect.bottom = appRect.bottom - 5; m_pHorzScr->MoveWindow(horzRect.left, horzRect.top, horzRect.Width(), horzRect.Height(), TRUE); vertRect.left = viewRect.right; vertRect.right = appRect.right - 5; vertRect.bottom = viewRect.bottom; m_pVertScr->MoveWindow(vertRect.left, vertRect.top, vertRect.Width(), vertRect.Height(), TRUE); } if (m_pView) { // Call corresponding handler m_pView->OnSize(refreshNow); // Update scroll bars' position and range // Has to be called twice (JPC) UpdateScrollBars(); UpdateScrollBars(); // Update view rectangle m_ViewRect = viewRect; m_ViewRect.left += m_pView->GetScaleParamsDst().Left(); m_ViewRect.top += m_pView->GetScaleParamsDst().Top(); m_ViewRect.right = m_ViewRect.left + m_pView->GetWidth(); m_ViewRect.bottom = m_ViewRect.top + m_pView->GetHeight(); // Update tracker limits CRect limitRect; limitRect.top = 0; limitRect.left = 0; limitRect.right = m_pView->GetWidth(); limitRect.bottom = m_pView->GetHeight(); m_RectTracker.SetLimitRect(&limitRect); if (m_pViewWnd == NULL) { // Check if unused region of the AppWnd should be repainted int viewWidth = m_pView->GetWidth(); int viewHeight = m_pView->GetHeight(); if (appRect.Width() > viewWidth) { CRect rect = appRect; rect.left = viewWidth; m_pAppWnd->InvalidateRect(rect, TRUE); } if (appRect.Height() > viewHeight) { CRect rect = appRect; rect.top = viewHeight; m_pAppWnd->InvalidateRect(rect, TRUE); }//.........这里部分代码省略.........
开发者ID:sunlong0724,项目名称:myworkspce,代码行数:101,
示例15: RedrawForce/* * Functions should call RedrawAll if they need the room to be redrawn. * This sets a flag, and the next time an opportunity arises, the room * is redrawn via a call to RedrawForce. */void RedrawForce(void){ HDC hdc; static DWORD lastEndFrame = 0; DWORD endFrame, startFrame; int totalFrameTime, oldMode; char buffer[32]; if (GameGetState() == GAME_INVALID || /*!need_redraw ||*/ IsIconic(hMain) || view.cx == 0 || view.cy == 0 || current_room.rows == 0 || current_room.cols == 0) { need_redraw = False; return; } timeBeginPeriod(1); startFrame = timeGetTime(); /* REVIEW: Clearing flag before draw phase allows draw phase to set flag. * This is useful in rare circumstances when an effect should * last only one frame, even if animation is off. */ need_redraw = False; hdc = GetDC(hMain); DrawRoom(hdc, view.x, view.y, ¤t_room, map); endFrame = timeGetTime(); msDrawFrame = (int)(endFrame - startFrame); totalFrameTime = (int)(endFrame - lastEndFrame); // if totalFrameTime is less than one, clamp to 1 so we don't divide by 0 or get negative fps if (1 > totalFrameTime) totalFrameTime = 1; fps = 1000 / (int)totalFrameTime; if (config.maxFPS) { if (fps > config.maxFPS) { int msSleep = (1000 / config.maxFPS) - totalFrameTime; Sleep(msSleep); } } lastEndFrame = endFrame; timeEndPeriod(1); if (config.showFPS) { RECT rc,lagBox; wsprintf(buffer, "FPS=%d (%dms) ", fps, msDrawFrame); ZeroMemory(&rc,sizeof(rc)); rc.bottom = DrawText(hdc,buffer,-1,&rc,DT_SINGLELINE|DT_CALCRECT); Lagbox_GetRect(&lagBox); OffsetRect(&rc,lagBox.right + TOOLBAR_SEPARATOR_WIDTH,lagBox.top); DrawWindowBackground(hdc, &rc, rc.left, rc.top); oldMode = SetBkMode(hdc,TRANSPARENT); DrawText(hdc,buffer,-1,&rc,DT_SINGLELINE); SetBkMode(hdc,oldMode); GdiFlush(); } ReleaseDC(hMain, hdc); GameWindowSetCursor(); // We may have moved; reset cursor}
开发者ID:Anonic,项目名称:Meridian59,代码行数:69,
示例16: HotkeyHandlerDlgProc//.........这里部分代码省略......... BOOL iSelection = TrackPopupMenu(PluginConfig.g_hMenuTrayUnread, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL); HandleMenuEntryFromhContact((MCONTACT)iSelection); } else TrackPopupMenu(GetSubMenu(PluginConfig.g_hMenuContext, 8), TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL); if (wParam == 100) PostMessage(hwndDlg, WM_NULL, 0, 0); } break; case WM_MBUTTONDOWN: { if (wParam == 100) SetForegroundWindow(hwndDlg); int iCount = GetMenuItemCount(PluginConfig.g_hMenuTrayUnread); if (iCount > 0) { UINT uid = 0; MENUITEMINFOA mii = {0}; mii.fMask = MIIM_DATA; mii.cbSize = sizeof(mii); int i = iCount - 1; do { GetMenuItemInfoA(PluginConfig.g_hMenuTrayUnread, i, TRUE, &mii); if (mii.dwItemData > 0) { uid = GetMenuItemID(PluginConfig.g_hMenuTrayUnread, i); HandleMenuEntryFromhContact((MCONTACT)uid); break; } } while (--i >= 0); if (uid == 0 && pLastActiveContainer != NULL) { // no session found, restore last active container if (IsIconic(pLastActiveContainer->hwnd) || !IsWindowVisible(pLastActiveContainer->hwnd)) { SendMessage(pLastActiveContainer->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); SetForegroundWindow(pLastActiveContainer->hwnd); SetFocus(GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE)); } else if (GetForegroundWindow() != pLastActiveContainer->hwnd) { SetForegroundWindow(pLastActiveContainer->hwnd); SetFocus(GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE)); } else { if (PluginConfig.m_HideOnClose) ShowWindow(pLastActiveContainer->hwnd, SW_HIDE); else SendMessage(pLastActiveContainer->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); } } } if (wParam == 100) PostMessage(hwndDlg, WM_NULL, 0, 0); } break; case WM_RBUTTONUP: { HMENU submenu = PluginConfig.g_hMenuTrayContext; POINT pt; if (wParam == 100) SetForegroundWindow(hwndDlg); GetCursorPos(&pt); CheckMenuItem(submenu, ID_TRAYCONTEXT_DISABLEALLPOPUPS, MF_BYCOMMAND | (nen_options.iDisable ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(submenu, ID_TRAYCONTEXT_DON40223, MF_BYCOMMAND | (nen_options.iNoSounds ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(submenu, ID_TRAYCONTEXT_DON, MF_BYCOMMAND | (nen_options.iNoAutoPopup ? MF_CHECKED : MF_UNCHECKED));
开发者ID:slotwin,项目名称:miranda-ng,代码行数:67,
示例17: gui/* this function gets called by mplayer to update the gui */int gui(int what, void *data){ stream_t *stream = data;#ifdef CONFIG_DVDREAD dvd_priv_t *dvdp;#endif if(!mygui || !mygui->skin) return 0; if(guiInfo.mpcontext) { audio_out = mpctx_get_audio_out(guiInfo.mpcontext); video_out = mpctx_get_video_out(guiInfo.mpcontext); mixer = mpctx_get_mixer(guiInfo.mpcontext); playtree = mpctx_get_playtree_iter(guiInfo.mpcontext); } switch (what) { case GUI_PREPARE: { audio_id = -1; video_id = -1; dvdsub_id = -1; vobsub_id = -1; stream_cache_size = -1; autosync = 0; dvd_title = 0; force_fps = 0; if(!mygui->playlist->tracks) return 0; switch(guiInfo.StreamType) { case STREAMTYPE_FILE: case STREAMTYPE_STREAM: uiSetFileName(NULL, mygui->playlist->tracks[mygui->playlist->current]->filename, SAME_STREAMTYPE); guiInfo.Track = mygui->playlist->current + 1; break;#ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: { char tmp[512]; dvd_chapter = guiInfo.Chapter; dvd_angle = guiInfo.Angle; sprintf(tmp,"dvd://%d", guiInfo.Track); uiSetFileName(NULL, tmp, SAME_STREAMTYPE); break; }#endif } guiInfo.VideoWindow = 1; if(gtkAONorm) greplace(&af_cfg.list, "volnorm", "volnorm"); if(gtkAOExtraStereo) { char *name = malloc(12 + 20 + 1); snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul); name[12 + 20] = 0; greplace(&af_cfg.list, "extrastereo", name); free(name); } if(gtkCacheOn) stream_cache_size = gtkCacheSize; if(gtkAutoSyncOn) autosync = gtkAutoSync; guiInfo.NewPlay = 0; break; } case GUI_SET_AUDIO: { if (data && !guiInfo.sh_video) guiInfo.VideoWindow = 0; if(IsWindowVisible(mygui->subwindow) && !guiInfo.VideoWindow) ShowWindow(mygui->subwindow, SW_HIDE); break; } case GUI_SET_CONTEXT: guiInfo.mpcontext = data; break; case GUI_SET_VIDEO: { guiInfo.sh_video = data; if (data) { sh_video_t *sh = data; codecname = sh->codec->name; /* we have video, show the subwindow */ if(!IsWindowVisible(mygui->subwindow) || IsIconic(mygui->subwindow)) ShowWindow(mygui->subwindow, SW_SHOWNORMAL); if(WinID == -1) update_subwindow(); } break; } case GUI_SETUP_VIDEO_WINDOW: { guiInfo.VideoWidth = vo_dwidth; guiInfo.VideoHeight = vo_dheight; sub_aspect = (float)guiInfo.VideoWidth/guiInfo.VideoHeight; if(WinID != -1) update_subwindow(); break;//.........这里部分代码省略.........
开发者ID:lcrs,项目名称:balls-mplayer,代码行数:101,
示例18: WMainWndProcWINEXPORT LRESULT CALLBACK WMainWndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ){ HMENU menu;#if 0 HWND win;#endif LRESULT ret; bool pass_to_def; WAccelEditInfo *einfo; WORD wp; MINMAXINFO *minmax; about_info ai; pass_to_def = TRUE; ret = FALSE; einfo = (WAccelEditInfo *)GET_WNDLONGPTR( hWnd, 0 ); WSetCurrentEditInfo( einfo ); if( einfo != NULL && einfo->getting_key ) { if( WGetKeyPressProc( einfo, message, wParam, lParam ) ) { einfo->getting_key = FALSE; DestroyWindow( einfo->key_info.text_win ); ReleaseCapture(); WHandleChange( einfo ); pass_to_def = FALSE; } } switch( message ) { case WM_ACTIVATE: if( GET_WM_ACTIVATE_FACTIVE( wParam, lParam ) && !GET_WM_ACTIVATE_FMINIMIZED( wParam, lParam ) && einfo != NULL && einfo->edit_dlg != (HWND)NULL ) { SetFocus( einfo->edit_dlg ); pass_to_def = FALSE; } break; case WM_INITMENU: if( wParam == (WPARAM)GetMenu( hWnd ) ) { // set the cut and copy menu items if( SendDlgItemMessage( einfo->edit_dlg, IDM_ACCEDLIST, LB_GETCURSEL, 0, 0 ) != LB_ERR ) { EnableMenuItem( (HMENU)wParam, IDM_ACC_CUT, MF_ENABLED ); EnableMenuItem( (HMENU)wParam, IDM_ACC_COPY, MF_ENABLED ); } else { EnableMenuItem( (HMENU)wParam, IDM_ACC_CUT, MF_GRAYED ); EnableMenuItem( (HMENU)wParam, IDM_ACC_COPY, MF_GRAYED ); } // set the paste menu item if( OpenClipboard( hWnd ) ) { if( //IsClipboardFormatAvailable( WClipbdFormat ) || IsClipboardFormatAvailable( WItemClipbdFormat ) ) { EnableMenuItem( (HMENU)wParam, IDM_ACC_PASTE, MF_ENABLED ); } else { EnableMenuItem( (HMENU)wParam, IDM_ACC_PASTE, MF_GRAYED ); } CloseClipboard(); } } break; case WM_CREATE: einfo = ((CREATESTRUCT *)lParam)->lpCreateParams; SET_WNDLONGPTR( hWnd, 0, (LONG_PTR)einfo ); break; case WM_MENUSELECT: if( einfo != NULL ) { menu = WGetMenuHandle( einfo ); WHandleMenuSelect( einfo->wsb, menu, wParam, lParam ); setLastMenuSelect( einfo, wParam, lParam ); } break; case WM_GETMINMAXINFO: minmax = (MINMAXINFO *)lParam; minmax->ptMinTrackSize.x = appWidth; minmax->ptMinTrackSize.y = appHeight; break; case WM_MOVE: if( einfo != NULL ) { if( IsZoomed( hWnd ) ) { WSetOption( WOptScreenMax, TRUE ); } else if( !IsIconic( hWnd ) ) { WUpdateScreenPosOpt( hWnd ); WSetOption( WOptScreenMax, FALSE ); } } break; case WM_SIZE: if( einfo != NULL ) { if( wParam == SIZE_MAXIMIZED ) { WSetOption( WOptScreenMax, TRUE ); } else if( wParam != SIZE_MINIMIZED ) { WUpdateScreenPosOpt( hWnd ); WSetOption( WOptScreenMax, FALSE ); } WResizeWindows( einfo );//.........这里部分代码省略.........
开发者ID:NoSuchProcess,项目名称:open-watcom-v2,代码行数:101,
示例19: AssertWrapperOk/** * Tries to switch to the main window of the VM process. * * @return true if successfully switched and false otherwise. */bool UIVMItem::switchTo(){#ifdef VBOX_WS_MAC ULONG64 id = m_machine.ShowConsoleWindow();#else WId id = (WId) m_machine.ShowConsoleWindow();#endif AssertWrapperOk(m_machine); if (!m_machine.isOk()) return false; /* winId = 0 it means the console window has already done everything * necessary to implement the "show window" semantics. */ if (id == 0) return true;#if defined (VBOX_WS_WIN) || defined (VBOX_WS_X11) return vboxGlobal().activateWindow(id, true);#elif defined (VBOX_WS_MAC) /* * This is just for the case were the other process cannot steal * the focus from us. It will send us a PSN so we can try. */ ProcessSerialNumber psn; psn.highLongOfPSN = id >> 32; psn.lowLongOfPSN = (UInt32)id; OSErr rc = ::SetFrontProcess(&psn); if (!rc) Log(("GUI: %#RX64 couldn't do SetFrontProcess on itself, the selector (we) had to do it.../n", id)); else Log(("GUI: Failed to bring %#RX64 to front. rc=%#x/n", id, rc)); return !rc;#endif return false; /// @todo Below is the old method of switching to the console window // based on the process ID of the console process. It should go away // after the new (callback-based) method is fully tested.#if 0 if (!canSwitchTo()) return false;#if defined (VBOX_WS_WIN) HWND hwnd = mWinId; /* if there are blockers (modal and modeless dialogs, etc), find the * topmost one */ HWND hwndAbove = NULL; do { hwndAbove = GetNextWindow(hwnd, GW_HWNDPREV); HWND hwndOwner; if (hwndAbove != NULL && ((hwndOwner = GetWindow(hwndAbove, GW_OWNER)) == hwnd || hwndOwner == hwndAbove)) hwnd = hwndAbove; else break; } while (1); /* first, check that the primary window is visible */ if (IsIconic(mWinId)) ShowWindow(mWinId, SW_RESTORE); else if (!IsWindowVisible(mWinId)) ShowWindow(mWinId, SW_SHOW);#if 0 LogFlowFunc(("mWinId=%08X hwnd=%08X/n", mWinId, hwnd));#endif /* then, activate the topmost in the group */ AllowSetForegroundWindow(m_pid); SetForegroundWindow(hwnd); return true;#elif defined (VBOX_WS_X11) return false;#elif defined (VBOX_WS_MAC) ProcessSerialNumber psn; OSStatus rc = ::GetProcessForPID(m_pid, &psn); if (!rc) { rc = ::SetFrontProcess(&psn);//.........这里部分代码省略.........
开发者ID:miguelinux,项目名称:vbox,代码行数:101,
示例20: //--------------------------------------------------------------------- void D3D10RenderWindow::windowMovedOrResized() { if (!mHWnd || IsIconic(mHWnd)) return; RECT rc; // top and left represent outer window position GetWindowRect(mHWnd, &rc); mTop = rc.top; mLeft = rc.left; // width and height represent drawable area only GetClientRect(mHWnd, &rc); unsigned int width = rc.right; unsigned int height = rc.bottom; if (mWidth == width && mHeight == height) return; md3dpp.Windowed = !mIsFullScreen; md3dpp.SwapEffect = DXGI_SWAP_EFFECT_DISCARD ; // triple buffer if VSync is on md3dpp.BufferCount = mVSync ? 2 : 1; md3dpp.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; md3dpp.OutputWindow = mHWnd; md3dpp.BufferDesc.Width = mWidth; md3dpp.BufferDesc.Height = mHeight; md3dpp.BufferDesc.RefreshRate.Numerator=1; md3dpp.BufferDesc.RefreshRate.Denominator = mIsFullScreen ? mDisplayFrequency : 0; mWidth = width; mHeight = height; UINT Flags = 0; if( mIsFullScreen ) Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; mpSwapChain->ResizeBuffers(md3dpp.BufferCount, width, height, md3dpp.BufferDesc.Format, Flags); /* SAFE_RELEASE( mpRenderSurface ); if (mIsSwapChain) { DXGI_SWAP_CHAIN_DESC pp = md3dpp; pp.BufferDesc.Height = width; pp.BufferDesc.Height = height; //SAFE_RELEASE( mpRenderZBuffer ); SAFE_RELEASE( mpSwapChain ); HRESULT hr = mDriver->mDevice->CreateAdditionalSwapChain( &pp, &mpSwapChain); if (FAILED(hr)) { LogManager::getSingleton().stream(LML_CRITICAL) << "D3D10RenderWindow: failed to reset device to new dimensions << " << width << " x " << height << ". Trying to recover."; // try to recover hr = mDriver->mDevice->CreateAdditionalSwapChain( &md3dpp, &mpSwapChain); if (FAILED(hr)) OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Reset window to last size failed", "D3D10RenderWindow::resize" ); } else { md3dpp = pp; mWidth = width; mHeight = height; hr = mpSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &mpRenderSurface); hr = mDriver->mDevice->CreateDepthStencilSurface( mWidth, mHeight, md3dpp.AutoDepthStencilFormat, md3dpp.MultiSampleType, md3dpp.MultiSampleQuality, (md3dpp.Flags & D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL), &mpRenderZBuffer, NULL ); if (FAILED(hr)) { OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to create depth stencil surface for Swap Chain", "D3D10RenderWindow::resize" ); } } } // primary windows must reset the device else { md3dpp.BufferDesc.Width = mWidth = width; md3dpp.BufferDesc.Height = mHeight = height; static_cast<D3D10RenderSystem*>(//.........这里部分代码省略.........
开发者ID:milram,项目名称:ogre-1.7.4-osx,代码行数:101,
示例21: WdeMainWndProcWINEXPORT LRESULT CALLBACK WdeMainWndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ){ HMENU menu; LRESULT ret; bool pass_to_def; WdeResInfo *res_info; WORD wp; about_info ai; if( WdeCleanupStarted ) { if( message == WM_DESTROY ) { PostQuitMessage( 0 ); } return( DefFrameProc( hWnd, hWinWdeMDIClient, message, wParam, lParam ) ); } pass_to_def = TRUE; ret = FALSE; res_info = WdeGetCurrentRes(); menu = WdeGetMenuHandle(); switch( message ) { case WM_INITMENU: handleInitMenu( menu ); break; case WM_USER: WdeSetStatusByID( -1, WDE_ONLYONEINSTANCE ); break; case WM_MENUSELECT: WdeHandleMenuSelect( wParam, lParam ); break; case WM_MEASUREITEM: WdeHandleMeasureItem( (MEASUREITEMSTRUCT *)lParam ); ret = TRUE; pass_to_def = FALSE; break; case WM_DRAWITEM: WdeHandleDrawItem( (DRAWITEMSTRUCT *)lParam ); ret = TRUE; pass_to_def = FALSE; break; case WM_MOVE: if( IsZoomed( hWnd ) ) { WdeSetOption( WdeOptIsScreenMax, TRUE ); } else if( !IsIconic( hWnd ) ) { WdeUpdateScreenPosOpt(); WdeSetOption( WdeOptIsScreenMax, FALSE ); } break; case WM_SIZE: if( wParam == SIZE_MAXIMIZED ) { WdeSetOption( WdeOptIsScreenMax, TRUE ); } else if( wParam != SIZE_MINIMIZED ) { WdeUpdateScreenPosOpt(); WdeSetOption( WdeOptIsScreenMax, FALSE ); } if( wParam != SIZE_MINIMIZED ) { WdeResizeWindows(); } pass_to_def = FALSE; break; case WM_COMMAND: wp = LOWORD( wParam ); if( !WdeIsMenuIDValid( menu, wp ) ) { break; } switch( wp ) { case IDM_SELECT_MODE: case IDM_DIALOG_TOOL: case IDM_PBUTTON_TOOL: case IDM_CBUTTON_TOOL: case IDM_RBUTTON_TOOL: case IDM_GBUTTON_TOOL: case IDM_FRAME_TOOL: case IDM_TEXT_TOOL: case IDM_ICON_TOOL: case IDM_EDIT_TOOL: case IDM_LISTBOX_TOOL: case IDM_COMBOBOX_TOOL: case IDM_HSCROLL_TOOL: case IDM_VSCROLL_TOOL: case IDM_SIZEBOX_TOOL: case IDM_STATUSBAR_TOOL: case IDM_LISTVIEW_TOOL: case IDM_TREEVIEW_TOOL: case IDM_TABCNTL_TOOL: case IDM_ANIMATE_TOOL: case IDM_UPDOWN_TOOL: case IDM_TRACKBAR_TOOL: case IDM_PROGRESS_TOOL: case IDM_HOTKEY_TOOL://.........这里部分代码省略.........
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:101,
示例22: max/* CDirect3D::Renderdoes the actual rendering, changes the draw surface if necessary and recalculatesthe vertex information if filter output size changesIN:Src - the input surface*/void CDirect3D::Render(SSurface Src){ SSurface Dst; RECT dstRect; unsigned int newFilterScale; D3DLOCKED_RECT lr; D3DLOCKED_RECT lrConv; HRESULT hr; if(!init_done) return; //create a new draw surface if the filter scale changes //at least factor 2 so we can display unscaled hi-res images newFilterScale = max(2,max(GetFilterScale(GUI.ScaleHiRes),GetFilterScale(GUI.Scale))); if(newFilterScale!=filterScale) { ChangeDrawSurfaceSize(newFilterScale); } if(FAILED(hr = pDevice->TestCooperativeLevel())) { switch(hr) { case D3DERR_DEVICELOST: //do no rendering until device is restored return; case D3DERR_DEVICENOTRESET: //we can reset now if(!IsIconic(dPresentParams.hDeviceWindow)) ResetDevice(); return; default: DXTRACE_ERR_MSGBOX(TEXT("Internal driver error"), hr); return; } } //BlankTexture(drawSurface); if(FAILED(hr = drawSurface->LockRect(0, &lr, NULL, 0))) { DXTRACE_ERR_MSGBOX(TEXT("Unable to lock texture"), hr); return; } else { Dst.Surface = (unsigned char *)lr.pBits; Dst.Height = quadTextureSize; Dst.Width = quadTextureSize; Dst.Pitch = lr.Pitch; RenderMethod (Src, Dst, &dstRect); if(!Settings.AutoDisplayMessages) { WinSetCustomDisplaySurface((void *)Dst.Surface, Dst.Pitch/2, dstRect.right-dstRect.left, dstRect.bottom-dstRect.top, GetFilterScale(CurrentScale)); S9xDisplayMessages ((uint16*)Dst.Surface, Dst.Pitch/2, dstRect.right-dstRect.left, dstRect.bottom-dstRect.top, GetFilterScale(CurrentScale)); } drawSurface->UnlockRect(0); } if (!GUI.Stretch || GUI.AspectRatio) { Clear(); } //if the output size of the render method changes we need to update the viewport if(afterRenderHeight != dstRect.bottom || afterRenderWidth != dstRect.right) { afterRenderHeight = dstRect.bottom; afterRenderWidth = dstRect.right; SetViewport(); } pDevice->SetTexture(0, drawSurface); pDevice->SetVertexDeclaration(vertexDeclaration); pDevice->SetStreamSource(0,vertexBuffer,0,sizeof(VERTEX)); if(shader_type == D3D_SHADER_CG) { RECT displayRect; //Get maximum rect respecting AR setting displayRect=CalculateDisplayRect(dPresentParams.BackBufferWidth,dPresentParams.BackBufferHeight, dPresentParams.BackBufferWidth,dPresentParams.BackBufferHeight); cgShader->Render(drawSurface, XMFLOAT2((float)quadTextureSize, (float)quadTextureSize), XMFLOAT2((float)afterRenderWidth, (float)afterRenderHeight), XMFLOAT2((float)(displayRect.right - displayRect.left), (float)(displayRect.bottom - displayRect.top)), XMFLOAT2((float)dPresentParams.BackBufferWidth, (float)dPresentParams.BackBufferHeight)); } SetFiltering(); pDevice->SetVertexDeclaration(vertexDeclaration); pDevice->BeginScene(); pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2); pDevice->EndScene(); pDevice->Present(NULL, NULL, NULL, NULL); if (GUI.ReduceInputLag) { IDirect3DSurface9 *surface; RECT r = { 0, 0, 2, 2 };//.........这里部分代码省略.........
开发者ID:libretro,项目名称:snes9x,代码行数:101,
示例23: UpdateWnd///////////////////////////////////////////////////// call this function to page wnds,when// the window is resized.void CBSWndContainer::UpdateWnd(){ if(!IsWindowVisible()||IsIconic()) return;///////////////////////计算显示总区域 //得到窗口的设备坐标 CRect rtContainer; GetClientRect(&rtContainer); GetShowRect(&rtContainer); rtContainer.DeflateRect(1,1); //调整Container位置 if(m_bAutoAdjustPos) AdjustRect(&rtContainer);/////////////////////// if(m_bMultiScreen) { //多屏状态 CRect rt; int nCount=m_PageList.GetCount(); int i=0; for(POSITION pos=m_PageList.GetHeadPosition(); pos!=NULL;) { CWnd *p=m_PageList.GetNext(pos); rt=rtContainer; CalcPageRect(&rt,i,nCount); rt.DeflateRect(WINDOW_SPACE,WINDOW_SPACE,WINDOW_SPACE,WINDOW_SPACE); //窗口之间的间隔 p->MoveWindow(&rt); p->ShowWindow(SW_SHOW); i++; WinSetRect(p,rt); } if( m_bDrawActive && m_PageList.GetCount()>1 ) DrawActivePage(TRUE); } else { //单屏状态 for(POSITION pos=m_PageList.GetHeadPosition(); pos!=NULL;) { CWnd *p=m_PageList.GetNext(pos); if(p==m_pActivePage) { p->MoveWindow(&rtContainer); WinSetRect(p,rtContainer); } else { if(m_bFullScreen) { p->MoveWindow(0,0,1,1); WinSetRect(p,CRect(0,0,1,1)); } else { p->MoveWindow(rtContainer.right+1,rtContainer.bottom+1,1,1); WinSetRect(p,CRect(rtContainer.right+1,rtContainer.bottom+1,1,1)); } } } }}
开发者ID:dulton,项目名称:brpj,代码行数:71,
示例24: InternalWndProcLRESULT CALLBACK InternalWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam){ PAINTSTRUCT ps; // Structure for the paint message POINT p = {0, 0}; // Translation point for the window's client region HRESULT hRet; switch (iMsg) { case WM_MOVE: // Make sure we're not moving to be minimized - because otherwise // our ratio varialbes (g_dwXRatio and g_dwYRatio) will end up // being 0, and once we hit CheckBoundries it divides by 0. if (!IsIconic(hwnd)) { g_rcSrc.left = 0; g_rcSrc.right = g_sizex; g_rcSrc.top = 0; g_rcSrc.bottom = g_sizey; GetClientRect(hwnd, &g_rcDst); g_dwXRatio = (g_rcDst.right - g_rcDst.left) * 1000 / (g_rcSrc.right - g_rcSrc.left); g_dwYRatio = (g_rcDst.bottom - g_rcDst.top) * 1000 / (g_rcSrc.bottom - g_rcSrc.top); ClientToScreen(hwnd, &p); g_rcDst.left = p.x; g_rcDst.top = p.y; g_rcDst.bottom += p.y; g_rcDst.right += p.x; CheckBoundries(); } else // Else, hide the overlay... just in case we can't do // destination color keying, this will pull the overlay // off of the screen for the user. if (g_pDDSOverlay && g_pDDSPrimary) g_pDDSOverlay->UpdateOverlay(NULL, g_pDDSPrimary, NULL, DDOVER_HIDE, NULL); // Check to make sure our window exists before we tell it to // repaint. This will fail the first time (while the window is being created). if (hwnd) { InvalidateRect(hwnd, NULL, FALSE); UpdateWindow(hwnd); } return 0L; case WM_SIZE: // Another check for the minimization action. This check is // quicker though... if (wParam != SIZE_MINIMIZED) { GetClientRect(hwnd, &g_rcDst); ClientToScreen(hwnd, &p); g_rcDst.left = p.x; g_rcDst.top = p.y; g_rcDst.bottom += p.y; g_rcDst.right += p.x; g_rcSrc.left = 0; g_rcSrc.right = g_sizex; g_rcSrc.top = 0; g_rcSrc.bottom = g_sizey; // Here we multiply by 1000 to preserve 3 decimal places in the // division opperation (we picked 1000 to be on the same order // of magnitude as the stretch factor for easier comparisons) g_dwXRatio = (g_rcDst.right - g_rcDst.left) * 1000 / (g_rcSrc.right - g_rcSrc.left); g_dwYRatio = (g_rcDst.bottom - g_rcDst.top) * 1000 / (g_rcSrc.bottom - g_rcSrc.top); CheckBoundries(); } return 0L; case WM_PAINT: BeginPaint(hwnd, &ps); // Check the primary surface to see if it's lost - if so you can // pretty much bet that the other surfaces are also lost - thus // restore EVERYTHING! If we got our surfaces stolen by a full // screen app - then we'll destroy our primary - and won't be able // to initialize it again. When we get our next paint message (the // full screen app closed for example) we'll want to try to reinit // the surfaces again - that's why there is a check for // g_pDDSPrimary == NULL. The other option, is that our program // went through this process, could init the primary again, but it // couldn't init the overlay, that's why there's a third check for // g_pDDSOverlay == NULL. Make sure that the check for // !g_pDDSPrimary is BEFORE the IsLost call - that way if the // pointer is NULL (ie. !g_pDDSPrimary is TRUE) - the compiler // won't try to evaluate the IsLost function (which, since the // g_pDDSPrimary surface is NULL, would be bad...). if (!g_pDDSPrimary || (g_pDDSPrimary->IsLost() != DD_OK) || (g_pDDSOverlay == NULL)) { DestroyOverlay(); DestroyPrimary(); if (DDPrimaryInit()) if (DDOverlayInit()) if (!DrawOverlay()) DestroyOverlay(); } // UpdateOverlay is how we put the overlay on the screen. if (g_pDDSOverlay && g_pDDSPrimary && g_video->updating)//.........这里部分代码省略.........
开发者ID:ucberkeley,项目名称:lithe,代码行数:101,
示例25: CreateNewTabForContact//.........这里部分代码省略......... { int iTabIndex_wanted = M.GetDword(hContact, "tabindex", pContainer->iChilds * 100); int iCount = TabCtrl_GetItemCount(hwndTab); TCITEM item = {0}; int relPos; int i; pContainer->iTabIndex = iCount; if (iCount > 0) { for (i = iCount - 1; i >= 0; i--) { item.mask = TCIF_PARAM; TabCtrl_GetItem(hwndTab, i, &item); HWND hwnd = (HWND)item.lParam; TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if (dat) { relPos = M.GetDword(dat->hContact, "tabindex", i * 100); if (iTabIndex_wanted <= relPos) pContainer->iTabIndex = i; } } } } newItem = TabCtrl_InsertItem(hwndTab, pContainer->iTabIndex, &newData.item); SendMessage(hwndTab, EM_REFRESHWITHOUTCLIP, 0, 0); if (bActivateTab) TabCtrl_SetCurSel(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), newItem); newData.iTabID = newItem; newData.iTabImage = newData.item.iImage; newData.pContainer = pContainer; newData.iActivate = (int) bActivateTab; pContainer->iChilds++; newData.bWantPopup = bWantPopup; newData.hdbEvent = hdbEvent; HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGSPLITNEW), GetDlgItem(pContainer->hwnd, IDC_MSGTABS), DlgProcMessage, (LPARAM)&newData); /* * switchbar support */ if (pContainer->dwFlags & CNT_SIDEBAR) { TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndNew, GWLP_USERDATA); if (dat) pContainer->SideBar->addSession(dat, pContainer->iTabIndex); } SendMessage(pContainer->hwnd, WM_SIZE, 0, 0); // if the container is minimized, then pop it up... if (IsIconic(pContainer->hwnd)) { if (bPopupContainer) { SendMessage(pContainer->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); SetFocus(pContainer->hwndActive); } else { if (pContainer->dwFlags & CNT_NOFLASH) SendMessage(pContainer->hwnd, DM_SETICON, 0, (LPARAM)LoadSkinnedIcon(SKINICON_EVENT_MESSAGE)); else FlashContainer(pContainer, 1, 0); } } if (bActivateTab) { ActivateExistingTab(pContainer, hwndNew); SetFocus(hwndNew); RedrawWindow(pContainer->hwnd, NULL, NULL, RDW_ERASENOW); UpdateWindow(pContainer->hwnd); if (GetForegroundWindow() != pContainer->hwnd && bPopupContainer == TRUE) SetForegroundWindow(pContainer->hwnd); } else if (!IsIconic(pContainer->hwnd) && IsWindowVisible(pContainer->hwnd)) { SendMessage(pContainer->hwndActive, WM_SIZE, 0, 0); RedrawWindow(pContainer->hwndActive, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW); RedrawWindow(pContainer->hwndActive, NULL, NULL, RDW_ERASENOW | RDW_UPDATENOW); } //MaD if (PluginConfig.m_HideOnClose&&!IsWindowVisible(pContainer->hwnd)) { WINDOWPLACEMENT wp={0}; wp.length = sizeof(wp); GetWindowPlacement(pContainer->hwnd, &wp); BroadCastContainer(pContainer, DM_CHECKSIZE, 0, 0); // make sure all tabs will re-check layout on activation if (wp.showCmd == SW_SHOWMAXIMIZED) ShowWindow(pContainer->hwnd, SW_SHOWMAXIMIZED); else { if (bPopupContainer) ShowWindow(pContainer->hwnd, SW_SHOWNORMAL); else ShowWindow(pContainer->hwnd, SW_SHOWMINNOACTIVE); } SendMessage(pContainer->hwndActive, WM_SIZE, 0, 0); } if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled) CWarning::show(CWarning::WARN_AEROPEEK_SKIN, MB_ICONWARNING|MB_OK); if (ServiceExists(MS_HPP_EG_EVENT) && ServiceExists(MS_IEVIEW_EVENT) && db_get_b(0, "HistoryPlusPlus", "IEViewAPI", 0)) if (IDYES == CWarning::show(CWarning::WARN_HPP_APICHECK, MB_ICONWARNING|MB_YESNO)) db_set_b(0, "HistoryPlusPlus", "IEViewAPI", 0); return hwndNew; // return handle of the new dialog}
开发者ID:slotwin,项目名称:miranda-ng,代码行数:101,
示例26: SetIconicvoid SetIconic() { if (IsIconic(GetConsoleWindow())) ConsoleIconic = 1; else ConsoleIconic = 0;}
开发者ID:john-peterson,项目名称:john-peterson,代码行数:6,
示例27: Docking_ProcessWindowMessageint Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam){ APPBARDATA abd; static int draggingTitle; MSG *msg = (MSG *)wParam; if (msg->message == WM_DESTROY) cfg::writeByte("CList", "Docked", (BYTE)docked); if (!docked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE) return 0; switch (msg->message) { case WM_CREATE: //if (GetSystemMetrics(SM_CMONITORS)>1) return 0; if (cfg::getByte("CList", "Docked", 0)) PostMessage(msg->hwnd, WM_CREATEDOCKED, 0, 0); draggingTitle = 0; return 0; case WM_CREATEDOCKED: //we need to post a message just after creation to let main message function do some work docked = (int)(char)cfg::getByte("CList", "Docked", 0); if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) { RECT rc, rcMonitor; memset(&abd, 0, sizeof(abd)); abd.cbSize = sizeof(abd); abd.hWnd = msg->hwnd; abd.lParam = 0; abd.uCallbackMessage = WM_DOCKCALLBACK; SHAppBarMessage(ABM_NEW, &abd); GetWindowRect(msg->hwnd, &rc); Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor); Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc); MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE); } break; case WM_ACTIVATE: memset(&abd, 0, sizeof(abd)); abd.cbSize = sizeof(abd); abd.hWnd = msg->hwnd; SHAppBarMessage(ABM_ACTIVATE, &abd); return 0; case WM_WINDOWPOSCHANGED: memset(&abd, 0, sizeof(abd)); abd.cbSize = sizeof(abd); abd.hWnd = msg->hwnd; SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd); return 0; case WM_MOVING: { RECT rcMonitor; POINT ptCursor; // stop early if (GetAsyncKeyState(VK_CONTROL) & 0x8000) return 0; // GetMessagePos() is no good, position is always unsigned GetCursorPos(&ptCursor); Docking_GetMonitorRectFromPoint(ptCursor, &rcMonitor); if ((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) { if (!(GetWindowLongPtr(msg->hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)) { SendMessage(msg->hwnd, CLUIINTM_REDRAW, 0, 0); MessageBox(0, TranslateT("The contact list cannot be docked when using the default title bar and border. Use a toolwindow or borderless style instead."), TranslateT("Contact list docking"), MB_OK); return 0; } memset(&abd, 0, sizeof(abd)); abd.cbSize = sizeof(abd); abd.hWnd = msg->hwnd; abd.lParam = 0; abd.uCallbackMessage = WM_DOCKCALLBACK; SHAppBarMessage(ABM_NEW, &abd); if (ptCursor.x < rcMonitor.left + EDGESENSITIVITY) docked = DOCKED_LEFT; else docked = DOCKED_RIGHT; SendMessage(msg->hwnd, WM_LBUTTONUP, 0, MAKELPARAM(ptCursor.x, ptCursor.y)); GetWindowRect(msg->hwnd, (LPRECT)msg->lParam); Docking_AdjustPosition(msg->hwnd, (LPRECT)&rcMonitor, (LPRECT)msg->lParam); PostMessage(msg->hwnd, CLUIINTM_REDRAW, 0, 0); return TRUE; } } return 0; case WM_MOVE: if (docked) { RECT rc, rcMonitor; Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor); GetWindowRect(msg->hwnd, &rc); Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc); MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE); return 1; } return 0;//.........这里部分代码省略.........
开发者ID:Seldom,项目名称:miranda-ng,代码行数:101,
示例28: wWinMainint WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpstrCmdLine, int nCmdShow) { g_hInstance = hInstance; json_value* appSettings = GetApplicationSettings(); if (GetApplicationSettingsError().length()) { std::string error = GetApplicationSettingsError(); error.append("/nApplication will terminate immediately. "); FatalError(NULL, error); } // Debugging options. bool show_console = (*appSettings)["debugging"]["show_console"]; bool subprocess_show_console = (*appSettings)["debugging"]["subprocess_show_console"]; std::string log_level = (*appSettings)["debugging"]["log_level"]; std::string log_file = (*appSettings)["debugging"]["log_file"]; log_file = GetAbsolutePath(log_file); // Initialize logging. if (std::wstring(lpstrCmdLine).find(L"--type=") != std::string::npos) { // This is a subprocess. InitializeLogging(subprocess_show_console, log_level, log_file); } else { // Main browser process. InitializeLogging(show_console, log_level, log_file); } // Command line arguments LPWSTR *argv; int argc; argv = CommandLineToArgvW(GetCommandLineW(), &argc); if (argv) { for (int i = 0; i < argc; i++) { std::string argument = WideToUtf8(std::wstring(argv[i])); size_t pos = argument.find("="); if (pos != std::string::npos) { std::string name = argument.substr(0, pos); std::string value = argument.substr(pos+1, std::string::npos); if (name == "--cgi-environment" && value.length()) { g_cgiEnvironmentFromArgv.assign(value); } } } } else { LOG_WARNING << "CommandLineToArgvW() failed"; } // CEF subprocesses. CefMainArgs main_args(hInstance); CefRefPtr<App> app(new App); int exit_code = CefExecuteProcess(main_args, app.get(), NULL); if (exit_code >= 0) { ShutdownLogging(); return exit_code; } LOG_INFO << "--------------------------------------------------------"; LOG_INFO << "Started application"; if (log_file.length()) LOG_INFO << "Logging to: " << log_file; else LOG_INFO << "No logging file set"; LOG_INFO << "Log level = " << FILELog::ToString(FILELog::ReportingLevel()); // Main window title option. std::string main_window_title = (*appSettings)["main_window"]["title"]; if (main_window_title.empty()) main_window_title = GetExecutableName(); // Single instance guid option. const char* single_instance_guid = (*appSettings)["application"]["single_instance_guid"]; if (single_instance_guid && single_instance_guid[0] != 0) { int guidSize = strlen(single_instance_guid) + 1; g_singleInstanceApplicationGuid = new wchar_t[guidSize]; Utf8ToWide(single_instance_guid, g_singleInstanceApplicationGuid, guidSize); } if (g_singleInstanceApplicationGuid && g_singleInstanceApplicationGuid[0] != 0) { g_singleInstanceApplication.Initialize( g_singleInstanceApplicationGuid); if (g_singleInstanceApplication.IsRunning()) { HWND hwnd = FindWindow(g_singleInstanceApplicationGuid, NULL); if (hwnd) { if (IsIconic(hwnd)) ShowWindow(hwnd, SW_RESTORE); SetForegroundWindow(hwnd); return 0; } } } // Window class name. if (g_singleInstanceApplicationGuid) { swprintf_s(g_windowClassName, _countof(g_windowClassName), L"%s", g_singleInstanceApplicationGuid); } else { swprintf_s(g_windowClassName, _countof(g_windowClassName), L"%s",//.........这里部分代码省略.........
开发者ID:Anubis00,项目名称:phpdesktop,代码行数:101,
示例29: Docking_ProcessWindowMessageint Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam){ APPBARDATA abd; static int draggingTitle; MSG *msg=(MSG*)wParam; if(msg->message==WM_DESTROY) DBWriteContactSettingByte(NULL,"CList","Docked",(BYTE)docked); if(!docked && msg->message!=WM_CREATE && msg->message!=WM_MOVING && msg->message!=WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0; switch(msg->message) { case WM_CREATE: //if(GetSystemMetrics(SM_CMONITORS)>1) return 0; if(DBGetContactSettingByte(NULL,"CList","Docked",0)) { PostMessage(msg->hwnd,WM_CREATEDOCKED,0,0); } draggingTitle=0; return 0; case WM_CREATEDOCKED: //we need to post a message just after creation to let main message function do some work docked=(int)(char)DBGetContactSettingByte(NULL,"CList","Docked",0); if(IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) { RECT rc, rcMonitor; ZeroMemory(&abd,sizeof(abd)); abd.cbSize=sizeof(abd); abd.hWnd=msg->hwnd; abd.lParam=0; abd.uCallbackMessage=WM_DOCKCALLBACK; SHAppBarMessage(ABM_NEW,&abd); GetWindowRect(msg->hwnd,&rc); Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor); Docking_AdjustPosition(msg->hwnd,&rcMonitor,&rc); MoveWindow(msg->hwnd,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,TRUE); dock_prevent_moving=0; OnMoving(msg->hwnd,&rc); dock_prevent_moving=1; ReposButtons(msg->hwnd,0,NULL); } break; case WM_CAPTURECHANGED: ReposButtons(msg->hwnd,0,NULL); return 0; case WM_ACTIVATE: ZeroMemory(&abd,sizeof(abd)); abd.cbSize=sizeof(abd); abd.hWnd=msg->hwnd; SHAppBarMessage(ABM_ACTIVATE,&abd); return 0; case WM_SIZE: ReposButtons(msg->hwnd,1,NULL); return 0; case WM_WINDOWPOSCHANGED: { if (docked) ReposButtons(msg->hwnd,0,NULL); return 0; ZeroMemory(&abd,sizeof(abd)); abd.cbSize=sizeof(abd); abd.hWnd=msg->hwnd; SHAppBarMessage(ABM_WINDOWPOSCHANGED,&abd); ReposButtons(msg->hwnd,0,NULL); return 0; } case WM_MOVING: { RECT rcMonitor; RECT rcWindow; RECT *rc; int dx=0; POINT ptCursor; if (docked) return 0; // stop early if(!(GetAsyncKeyState(VK_CONTROL)&0x8000)) return 0; // GetMessagePos() is no good, position is always unsigned GetCursorPos(&ptCursor); GetWindowRect(msg->hwnd,&rcWindow); dock_drag_dx=rcWindow.left-ptCursor.x; dock_drag_dy=rcWindow.top-ptCursor.y; Docking_GetMonitorRectFromPoint(ptCursor,&rcMonitor); if(((ptCursor.x<rcMonitor.left+EDGESENSITIVITY) || (ptCursor.x>=rcMonitor.right-EDGESENSITIVITY)) ) { ZeroMemory(&abd,sizeof(abd)); abd.cbSize=sizeof(abd); abd.hWnd=msg->hwnd; abd.lParam=0; abd.uCallbackMessage=WM_DOCKCALLBACK; SHAppBarMessage(ABM_NEW,&abd); if(ptCursor.x<rcMonitor.left+EDGESENSITIVITY) docked=DOCKED_LEFT; else docked=DOCKED_RIGHT; // TempDock=1; GetWindowRect(msg->hwnd,(LPRECT)msg->lParam); rc=(RECT*)msg->lParam; if (docked==DOCKED_RIGHT) dx=(rc->right>rcMonitor.right)?rc->right-rcMonitor.right:0;//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:modernb-svn,代码行数:101,
注:本文中的IsIconic函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ IsInBag函数代码示例 C++ IsHorzDocked函数代码示例 |