// ********************************************************* // ウインドウ位置の変更 // 戻り値 : 成功 true, 失敗 false // ********************************************************* BOOL LboxMoveWindow( HWND hWnd, int x, int y ) { BOOL bRet; bRet = SetWindowPos( hWnd, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER ); if ( !bRet ) { return false; } return true; }
// ********************************************************* // ウインドウサイズの変更 // 戻り値 : 成功 true, 失敗 false // ********************************************************* BOOL LboxChangeWindowSize( HWND hWnd, int w, int h ) { BOOL bRet; bRet = SetWindowPos( hWnd, NULL, 0, 0, w, h, SWP_NOMOVE | SWP_NOZORDER ); if ( !bRet ) { return false; } return true; }
// ********************************************************* // ウインドウを最前面に移動 // 戻り値 : 成功 true, 失敗 false // ********************************************************* BOOL LboxMoveWindowTop( HWND hWnd ) { BOOL bRet; bRet = SetWindowPos( hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE ); if ( !bRet ) { return false; } return true; }
// ********************************************************* // ウインドウをデスクトップ中央に移動 // 戻り値 : 無し // ********************************************************* void LboxCenterWindow( HWND hWnd ) { RECT rTop; RECT rMe; GetWindowRect( GetDesktopWindow(), &rTop ); GetWindowRect( hWnd, &rMe ); LboxMoveWindow( hWnd, rTop.right/2 - (rMe.right-rMe.left)/2, rTop.bottom/2 - (rMe.bottom-rMe.top)/2 ); }