Sandwiches are detrimental to health, you know... Vegetables, fruits, rice, meat, fish... But... a strong cup of coffee - all the time, indeed!!! :cool::cool::cool: One always gets the deserved.
http://www.silveragesoftware.com/hffr.html
Update your source code with my tool HandyFile Find And Replace!
YoSilver
Posts
-
The great ham sandwich debate -
Embarassing IStream questionIf using MFC - you can try
CArchiveStream
declared inafxpriv2.h
(create CFile, create CArchive on it and then CArchiveStream). But the implementation is not full. One of the major methods,Stat
, is not implemented. Otherwise, AFAIK, you have to implement it manually... BTW, the question is very interesting. If anyone knows whether a system contains a ready-to-use function that returns IStream* on a file path, please tell! One always gets the deserved. -
how to get IMAGE_FUNCTION_ENTRYPlease read this fantastic article and code, may be helpful: http://www.codeproject.com/system/hooksys.asp[^] One always gets the deserved.
http://www.silveragesoftware.com/hffr.html
Update your source code with my tool HandyFile Find And Replace! -
process questionDefinitely, no. Definitely, yes - if you can access information on the Kernel internal structures. But even if so, your app may not work on different Windows versions. One always gets the deserved.
http://www.silveragesoftware.com/hffr.html
Update your source code with my tool HandyFile Find And Replace! -
About CString : Plz Send Urgently#include "shlwapi.h"
// add shlwapi.lib to the linker in project options// source path name
CString strPathName = _T("C:\\MyDocuments\\myDialog\\release\\myapp.exe");// call the shlwapi.dll function
LPTSTR pszFileName = PathFindFileName(strPathName); // auto cast
CString strFileName = pszFileName;Never forget to search MSDN. That's all, folks! ;P One always gets the deserved.
-
How to draw static controls and check box buttons transparently ?Could you make a small screenshot of the text label portion of a group box and give a link? this can make the native Windows drawing procedure more clear. Oh... I think all you have to do is give your group boxes sensible ID's (other than
-1
/IDC_STATIC
/), check them in theWM_CTLCOLOR
handler, callpdc->SetBkColor()
for these ID's and return a brush of a proper color. Do not set the background mode toTRANSPARENT
. One always gets the deserved.
http://www.silveragesoftware.com/hffr.html
Update your source code with my tool HandyFile Find And Replace! -
How to draw static controls and check box buttons transparently ?Looks strange because when an XP theme is active, all text labels are drawn transparently; in fact, no WM_CTLCOLOR handling is necessary. Does your app have a manifest resource in it that enables theming (the XP look) when a theme is active? The gradient that you see in "My Computer-> properties" is NOT a feature of a themed Tab control, it's how the theme handles property sheets - it applies a gradient background to each of the dialog in the sheet. If you create your own tabbed dialog, you can do it by handling WM_ERASEBKGND in each of your dialogs. Consider the following code excerpt; perhaps you will get some ideas on your group boxes (BTW, they belong to window class BUTTON, not STATIC):
BOOL myGroupBox::OnEraseBkgnd(CDC* pDC)
{
CRect rcCtrl;
GetClientRect(rcCtrl);if (GetUXThemeState().IsThemeActive()) pDC->FillSolidRect(rcCtrl, ColorAdjustLuma(afxData.clrBtnFace, 750, TRUE)); else pDC->FillSolidRect(rcCtrl, afxData.clrBtnFace); PrintClient(pDC, PRF\_CLIENT); return 1;
}
void myGroupBox::OnPaint()
{
// validates the invalid area to prevent the infinite paint loop
PAINTSTRUCT ps = {0};
::BeginPaint(m_hWnd, &ps);
::EndPaint(m_hWnd, &ps);
}One always gets the deserved.
http://www.silveragesoftware.com/hffr.html
Update your source code with my tool HandyFile Find And Replace! -
Why I get a black screen while capturing screen?Do not get the desktop window DC. It causes serious problems. Instead of this
HWND hDesktopWnd=::GetDesktopWindow();
HDC hDesktopDC=::GetDC(hDesktopWnd);write this
HDC hDesktopDC = ::CreateDC("DISPLAY",0,0,0);
-
How to open file dbf ?Load Image:
HBITMAP hBitmap =
(HBITMAP )LoadImage(AfxGetResourceHandle(),
LPCTSTR(IDB_BITMAP),
IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION);LR_CREATEDIBSECTION ensures colours in your bitmap not mapped to the system palette. Did not understand other questions.
-
please! help me about antialiasing!!!The link: http://alglib.manual.ru/translate.php?location=/graphics/wuline&target=cpp[^] It is a Russian resource, I guess you don't speak Russian. So, here you are:
#include "ap.h"
/*-----------------------------------------------
User-defined routinevoid setpixel(int x, int y, double c);
-----------------------------------------------*/void drawwuline(double x1, double y1, double x2, double y2);
double myfrac(double x);/*************************************************************************
Wu Xiaolin algorithm with fractional coordinates (a-la DX90)
*************************************************************************/
void drawwuline(double x1, double y1, double x2, double y2)
{
double grad;
double xd;
double yd;
double length;
double xm;
double ym;
double xgap;
double ygap;
double xend;
double yend;
double xf;
double yf;
double brightness1;
double brightness2;
int x;
int y;
int ix1;
int ix2;
int iy1;
int iy2;
bool wasexchange;
int tmpint;
double tmpreal;xd = x2-x1; yd = y2-y1; if( xd==0&&yd==0 ) { return; } if( fabs(xd)>fabs(yd) ) { wasexchange = false; } else { wasexchange = true; tmpreal = x1; x1 = y1; y1 = tmpreal; tmpreal = x2; x2 = y2; y2 = tmpreal; tmpreal = xd; xd = yd; yd = tmpreal; } if( x1>x2 ) { tmpreal = x1; x1 = x2; x2 = tmpreal; tmpreal = y1; y1 = y2; y2 = tmpreal; xd = x2-x1; yd = y2-y1; } grad = yd/xd; xend = floor(x1+0.5); yend = y1+grad\*(xend-x1); xgap = 1-myfrac(x1+0.5); ix1 = floor(x1+0.5); iy1 = floor(yend); brightness1 = (1-myfrac(yend))\*xgap; brightness2 = myfrac(yend)\*xgap; if( wasexchange ) { setpixel(iy1, ix1, brightness1); setpixel(iy1+1, ix1, brightness2); } else { setpixel(ix1, iy1, brightness1); setpixel(ix1, iy1+1, brightness2); } yf = yend+grad; xend = floor(x2+0.5); yend = y2+grad\*(xend-x2); xgap = 1-myfrac(x2-0.5); ix2 = floor(x2+0.5)
-
Winhelp vs. HTML help contextI still use VS 6.0, but I guess my considerations could help. All you need is to redefine the
CWinApp
virtual functionWinHelp
. Then, define aCString
memberm_strHelpFilePath
and put a full path to your .chm in it inCApp::InitInstance
. (You can do something different, but the idea is to form and store the .chm path). Your WinHelp function might look like this:void CApp::WinHelp(DWORD dwData, UINT nCmd)
{
HWND hwndDesktop = ::GetDesktopWindow();if (!HtmlHelp(hwndDesktop, m\_strHelpFilePath, HH\_HELP\_CONTEXT, nCmd == HELP\_CONTEXT ? dwData : 0))) { HtmlHelp(hwndDesktop, m\_strHelpFilePath, HH\_HELP\_FINDER, 0); }
}
If you want your main frame to own the help window frame, pass
m_pMainWnd->GetSafeHwnd()
instead ofhwndDesktop
. Hope this helps. -
DrawState (CDC) problemWell... all I think is that you should redraw your bitmap properly, that is, first clear the background and then blitting an image. Use clipping information in PAINTSTRUCT for proper paiting. And try to use double buffering.
-
Compression : Some new Idea.Size of the data for string difference may be less than 1 byte.
-
DrawState (CDC) problemDrawState can draw transparent icons only. To draw a transparent bitmap, use the ::TransparentBlt function.
-
change font colour, bold the font and background in list boxUse owner-draw style and process the corresponding messages.
-
How to get notification of drag-drop of headers in CListCtrlDerive a class from CListCtrl and handle the notifications in the derived class.
-
clippingI suspect that the "repeatable situation" is when scrolling occurs.
-
Code only works with breakpointIt is not a good idea to handle scrolling by sending WM_xSCROLL messages, as there many problem will arise, as you call SetScrollPos32 and then send WM_VSCROLL + SB_THUMBPOSITION which is processed internally so that it interferes with previous call of SetScrollPos32. Also read the excellent book by Richter on Win32 programming, namely - section on message queuing. You'd better deal with functions that perform necessary operations when WM_xSCROLL messages are received. Just an example:
void CMyGridCtrlDerivative::SetNewPosition(int nPos) { ...code SetScrollPos32(SB_VERT, nPos * GetRowHeight(nPos)); // SendMessage(WM_VSCROLL, SB_THUMBPOSITION, 0); DoProcessWmVscroll(SB_THUMBPOSITION); }
-
Anti-Copy Bill Slams CodersJust ignore the bill. The right given by the God himself cannot be lessen. The God's will is above the law. Russian MFC junk