本文整理汇总了C++中GetDialogBaseUnits函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDialogBaseUnits函数的具体用法?C++ GetDialogBaseUnits怎么用?C++ GetDialogBaseUnits使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetDialogBaseUnits函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WindowProcedure
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HWND hwndList,hwndboton,hwndlabel1,hwndlabel2,hwndtext,hwndboton2;
int iIndex, iLength, cxChar, cyChar;
char nombre[260];
char numero[30];
switch (message)
{
case WM_CTLCOLORSTATIC:
{
HDC hdcStatic = (HDC) wParam;
SetBkColor(hdcStatic,RGB(211,208,201));
return (INT_PTR)CreateSolidBrush(RGB(211,208,201));
}
case WM_CREATE:
{
cxChar = LOWORD(GetDialogBaseUnits());
cyChar = HIWORD(GetDialogBaseUnits());
hwndlabel1 = CreateWindowEx(0,"static", "Selecciona el proceso a Dumpear:", WS_CHILD|WS_VISIBLE|WS_TABSTOP, 10, 10, 230, 20, hwnd, 0, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
hwndlabel2 = CreateWindowEx(0,"static", "Número de offsets a dumpear:", WS_CHILD|WS_VISIBLE|WS_TABSTOP, 10, 60, 230, 20, hwnd, 0, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
hwndList = CreateWindow(TEXT("Combobox"), NULL, WS_CHILD | WS_VISIBLE |LBS_STANDARD, 10, 30, 200,60, hwnd, (HMENU)ID_LIST, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),NULL);
hwndboton = CreateWindowEx(0,"BUTTON", "Refrescar", WS_CHILD|WS_VISIBLE|WS_TABSTOP, 215, 30, 70, 20, hwnd, 0, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
hwndtext = CreateWindowEx(0,"Edit", "", WS_CHILD|WS_VISIBLE|WS_BORDER, 215, 60, 70, 20, hwnd, 0, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
hwndboton2 = CreateWindowEx(0,"BUTTON", "Dumpear!", WS_CHILD|WS_VISIBLE|WS_TABSTOP, 10, 85, 275, 20, hwnd, 0, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
Opciones(hwndList);
return 0;
}
case WM_COMMAND:
{
if((HWND)lParam==hwndboton)
{
Opciones(hwndList);
MessageBoxA(miid,"Se a refrescado la lista de procesos","Drink Dump v1.0",MB_OK);
}
if((HWND)lParam==hwndboton2)
{
GetWindowText(hwndtext,numero,10);
GetWindowText(hwndList,nombre,260);
Dumpear(nombre,numero);
}
break;
}
case WM_DESTROY:
{
PostQuitMessage (0);
break;
}
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
示例2: kwin_getminmaxinfo
/*
* Function: Process WM_GETMINMAXINFO messages
*/
static void
kwin_getminmaxinfo(HWND hwnd, LPMINMAXINFO lpmmi)
{
lpmmi->ptMinTrackSize.x =
(KWIN_MIN_WIDTH * LOWORD(GetDialogBaseUnits())) / 4;
lpmmi->ptMinTrackSize.y =
(KWIN_MIN_HEIGHT * HIWORD(GetDialogBaseUnits())) / 8;
}
示例3: StretchBitmap
HBITMAP StretchBitmap (HBITMAP hBitmap1)
{
BITMAP bm1, bm2 ;
HBITMAP hBitmap2 ;
HDC hdc, hdcMem1, hdcMem2 ;
int cxChar, cyChar ;
// Get the width and height of a system font character
cxChar = LOWORD (GetDialogBaseUnits ()) ;
cyChar = HIWORD (GetDialogBaseUnits ()) ;
// Create 2 memory DCs compatible with the display
hdc = CreateIC (TEXT ("DISPLAY"), NULL, NULL, NULL) ;
hdcMem1 = CreateCompatibleDC (hdc) ;
hdcMem2 = CreateCompatibleDC (hdc) ;
DeleteDC (hdc) ;
// Get the dimensions of the bitmap to be stretched
GetObject (hBitmap1, sizeof (BITMAP), (PTSTR) &bm1) ;
// Scale these dimensions based on the system font size
bm2 = bm1 ;
bm2.bmWidth = (cxChar * bm2.bmWidth) / 4 ;
bm2.bmHeight = (cyChar * bm2.bmHeight) / 8 ;
bm2.bmWidthBytes = ((bm2.bmWidth + 15) / 16) * 2 ;
// Create a new bitmap of larger size
hBitmap2 = CreateBitmapIndirect (&bm2) ;
// Select the bitmaps in the memory DCs and do a StretchBlt
SelectObject (hdcMem1, hBitmap1) ;
SelectObject (hdcMem2, hBitmap2) ;
StretchBlt (hdcMem2, 0, 0, bm2.bmWidth, bm2.bmHeight,
hdcMem1, 0, 0, bm1.bmWidth, bm1.bmHeight, SRCCOPY) ;
// Clean up
DeleteDC (hdcMem1) ;
DeleteDC (hdcMem2) ;
DeleteObject (hBitmap1) ;
return hBitmap2 ;
}
示例4: create_item
static int create_item(HDC hdc, const SANE_Option_Descriptor *opt,
INT id, LPDLGITEMTEMPLATEW *template_out, int y, int *cx, int* count)
{
LPDLGITEMTEMPLATEW tpl = NULL,rc = NULL;
WORD class = 0xffff;
DWORD styles = WS_VISIBLE;
LPBYTE ptr = NULL;
LPDLGITEMTEMPLATEW lead_static = NULL;
LPDLGITEMTEMPLATEW trail_edit = NULL;
DWORD leading_len = 0;
DWORD trail_len = 0;
DWORD local_len = 0;
LPCSTR title = NULL;
CHAR buffer[255];
int padding = 0;
int padding2 = 0;
int base_x = 0;
LONG base;
int ctl_cx = 0;
SIZE size;
GetTextExtentPoint32A(hdc,"X",1,&size);
base = GetDialogBaseUnits();
base_x = MulDiv(size.cx,4,LOWORD(base));
if (opt->type == SANE_TYPE_BOOL)
{
class = 0x0080; /* Button */
styles |= BS_AUTOCHECKBOX;
local_len += MultiByteToWideChar(CP_ACP,0,opt->title,-1,NULL,0);
local_len *= sizeof(WCHAR);
title = opt->title;
}
else if (opt->type == SANE_TYPE_INT)
示例5: GetClientRect
void CPrefView::ReSize()
{
CRect rect;
CRect rect_cy;
GetClientRect(rect);
int x=rect.right;
int y=rect.bottom;
// if (x<500) x=500;
// if (y<400) y=400;
LONG l=GetDialogBaseUnits();
double kx=LOWORD(l)/8.0;
double ky=HIWORD(l)/16.0;
m_ComboY.GetClientRect(rect_cy);
WORD dx=6;
WORD dy=13;
int x1,y1;
x1=(136*dx)/4; y1=(125*dy)/8;
//m_Grid.MoveWindow((int)(x1*kx),(int)(y1*ky),(int)(x-x1*kx-10),(int)(y-y1*ky-10));
m_Grid.MoveWindow(rect_cy.right+30,(int)(y1*ky),(int)(x-rect_cy.right-40),(int)(y-y1*ky-10));
GetDlgItem(IDC_STATIC_FACE)->MoveWindow((int)(x-40*kx),(int)(33*ky),32,32);
x1=(140*dx)/4; y1=(13*dy)/8;
//GetDlgItem(IDC_STATIC_SCALE)->MoveWindow((int)(x1*kx),(int)(33*ky),(int)(x-(x1+50)*kx),(int)(20*ky));
GetDlgItem(IDC_STATIC_SCALE)->MoveWindow(rect_cy.right+30,(int)(33*ky),(int)(x-rect_cy.right-30-50*kx),(int)(20*ky));
//y1=(25*dy)/8;
//m_Slider.MoveWindow((int)(x1*kx),(int)(55*ky),(int)(x-(x1+50)*kx),(int)(30*ky));
m_Slider.MoveWindow(rect_cy.right+30,(int)(55*ky),(int)(x-rect_cy.right-30-50*kx),(int)(30*ky));
}
示例6: hugsprim_GetDialogBaseUnits_10
static void hugsprim_GetDialogBaseUnits_10(HugsStackPtr hugs_root)
{
HsInt32 res1;
res1 = GetDialogBaseUnits();
hugs->putInt32(res1);
hugs->returnIO(hugs_root,1);
}
示例7: zGetDialogBaseUnits
DWORD far pascal zGetDialogBaseUnits()
{
DWORD r;
SaveRegs();
/*
** Log IN Parameters (No Create/Destroy Checking Yet!)
*/
LogIn( (LPSTR)"APICALL:GetDialogBaseUnits " );
/*
** Call the API!
*/
RestoreRegs();
GrovelDS();
r = GetDialogBaseUnits();
UnGrovelDS();
SaveRegs();
/*
** Log Return Code & OUT Parameters (No Create/Destroy Checking Yet!)
*/
LogOut( (LPSTR)"APIRET:GetDialogBaseUnits DWORD+", r );
RestoreRegs();
return( r );
}
示例8: MapDialogRect
void WINAPI
MapDialogRect(HWND hDlg, RECT FAR *lpRect)
{
HDC hDC;
HFONT hFont, hFontOld = 0;
TEXTMETRIC TextMetrics;
DWORD dwFontUnits;
int width, height;
hDC = GetDC(hDlg);
hFont = (HFONT)SendMessage(hDlg, WM_GETFONT, 0, 0);
if ( hFont )
hFontOld = SelectObject(hDC, hFont);
if ( GetTextMetrics(hDC, &TextMetrics) ) {
width = TextMetrics.tmAveCharWidth;
height = TextMetrics.tmHeight;
} else {
dwFontUnits = GetDialogBaseUnits();
width = (int)LOWORD(dwFontUnits);
height = (int)HIWORD(dwFontUnits);
}
if ( hFontOld )
SelectObject(hDC, hFontOld);
ReleaseDC(hDlg,hDC);
lpRect->left = MulDiv(lpRect->left, width, 4);
lpRect->top = MulDiv(lpRect->top, height, 8);
lpRect->right = MulDiv(lpRect->right, width, 4);
lpRect->bottom = MulDiv(lpRect->bottom, height, 8);
}
示例9: GlobalInitialize
/*-----------------------------------------------------------------------------
FUNCTION: GlobalInitialize
PURPOSE: Intializes global variables before any windows are created
COMMENTS: Partner to GlobalCleanup
HISTORY: Date: Author: Comment:
10/27/95 AllenD Wrote it
-----------------------------------------------------------------------------*/
void GlobalInitialize()
{
#if USEWIN32
int cyMenuHeight, cyCaptionHeight, cyFrameHeight;
int k;
//
// font for status reporting control
//
ghFontStatus = CreateStatusEditFont();
ghFontVTTY = CreateVTTYFont();
//
// the following are used for sizing the tty window and dialog windows
//
gwBaseY = HIWORD(GetDialogBaseUnits());
cyMenuHeight = GetSystemMetrics(SM_CYMENU);
cyCaptionHeight = GetSystemMetrics(SM_CYCAPTION);
cyFrameHeight = GetSystemMetrics(SM_CYFRAME);
gcyMinimumWindowHeight = cyMenuHeight + \
4 * cyCaptionHeight + \
2 * cyFrameHeight +
(SETTINGSFACTOR + STATUSFACTOR) * gwBaseY ;
#endif
return ;
}
示例10: GetNewBrowserFont
static HFONT GetNewBrowserFont(HDC hDC, LPSTR pTypeFace,
WORD wStyle, int size,
BYTE bItalic, BYTE bUnderline, BYTE bVector)
{
if (!FontFace[0])
{
WORD ylu = HIWORD(GetDialogBaseUnits());
KppGetKappaIniFile(return_buffer, RET_BUFFER_LEN);
GetPrivateProfileString("Browser", "FontFace", "Default",
FontFace, 32, return_buffer);
FontSize = GetPrivateProfileInt("Browser", "FontSize",
wStartFontSize, return_buffer);
/* Get FontSize in points */
FontSize = (FontSize * ylu * 72) / (8 * wLogPixelY);
bDefaultFont = !strcmpi(FontFace, "Default");
}
if (bDefaultFont)
strcpy(FontFace, pTypeFace);
else if (size == (int) wStartFontSize)
size = FontSize;
if (wStartFontSize != START_FONT_SIZE)
size = MulDiv(size, wStartFontSize, START_FONT_SIZE);
return GetNewFont(FontFace, wStyle, size, bItalic, bUnderline, bVector);
}
示例11: LOWORD
INT_PTR CALLBACK OptionsPageMore::aboutBoxDialogProc(
HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_INITDIALOG)
{
int iconSize = LOWORD(GetDialogBaseUnits()) * 24 / 4;
auto appIcon = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_A),
IMAGE_ICON, iconSize, iconSize, LR_DEFAULTCOLOR);
Static_SetIcon(GetDlgItem(hwnd, IDC_ABOUT_ICON), appIcon);
SetDlgItemText(hwnd, IDC_ABOUT_VERSION, L"Version: " APP_VERSION);
SetDlgItemText(hwnd, IDC_ABOUT_DATE, L"Compiled on: " APP_DATE);
return TRUE;
}
if (uMsg == WM_NOTIFY)
{
auto pHdr = (const PNMLINK) lParam;
if (pHdr->hdr.code == NM_CLICK || pHdr->hdr.code == NM_RETURN)
{
ShellExecute(NULL, L"open", pHdr->item.szUrl, NULL, NULL, SW_SHOW);
return TRUE;
}
else {
return FALSE;
}
}
else if (uMsg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED)
{
DestroyIcon(Static_GetIcon(GetDlgItem(hwnd, IDC_ABOUT_ICON), 0));
EndDialog(hwnd, IDOK);
return TRUE;
}
else {
return FALSE;
}
}
示例12: get_dialog_font_metrics
static void
get_dialog_font_metrics(void)
{
DWORD dlgFontSize;
dlgFontSize = GetDialogBaseUnits(); /* fall back to big old system*/
s_dlgfntwidth = LOWORD(dlgFontSize);
s_dlgfntheight = HIWORD(dlgFontSize);
}
示例13: CC_PaintCross
/***********************************************************************
* CC_PaintCross [internal]
*/
static void CC_PaintCross( HWND hDlg, int x, int y)
{
HDC hDC;
int w = GetDialogBaseUnits() - 1;
int wc = GetDialogBaseUnits() * 3 / 4;
HWND hwnd = GetDlgItem(hDlg, 0x2c6);
LPCCPRIV lpp = GetPropW( hDlg, szColourDialogProp );
RECT rect;
POINT point, p;
HPEN hPen;
if (IsWindowVisible( GetDlgItem(hDlg, 0x2c6) )) /* if full size */
{
GetClientRect(hwnd, &rect);
hDC = GetDC(hwnd);
SelectClipRgn( hDC, CreateRectRgnIndirect(&rect));
point.x = ((long)rect.right * (long)x) / (long)MAXHORI;
point.y = rect.bottom - ((long)rect.bottom * (long)y) / (long)MAXVERT;
if ( lpp->oldcross.left != lpp->oldcross.right )
BitBlt(hDC, lpp->oldcross.left, lpp->oldcross.top,
lpp->oldcross.right - lpp->oldcross.left,
lpp->oldcross.bottom - lpp->oldcross.top,
lpp->hdcMem, lpp->oldcross.left, lpp->oldcross.top, SRCCOPY);
lpp->oldcross.left = point.x - w - 1;
lpp->oldcross.right = point.x + w + 1;
lpp->oldcross.top = point.y - w - 1;
lpp->oldcross.bottom = point.y + w + 1;
hPen = CreatePen(PS_SOLID, 3, 0x000000); /* -black- color */
hPen = SelectObject(hDC, hPen);
MoveToEx(hDC, point.x - w, point.y, &p);
LineTo(hDC, point.x - wc, point.y);
MoveToEx(hDC, point.x + wc, point.y, &p);
LineTo(hDC, point.x + w, point.y);
MoveToEx(hDC, point.x, point.y - w, &p);
LineTo(hDC, point.x, point.y - wc);
MoveToEx(hDC, point.x, point.y + wc, &p);
LineTo(hDC, point.x, point.y + w);
DeleteObject( SelectObject(hDC, hPen));
ReleaseDC(hwnd, hDC);
}
}
示例14: dc
void
CAboutDialog::OnPaint(HDC hDC)
{
//
// HDC hDC is not a DC
// bug in atlcrack.h
//
CPaintDC dc(m_hWnd);
SIZE sizePic = {0, 0};
m_pix.GetSizeInPixels(sizePic);
CRect rcWnd, rcClient;
GetClientRect(rcClient);
GetWindowRect(rcWnd);
ATLTRACE(_T("Picture Size: %d, %d\n"), sizePic.cx, sizePic.cy);
ATLTRACE(_T("Client Size: %d, %d\n"), rcClient.Width(), rcClient.Height());
ATLTRACE(_T("Window Size: %d, %d\n"), rcWnd.Width(), rcWnd.Height());
//
// adjust the picture size to the same width of the dialog
//
SIZE sizeAdj =
{
rcWnd.Width(),
MulDiv(sizePic.cy, rcWnd.Width(), sizePic.cx)
};
LONG lBaseUnits = GetDialogBaseUnits();
INT baseX = LOWORD(lBaseUnits);
INT baseY = HIWORD(lBaseUnits);
INT tplX = MulDiv(sizePic.cx, 4, baseX);
INT tplY = MulDiv(sizePic.cy, 4, baseY);
ATLTRACE(_T("Adjusted Size: %d, %d\n"), sizeAdj.cx, sizeAdj.cy);
//
// avoid distortion from a little difference
//
int diff = sizePic.cx - sizeAdj.cx;
diff = (diff > 0) ? diff : -diff;
if (diff < 30)
{
sizeAdj = sizePic;
}
ATLTRACE(_T("Using Size: %d, %d\n"), sizeAdj.cx, sizeAdj.cy);
CRect rectPic(CPoint(0,0),sizeAdj);
CDCHandle dcHandle;
dcHandle.Attach((HDC)dc);
m_pix.Render(dcHandle, rectPic);
}
示例15: Main_WindowProc
LRESULT CALLBACK Main_WindowProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) //主窗口窗口过程
{
static HDC Main_WindowHdc;
static HINSTANCE hInstance;
static PAINTSTRUCT ps;
static HWND Button_Handle[NUM];
static int cxChar, cyChar;
switch( message )
{
case WM_CREATE:
cxChar = LOWORD( GetDialogBaseUnits() );
cyChar = HIWORD( GetDialogBaseUnits() );
for( int i = 0; i < NUM; i++ )
{
Button_Handle[i] = CreateWindow ( TEXT( "Button" ),
button[i].szText,
WS_CHILD | WS_VISIBLE | button[i].iStyle, //窗口风格
cxChar, //窗口初始水平位置
cyChar * ( 1 + 2 * i ), //窗口初始垂直位置
20 * cxChar, //窗口宽
cyChar * 7 / 4, //窗口高
hwnd, //父窗口句柄
( HMENU ) i, //菜单句柄
hInstance, //实例句柄
NULL );
}
return 0;
case WM_PAINT:
Main_WindowHdc = BeginPaint( hwnd, &ps );
EndPaint( hwnd, &ps );
return 0;
case WM_DESTROY:
PostQuitMessage( 0 );
return 0;
}
return DefWindowProc( hwnd, message, wParam, lParam );
}