#include <windows.h>#include <winspool.h>#include "ut_debugmsg.h"#include "ut_assert.h"#include "ut_locale.h"#include "ut_iconv.h"#include "ut_Win32OS.h"Defines | |
| #define | GETDEFAULTPRINTER "GetDefaultPrinterW" |
Functions | |
| OSVERSIONINFOW & | UT_GetWinVersion (void) |
| bool | UT_IsWinVista (void) |
| bool | UT_IsWinNT (void) |
| bool | UT_IsWin2K (void) |
| bool | UT_IsWin95 (void) |
| DLGTEMPLATE *WINAPI | UT_LockDlgRes (HINSTANCE hinst, LPCWSTR lpszResName) |
| wchar_t * | UT_GetDefaultPrinterName () |
| HDC | UT_GetDefaultPrinterDC () |
| ATOM | UT_RegisterClassEx (UINT style, WNDPROC wndproc, HINSTANCE hInstance, HICON hIcon, HCURSOR hCursor, HBRUSH hbrBackground, HICON hIconSm, const wchar_t *menu, const wchar_t *name) |
| LRESULT | UT_DefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) |
| BOOL | UT_SetWindowText (HWND hWnd, const wchar_t *lpString) |
| BOOL | UT_GetMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax) |
| LRESULT | UT_DispatchMessage (const MSG *lpmsg) |
| HWND | UT_CreateWindowEx (DWORD dwExStyle, const wchar_t *pszClassName, const wchar_t *pszWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) |
| #define GETDEFAULTPRINTER "GetDefaultPrinterW" |
This code is based on function by Philippe Randour <philippe_randour at="" hotmail="" dot="" com>=""> and was found at http://bdn.borland.com/article/0,1410,28000,00.html
(It is real pain that such an elementary task should be so hard)
The caller must g_free the returned pointer when no longer needed
Referenced by UT_GetDefaultPrinterName().
| HWND UT_CreateWindowEx | ( | DWORD | dwExStyle, | |
| const wchar_t * | pszClassName, | |||
| const wchar_t * | pszWindowName, | |||
| DWORD | dwStyle, | |||
| int | x, | |||
| int | y, | |||
| int | nWidth, | |||
| int | nHeight, | |||
| HWND | hWndParent, | |||
| HMENU | hMenu, | |||
| HINSTANCE | hInstance, | |||
| LPVOID | lpParam | |||
| ) |
References UT_ASSERT.
Referenced by AP_Win32FrameImpl::_createDocumentWindow(), XAP_Win32FrameImpl::_createTopLevelWindow(), AP_Win32TopRuler::createWindow(), AP_Win32StatusBar::createWindow(), AP_Win32LeftRuler::createWindow(), XAP_Win32Dialog_About::runModal(), EV_Win32Toolbar::synthesize(), and XAP_Win32PreviewWidget::XAP_Win32PreviewWidget().
| LRESULT UT_DefWindowProc | ( | HWND | hWnd, | |
| UINT | Msg, | |||
| WPARAM | wParam, | |||
| LPARAM | lParam | |||
| ) |
| LRESULT UT_DispatchMessage | ( | const MSG * | lpmsg | ) |
Referenced by AP_Win32App::WinMain().
| HDC UT_GetDefaultPrinterDC | ( | ) |
This function obtains a DC for the default printer The caller needs to call DeleteDC when dc is no longer needed.
References UT_GetDefaultPrinterName(), and UT_IsWinNT().
Referenced by GR_Win32Graphics::GR_Win32Graphics(), and GR_Win32USPGraphics::measureRenderedCharWidths().
| wchar_t* UT_GetDefaultPrinterName | ( | ) |
References GETDEFAULTPRINTER, HRESULT(), UT_calloc(), and UT_return_val_if_fail.
Referenced by GR_Win32Graphics::getPrinterGraphics(), and UT_GetDefaultPrinterDC().
| BOOL UT_GetMessage | ( | LPMSG | lpMsg, | |
| HWND | hWnd, | |||
| UINT | wMsgFilterMin, | |||
| UINT | wMsgFilterMax | |||
| ) |
Referenced by AP_Win32App::WinMain().
| OSVERSIONINFOW& UT_GetWinVersion | ( | void | ) |
Returns Windows's OSVERSIONINFO structure
References UT_ASSERT.
Referenced by UT_IsWin2K(), UT_IsWin95(), UT_IsWinNT(), and UT_IsWinVista().
| bool UT_IsWin2K | ( | void | ) |
Return true if we're running on Windows 2000, false otherwise
References UT_GetWinVersion().
| bool UT_IsWin95 | ( | void | ) |
Return true if we're running on Windows 95, false otherwise
References UT_GetWinVersion().
Referenced by GR_Win32Graphics::handleSetCursorMessage().
| bool UT_IsWinNT | ( | void | ) |
Return true if we're running on Windows NT, false otherwise
References UT_GetWinVersion().
Referenced by GR_Win32Graphics::_setTransform(), IE_Exp_Text::_writeDocument(), AP_Win32App::copyToClipboard(), GR_Win32Graphics::drawChar(), GR_Win32Graphics::drawChars(), GR_Win32Graphics::getPrinterGraphics(), GR_Win32Font::glyphBox(), ev_Win32Keyboard::remapKeyboard(), GR_Win32CharWidths::setCharWidthsOfRange(), and UT_GetDefaultPrinterDC().
| bool UT_IsWinVista | ( | void | ) |
Return true if we're running on Windows Vista, false otherwise
References UT_GetWinVersion().
Referenced by EV_Win32Menu::onInitMenu(), and EV_Win32Menu::synthesizeMenu().
| DLGTEMPLATE* WINAPI UT_LockDlgRes | ( | HINSTANCE | hinst, | |
| LPCWSTR | lpszResName | |||
| ) |
This function loads and locks a dialog template resource.
| hinst | ||
| lpszResName | Name of the resource |
Returns the address of the locked resource. The caller is responsible for any unlocking/releasing necessary. This function is used by the various tabbed dialogs to load the sub-dialogs.
Referenced by AP_Win32Dialog_Paragraph::_onInitDialog().
| ATOM UT_RegisterClassEx | ( | UINT | style, | |
| WNDPROC | wndproc, | |||
| HINSTANCE | hInstance, | |||
| HICON | hIcon, | |||
| HCURSOR | hCursor, | |||
| HBRUSH | hbrBackground, | |||
| HICON | hIconSm, | |||
| const wchar_t * | menu, | |||
| const wchar_t * | name | |||
| ) |
| BOOL UT_SetWindowText | ( | HWND | hWnd, | |
| const wchar_t * | lpString | |||
| ) |
1.7.1