1*161f4cd1SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*161f4cd1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*161f4cd1SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*161f4cd1SAndrew Rist * distributed with this work for additional information 6*161f4cd1SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*161f4cd1SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*161f4cd1SAndrew Rist * "License"); you may not use this file except in compliance 9*161f4cd1SAndrew Rist * with the License. You may obtain a copy of the License at 10*161f4cd1SAndrew Rist * 11*161f4cd1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*161f4cd1SAndrew Rist * 13*161f4cd1SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*161f4cd1SAndrew Rist * software distributed under the License is distributed on an 15*161f4cd1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*161f4cd1SAndrew Rist * KIND, either express or implied. See the License for the 17*161f4cd1SAndrew Rist * specific language governing permissions and limitations 18*161f4cd1SAndrew Rist * under the License. 19*161f4cd1SAndrew Rist * 20*161f4cd1SAndrew Rist *************************************************************/ 21*161f4cd1SAndrew Rist 22*161f4cd1SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SV_WINCOMP_HXX 25cdf0e10cSrcweir #define _SV_WINCOMP_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef _STRING_H 28cdf0e10cSrcweir #include <string.h> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir // ---------- 32cdf0e10cSrcweir // - Strict - 33cdf0e10cSrcweir // ---------- 34cdf0e10cSrcweir 35cdf0e10cSrcweir // Anpassungen fuer TypeChecking 36cdf0e10cSrcweir 37cdf0e10cSrcweir inline HPEN SelectPen( HDC hDC, HPEN hPen ) 38cdf0e10cSrcweir { 39cdf0e10cSrcweir return (HPEN)SelectObject( hDC, (HGDIOBJ)hPen ); 40cdf0e10cSrcweir } 41cdf0e10cSrcweir 42cdf0e10cSrcweir inline void DeletePen( HPEN hPen ) 43cdf0e10cSrcweir { 44cdf0e10cSrcweir DeleteObject( (HGDIOBJ)hPen ); 45cdf0e10cSrcweir } 46cdf0e10cSrcweir 47cdf0e10cSrcweir inline HPEN GetStockPen( int nObject ) 48cdf0e10cSrcweir { 49cdf0e10cSrcweir return (HPEN)GetStockObject( nObject ); 50cdf0e10cSrcweir } 51cdf0e10cSrcweir 52cdf0e10cSrcweir inline HBRUSH SelectBrush( HDC hDC, HBRUSH hBrush ) 53cdf0e10cSrcweir { 54cdf0e10cSrcweir return (HBRUSH)SelectObject( hDC, (HGDIOBJ)hBrush ); 55cdf0e10cSrcweir } 56cdf0e10cSrcweir 57cdf0e10cSrcweir inline void DeleteBrush( HBRUSH hBrush ) 58cdf0e10cSrcweir { 59cdf0e10cSrcweir DeleteObject( (HGDIOBJ)hBrush ); 60cdf0e10cSrcweir } 61cdf0e10cSrcweir 62cdf0e10cSrcweir inline HBRUSH GetStockBrush( int nObject ) 63cdf0e10cSrcweir { 64cdf0e10cSrcweir return (HBRUSH)GetStockObject( nObject ); 65cdf0e10cSrcweir } 66cdf0e10cSrcweir 67cdf0e10cSrcweir inline HFONT SelectFont( HDC hDC, HFONT hFont ) 68cdf0e10cSrcweir { 69cdf0e10cSrcweir return (HFONT)SelectObject( hDC, (HGDIOBJ)hFont ); 70cdf0e10cSrcweir } 71cdf0e10cSrcweir 72cdf0e10cSrcweir inline void DeleteFont( HFONT hFont ) 73cdf0e10cSrcweir { 74cdf0e10cSrcweir DeleteObject( (HGDIOBJ)hFont ); 75cdf0e10cSrcweir } 76cdf0e10cSrcweir 77cdf0e10cSrcweir inline HFONT GetStockFont( int nObject ) 78cdf0e10cSrcweir { 79cdf0e10cSrcweir return (HFONT)GetStockObject( nObject ); 80cdf0e10cSrcweir } 81cdf0e10cSrcweir 82cdf0e10cSrcweir inline HBITMAP SelectBitmap( HDC hDC, HBITMAP hBitmap ) 83cdf0e10cSrcweir { 84cdf0e10cSrcweir return (HBITMAP)SelectObject( hDC, (HGDIOBJ)hBitmap ); 85cdf0e10cSrcweir } 86cdf0e10cSrcweir 87cdf0e10cSrcweir inline void DeleteBitmap( HBITMAP hBitmap ) 88cdf0e10cSrcweir { 89cdf0e10cSrcweir DeleteObject( (HGDIOBJ)hBitmap ); 90cdf0e10cSrcweir } 91cdf0e10cSrcweir 92cdf0e10cSrcweir inline void DeleteRegion( HRGN hRegion ) 93cdf0e10cSrcweir { 94cdf0e10cSrcweir DeleteObject( (HGDIOBJ)hRegion ); 95cdf0e10cSrcweir } 96cdf0e10cSrcweir 97cdf0e10cSrcweir inline HPALETTE GetStockPalette( int nObject ) 98cdf0e10cSrcweir { 99cdf0e10cSrcweir return (HPALETTE)GetStockObject( nObject ); 100cdf0e10cSrcweir } 101cdf0e10cSrcweir 102cdf0e10cSrcweir inline void DeletePalette( HPALETTE hPalette ) 103cdf0e10cSrcweir { 104cdf0e10cSrcweir DeleteObject( (HGDIOBJ)hPalette ); 105cdf0e10cSrcweir } 106cdf0e10cSrcweir 107cdf0e10cSrcweir inline void SetWindowStyle( HWND hWnd, DWORD nStyle ) 108cdf0e10cSrcweir { 109cdf0e10cSrcweir SetWindowLong( hWnd, GWL_STYLE, nStyle ); 110cdf0e10cSrcweir } 111cdf0e10cSrcweir 112cdf0e10cSrcweir inline DWORD GetWindowStyle( HWND hWnd ) 113cdf0e10cSrcweir { 114cdf0e10cSrcweir return GetWindowLong( hWnd, GWL_STYLE ); 115cdf0e10cSrcweir } 116cdf0e10cSrcweir 117cdf0e10cSrcweir inline void SetWindowExStyle( HWND hWnd, DWORD nStyle ) 118cdf0e10cSrcweir { 119cdf0e10cSrcweir SetWindowLong( hWnd, GWL_EXSTYLE, nStyle ); 120cdf0e10cSrcweir } 121cdf0e10cSrcweir 122cdf0e10cSrcweir inline DWORD GetWindowExStyle( HWND hWnd ) 123cdf0e10cSrcweir { 124cdf0e10cSrcweir return GetWindowLong( hWnd, GWL_EXSTYLE ); 125cdf0e10cSrcweir } 126cdf0e10cSrcweir 127cdf0e10cSrcweir inline BOOL IsMinimized( HWND hWnd ) 128cdf0e10cSrcweir { 129cdf0e10cSrcweir return IsIconic( hWnd ); 130cdf0e10cSrcweir } 131cdf0e10cSrcweir 132cdf0e10cSrcweir inline BOOL IsMaximized( HWND hWnd ) 133cdf0e10cSrcweir { 134cdf0e10cSrcweir return IsZoomed( hWnd ); 135cdf0e10cSrcweir } 136cdf0e10cSrcweir 137cdf0e10cSrcweir inline void SetWindowFont( HWND hWnd, HFONT hFont, BOOL bRedraw ) 138cdf0e10cSrcweir { 139cdf0e10cSrcweir SendMessage( hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM((UINT)bRedraw,0) ); 140cdf0e10cSrcweir } 141cdf0e10cSrcweir 142cdf0e10cSrcweir inline HFONT GetWindowFont( HWND hWnd ) 143cdf0e10cSrcweir { 144cdf0e10cSrcweir return (HFONT)(UINT)SendMessage( hWnd, WM_GETFONT, 0, 0 ); 145cdf0e10cSrcweir } 146cdf0e10cSrcweir 147cdf0e10cSrcweir inline void SetClassCursor( HWND hWnd, HCURSOR hCursor ) 148cdf0e10cSrcweir { 149cdf0e10cSrcweir SetClassLong( hWnd, GCL_HCURSOR, (DWORD)hCursor ); 150cdf0e10cSrcweir } 151cdf0e10cSrcweir 152cdf0e10cSrcweir inline HCURSOR GetClassCursor( HWND hWnd ) 153cdf0e10cSrcweir { 154cdf0e10cSrcweir return (HCURSOR)GetClassLong( hWnd, GCL_HCURSOR ); 155cdf0e10cSrcweir } 156cdf0e10cSrcweir 157cdf0e10cSrcweir inline void SetClassIcon( HWND hWnd, HICON hIcon ) 158cdf0e10cSrcweir { 159cdf0e10cSrcweir SetClassLong( hWnd, GCL_HICON, (DWORD)hIcon ); 160cdf0e10cSrcweir } 161cdf0e10cSrcweir 162cdf0e10cSrcweir inline HICON GetClassIcon( HWND hWnd ) 163cdf0e10cSrcweir { 164cdf0e10cSrcweir return (HICON)GetClassLong( hWnd, GCL_HICON ); 165cdf0e10cSrcweir } 166cdf0e10cSrcweir 167cdf0e10cSrcweir inline HBRUSH SetClassBrush( HWND hWnd, HBRUSH hBrush ) 168cdf0e10cSrcweir { 169cdf0e10cSrcweir return (HBRUSH)SetClassLong( hWnd, GCL_HBRBACKGROUND, (DWORD)hBrush ); 170cdf0e10cSrcweir } 171cdf0e10cSrcweir 172cdf0e10cSrcweir inline HBRUSH GetClassBrush( HWND hWnd ) 173cdf0e10cSrcweir { 174cdf0e10cSrcweir return (HBRUSH)GetClassLong( hWnd, GCL_HBRBACKGROUND ); 175cdf0e10cSrcweir } 176cdf0e10cSrcweir 177cdf0e10cSrcweir inline HINSTANCE GetWindowInstance( HWND hWnd ) 178cdf0e10cSrcweir { 179cdf0e10cSrcweir return (HINSTANCE)GetWindowLong( hWnd, GWL_HINSTANCE ); 180cdf0e10cSrcweir } 181cdf0e10cSrcweir 182cdf0e10cSrcweir // ------------------------ 183cdf0e10cSrcweir // - ZMouse Erweiterungen - 184cdf0e10cSrcweir // ------------------------ 185cdf0e10cSrcweir 186cdf0e10cSrcweir #define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG" 187cdf0e10cSrcweir 188cdf0e10cSrcweir #define MOUSEZ_CLASSNAME "MouseZ" // wheel window class 189cdf0e10cSrcweir #define MOUSEZ_TITLE "Magellan MSWHEEL" // wheel window title 190cdf0e10cSrcweir 191cdf0e10cSrcweir #define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME) 192cdf0e10cSrcweir #define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE) 193cdf0e10cSrcweir 194cdf0e10cSrcweir #define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG" 195cdf0e10cSrcweir 196cdf0e10cSrcweir #ifndef WHEEL_DELTA 197cdf0e10cSrcweir #define WHEEL_DELTA 120 198cdf0e10cSrcweir #endif 199cdf0e10cSrcweir #ifndef WM_MOUSEWHEEL 200cdf0e10cSrcweir #define WM_MOUSEWHEEL 0x020A 201cdf0e10cSrcweir #endif 202cdf0e10cSrcweir #ifndef SPI_GETWHEELSCROLLLINES 203cdf0e10cSrcweir #define SPI_GETWHEELSCROLLLINES 104 204cdf0e10cSrcweir #endif 205cdf0e10cSrcweir #ifndef SPI_SETWHEELSCROLLLINES 206cdf0e10cSrcweir #define SPI_SETWHEELSCROLLLINES 105 207cdf0e10cSrcweir #endif 208cdf0e10cSrcweir #ifndef WHEEL_PAGESCROLL 209cdf0e10cSrcweir #define WHEEL_PAGESCROLL (UINT_MAX) 210cdf0e10cSrcweir #endif 211cdf0e10cSrcweir 212cdf0e10cSrcweir 213cdf0e10cSrcweir // ----------------------------- 214cdf0e10cSrcweir // - SystemAgent Erweiterungen - 215cdf0e10cSrcweir // ----------------------------- 216cdf0e10cSrcweir 217cdf0e10cSrcweir #define ENABLE_AGENT 1 218cdf0e10cSrcweir #define DISABLE_AGENT 2 219cdf0e10cSrcweir #define GET_AGENT_STATUS 3 220cdf0e10cSrcweir typedef int (APIENTRY* SysAgt_Enable_PROC)( int ); 221cdf0e10cSrcweir 222cdf0e10cSrcweir // --------------------- 223cdf0e10cSrcweir // - 5.0-Erweiterungen - 224cdf0e10cSrcweir // --------------------- 225cdf0e10cSrcweir 226cdf0e10cSrcweir #ifndef COLOR_GRADIENTACTIVECAPTION 227cdf0e10cSrcweir #define COLOR_GRADIENTACTIVECAPTION 27 228cdf0e10cSrcweir #endif 229cdf0e10cSrcweir #ifndef COLOR_GRADIENTINACTIVECAPTION 230cdf0e10cSrcweir #define COLOR_GRADIENTINACTIVECAPTION 28 231cdf0e10cSrcweir #endif 232cdf0e10cSrcweir 233cdf0e10cSrcweir #ifndef SPI_GETFLATMENU 234cdf0e10cSrcweir #define SPI_GETFLATMENU 0x1022 235cdf0e10cSrcweir #endif 236cdf0e10cSrcweir #ifndef COLOR_MENUBAR 237cdf0e10cSrcweir #define COLOR_MENUBAR 30 238cdf0e10cSrcweir #endif 239cdf0e10cSrcweir #ifndef COLOR_MENUHILIGHT 240cdf0e10cSrcweir #define COLOR_MENUHILIGHT 29 241cdf0e10cSrcweir #endif 242cdf0e10cSrcweir 243cdf0e10cSrcweir #ifndef CS_DROPSHADOW 244cdf0e10cSrcweir #define CS_DROPSHADOW 0x00020000 245cdf0e10cSrcweir #endif 246cdf0e10cSrcweir 247cdf0e10cSrcweir // ------------------------------------------------------- 248cdf0e10cSrcweir // MT 12/03: From winuser.h, only needed in salframe.cxx 249cdf0e10cSrcweir // Better change salframe.cxx to include winuser.h 250cdf0e10cSrcweir // ------------------------------------------------------- 251cdf0e10cSrcweir 252cdf0e10cSrcweir #define WS_EX_LAYERED 0x00080000 253cdf0e10cSrcweir 254cdf0e10cSrcweir #ifndef WM_UNICHAR 255cdf0e10cSrcweir #define WM_UNICHAR 0x0109 256cdf0e10cSrcweir #define UNICODE_NOCHAR 0xFFFF 257cdf0e10cSrcweir #endif 258cdf0e10cSrcweir 259cdf0e10cSrcweir #endif // _SV_WINCOMP_HXX 260