Defines | Functions

ut_Win32OS.cpp File Reference

#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"


#define GETDEFAULTPRINTER   "GetDefaultPrinterW"


OSVERSIONINFOW & UT_GetWinVersion (void)
bool UT_IsWinVista (void)
bool UT_IsWinNT (void)
bool UT_IsWin2K (void)
bool UT_IsWin95 (void)
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 Documentation

#define GETDEFAULTPRINTER   "GetDefaultPrinterW"

This code is based on function by Philippe Randour <philippe_randour at="" hotmail="" dot="" com>=""> and was found at,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().

Function Documentation

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 
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 (  ) 
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   ) 
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().

LPCWSTR  lpszResName 

This function loads and locks a dialog template resource.

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