|
Check here[^].
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
|
search for CCommandLineInfoEx in the MSDN
there is some code from
Microsoft Systems Journal -- October 1999
Paul DiLascia.
the class is realy nice to use.
|
|
|
|
|
I am looking for simple and powerful way of displaying string messages by using CString class, , on a simple console or a text display window for program progress and debug purposes. Is there any extentions of CString class to do that and any example codes to learn and apply it in my own code ?
|
|
|
|
|
|
Thanks alot for your immediate answer
CD
|
|
|
|
|
I tried TRACE macro but this is not the one I'm looking for I would like to manipulate strings using io operators and showing the string to trace the progress of my program. This function also displays the output in the debugger output window but I would like to prefer in a separate or a MFC view window. İs it possible to find such a display class ?
CD
|
|
|
|
|
|
Thanks again, I guess this will work for me, and I would like to know How I can implement a console output which works like a progress, that is, I want to show many lines of progress string but I want to overwrite the new line on the previous line output thereby avoiding the many console output lines, as in the case of running it inside a loop code.
CD
|
|
|
|
|
well, it sounds like you're 'at odds with' / only have a vague idea of what you really want or need - how about you do some some 'functional analysis' .. if what you want is really that simple, what about a single line static text control that you update when required ? - a single line console doesnt really make much sense ...
It is possible to do more with consoles, and there are articles on the web and here on CP which show you these techniques
- the last thing I'll say, is what I commonly end up using if I need info relayed back to a user on various things and/or debugging info for my own purposes, is a derivative of this ->
http://www.codeproject.com/listctrl/logcontrol.asp[^]
'G'
|
|
|
|
|
Thanks for your valueable ideas, and sorry for my simple and boring questions. But you saved my hours of time to be wasted by searching web.
CD
|
|
|
|
|
Is C++ harder than PHP... I know php but I want to learn it...
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
It all depends on what your "definition" of hard is. Some folks find it harder than other programming languages and vice versa.
|
|
|
|
|
Hello!
C++ is easy :P
php is very similar to plain C. C++ is far more complicated in its nature, but you do not have to learn whole language to be able to write something. But for sure, php is simpler subject than c++.
|
|
|
|
|
Hello,
I am looking for a way to detect the system's color palette( On XP color quality). This is setup on the Display Properties at the settings tab. I need to know if the computer is running using "16 Color", "255 Color", "16 Bit" and so on. Any ideas?
|
|
|
|
|
|
Thanks, just what I was looking for.
|
|
|
|
|
Does Windows remember the last accessed folder per application anywhere? I'm not talking about information intentionally saved by an app in the registry or an INI file, but rather Windows doing this on its own. For example:- Run App1, do a File|Open to
C:\foo . Exit App1.
- Run App2, do a File|Open to
C:\bar . Exit App2.
- Run App1 again and a File|Open - the Open File dialog defaults to
C:\foo . /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It seems like the common file dialog 'remembers' the last folder visited on a per-application basis. I believe the information is stored in the registry, but I can't remember the key where it does so.
Software Zen: delete this;
|
|
|
|
|
How would one go about sending keystrokes to a specific (not necessarily active) window? I have been working on this for awile, so any help would be appreciated.
-Dev578
|
|
|
|
|
If you have access to the window (either a CWnd pointer or an HWND ), you could use SendMessage() to send it messages simulating keystrokes (eg: WM_KWYDOWN , WM_KEYUP , WM_LBUTTONDOWN , WM_LBUTTONUP , WM_LBUTTONDBLCLK ).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Here's how I did it.
I had a window "PCTV Vision" that I had to send ALT-R.
I used a tool simillar to Spy++, it comes with Borland Delphi 3 and it is called Winsight32.
With WInsight I selected that window and I started logging all the messages that went to that window. Then I made it active and pressed ALT-R from the keyboard.
I returned to WInsight32 and looked in the message log. I found there a WM_COMMAND which he recognized as "Accelerator".
I shamelessly copied the WParam and Lparam and pasted it in my program which sounds like
PostMessage(hwnd,WM_COMMAND,stolen_WPARAM,stolen_LPARAM);
The good part is that it works!!!
I never tried Spy++ because I haven't installed Visual Studio Completely and it isn't installed.
|
|
|
|
|
Hello,
I am trying to draw tab text a different color if the tab receives a TCM_HIGHLIGHTITEM message.. I have created my CTabCtrlEx class and did a override for DrawItem.. My tab control is coloring selected item text blue and none selected items default (black) now I want to catch the TCM_HIGHLIGHTITEM message and color that text red... Here's what I have so far (the problem is that the red doesn't work)
void CTabCtrlEx::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
TC_ITEM tci;
CDC* pDC = CDC::FromHandle(lpDIS->hDC);
HIMAGELIST hilTabs = (HIMAGELIST)TabCtrl_GetImageList(GetSafeHwnd());
BOOL bSelected = (lpDIS->itemID == (UINT)GetCurSel());
CRect rItem(lpDIS->rcItem);
if (bSelected)
rItem.bottom -= 1;
else
rItem.bottom += 2;
pDC->FillSolidRect(rItem, ::GetSysColor(COLOR_3DFACE));
rItem.left += PADDING;
rItem.top += PADDING + (bSelected ? 1 : 0);
pDC->SetBkMode(TRANSPARENT);
CString sTemp;
tci.mask = TCIF_TEXT | TCIF_IMAGE;
tci.pszText = sTemp.GetBuffer(100);
tci.cchTextMax = 99;
GetItem(lpDIS->itemID, &tci);
sTemp.ReleaseBuffer();
if (hilTabs)
{
ImageList_Draw(hilTabs, tci.iImage, *pDC, rItem.left, rItem.top, ILD_TRANSPARENT);
rItem.left += 16 + PADDING;
}
rItem.right -= PADDING;
FormatText(sTemp, pDC, rItem.Width());
if((lpDIS->itemState & ODS_SELECTED) && (lpDIS->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)))
pDC->SetTextColor(RGB(0,0,255));
else if(lpDIS->itemState & TCIS_HIGHLIGHTED)
pDC->SetTextColor(RGB(255,0,0));
pDC->DrawText(sTemp, rItem, DT_NOPREFIX | DT_CENTER);
}
Any ideas?
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Just incase anyone has the same problem here's the fix / working code..
void CTabCtrlEx::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
CDC* pDC = CDC::FromHandle(lpDIS->hDC);
HIMAGELIST hilTabs = (HIMAGELIST)TabCtrl_GetImageList(GetSafeHwnd());
BOOL bSelected = (lpDIS->itemID == (UINT)GetCurSel());
CRect rItem(lpDIS->rcItem);
if (bSelected)
rItem.bottom -= 1;
else
rItem.bottom += 2;
pDC->FillSolidRect(rItem, ::GetSysColor(COLOR_3DFACE));
rItem.left += PADDING;
rItem.top += PADDING + (bSelected ? 1 : 0);
pDC->SetBkMode(TRANSPARENT);
CString sTemp;
TC_ITEM tci;
tci.mask = (TCIF_TEXT | TCIF_IMAGE | TCIF_STATE | TCIF_PARAM);
tci.dwStateMask = TCIS_HIGHLIGHTED;
tci.pszText = sTemp.GetBuffer(100);
tci.cchTextMax = 99;
tci.dwState = TCIS_HIGHLIGHTED;
GetItem(lpDIS->itemID, &tci);
sTemp.ReleaseBuffer();
if (hilTabs)
{
ImageList_Draw(hilTabs, tci.iImage, *pDC, rItem.left, rItem.top, ILD_TRANSPARENT);
rItem.left += 16 + PADDING;
}
rItem.right -= PADDING;
FormatText(sTemp, pDC, rItem.Width());
if((lpDIS->itemState & ODS_SELECTED) && (lpDIS->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)))
pDC->SetTextColor(RGB(0,0,255));
else if((tci.dwState & TCIS_HIGHLIGHTED) && (lpDIS->itemAction & ODA_DRAWENTIRE))
{
pDC->SetTextColor(RGB(255,0,0));
}
pDC->DrawText(sTemp, rItem, DT_NOPREFIX | DT_CENTER);
}
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Dear All,
Anybody have a example program of captioned title ? how can I do it ? I would make the text and graphic rotate about Y axis ?
Regards,.
Anson
|
|
|
|