Пример #1
0
static void internal_AdjustConfigDialogControls(HWND hwnd) {
	SWP swpTemp, swpTemp2, swpWindow;
	int staticheight, buttonheight;
	int iCX, iCY, iBottomButtonsWidth;
	ULONG CXDLGFRAME = WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME);
	ULONG CYDLGFRAME = WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME);
	BOOL rc;

	// Get window size!
	WinQueryWindowPos(hwnd, &swpWindow);

	// Resize the window
	rc = WinQueryWindowPos(WinWindowFromID(hwnd, PB_CONFCANCEL), &swpTemp);
	#ifdef DEBUG_LOGGING
		if (rc) AddLog("TRUE\n"); else AddLog("FALSE\n");
		AddToLogInt(swpTemp.x);
		AddToLogInt(swpTemp.y);
		AddToLogInt(swpTemp.cx);
		AddToLogInt(swpTemp.cy);
	#endif
	internal_GetStaticTextSize(hwnd, PB_CONFCANCEL, &iCX, &iCY);
	iBottomButtonsWidth = iCX;
	internal_GetStaticTextSize(hwnd, PB_CONFOK, &iCX, &iCY);
	if (iBottomButtonsWidth<iCX) iBottomButtonsWidth = iCX;
	WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 4*(iBottomButtonsWidth + 6*CXDLGFRAME), (3.8*(iCY+CYDLGFRAME*3))+(CYDLGFRAME*4)+WinQuerySysValue(HWND_DESKTOP, SV_CYTITLEBAR), SWP_SIZE); /*(swpTemp.cy)+(CYDLGFRAME*4)+WinQuerySysValue(HWND_DESKTOP, SV_CYTITLEBAR), SWP_SIZE);*/

	// Get window size!
	WinQueryWindowPos(hwnd, &swpWindow);

	// Query static height in pixels.
	internal_GetStaticTextSize(hwnd, ST_TEXT, &iCX, &iCY);
	staticheight = iCY;

	// Set the position of buttons
	WinSetWindowPos(WinWindowFromID(hwnd, PB_CONFOK), HWND_TOP, CXDLGFRAME*2, CYDLGFRAME*2, iBottomButtonsWidth + 6*CXDLGFRAME, iCY + 3*CYDLGFRAME, SWP_MOVE | SWP_SIZE);
	WinSetWindowPos(WinWindowFromID(hwnd, PB_CONFCANCEL), HWND_TOP, swpWindow.cx - CXDLGFRAME*2 - (iBottomButtonsWidth + 6*CXDLGFRAME), CYDLGFRAME*2, iBottomButtonsWidth + 6*CXDLGFRAME, iCY + 3*CYDLGFRAME, SWP_MOVE | SWP_SIZE);

	// Query button height in pixels.
	WinQueryWindowPos(WinWindowFromID(hwnd, PB_CONFOK), &swpTemp);
	buttonheight = swpTemp.cy;

	// Set the entry field
	WinSetWindowPos(WinWindowFromID(hwnd, EF_TEXT), HWND_TOP, CXDLGFRAME*2 + 2, CYDLGFRAME*2+buttonheight+ CYDLGFRAME*4+5, swpWindow.cx- (4*CXDLGFRAME*2), staticheight, SWP_MOVE | SWP_SIZE);

	// Set the text for the entry field
	internal_GetStaticTextSize(hwnd, ST_TEXT, &iCX, &iCY);
	WinQueryWindowPos(WinWindowFromID(hwnd, EF_TEXT), &swpTemp2);
	WinSetWindowPos(WinWindowFromID(hwnd, ST_TEXT), HWND_TOP, swpTemp2.x, swpTemp2.y+CYDLGFRAME*2 + swpTemp2.cy, iCX, iCY, SWP_MOVE | SWP_SIZE);
}
Пример #2
0
void LogEvent::AddToLog(LPCWSTR pwch, BOOL endofline)
{
	EnterCriticalSection(&m_Sync);
	AddToLogInt(pwch, endofline, FALSE);
	LeaveCriticalSection(&m_Sync);
}
Пример #3
0
void LogEvent::AddToLogIntP(LPCWSTR pwch, BOOL endofline)
{
	AddToLogInt(pwch, endofline, TRUE);
}