|
Hi.
I'm trying to use direcdraw in order to make some image processing for a project of my own. In the samples that came with the SDK there is one "stillcap" that I modified, however, it is one shot at time, and what I need is to intercept the stream, to process it, and finally to display it, almost in real time. I don't know so much about directx, so if someone can help me I would appreciate it a lot.
|
|
|
|
|
I'm using the EditBox and ComboBox (with EditBox) controls.
How do you stop it from displaying partial characters (ie characters which can't be completely displayed in the editbox) ? ie. the character at the right of the editbox.
I only want to display whole characters.
Are there any flags which will give me this behaviour ?
|
|
|
|
|
1. if taking a short, fixed-length input, increase the edit box width no?
2. use multi-line edit box
3. For other cases, it can be done, but there is no easy way out. involves getting font width and resizing the edit box accordingly.
more information needed for a better answer: why would you need something like this?
Bikram Singh
|
|
|
|
|
bikram singh wrote:
more information needed for a better answer: why would you need something like this?
If you enter enough text to overfill the editbox (ie. the editbox needs to scroll), when you highlight the text from the end to the beginning, the highlight does not highlight the partial character at the right of the editbox, which apart from looking odd, it doesn't indicate to the user that more text is highlighted, other than what the user can see.
Not a big problem, but more of a user interface issue.
Some applications don't show partial characters, so I'm sure it must be possible, but I just don't know how.
bikram singh wrote:
3. For other cases, it can be done, but there is no easy way out. involves getting font width and resizing the edit box accordingly.
How would this work for non-fixed width characters, like the default MS Sans Serif font ?
|
|
|
|
|
I am facing problem is displaying the set of strings in rich edit control in Jananese/Chinese OS.
I am using rich edit control in my application to display some dynamic text based on some result. I am using WTL for my application development. The code what I have written works fine on eng and other lang OS except lang that supports DBCS. The code would go something like this:
TCHAR szTestName[MAX_PATH];
memset(szTestName, 0, sizeof(szTestName));
TCHAR szTestName[MAX_PATH];
memset(szTestName, 0, sizeof(szTestName));
_tcscpy(szTestName, _T("Test Name"));
_tcscpy(szTestResult, _T("Test Result"));
m_crichEditctrl.AppendText(szTestName);
m_crichEditctrl.AppendText(szLineFeedChar); // "\n"
m_crichEditctrl.AppendText(szTestResult);
Here I am trying to add "Test Name" in the first line and "Test Result" in the second line. The issue what I am facing is the line feed char is getting inserted after char 'm' (in Test Name), I tried even inserted different char other than line feed char, always I get the same problem. When I debugged I found out that SetSel (SetSel/ReplaceSel is called internally by AppendText api of rich edit) always returns one index less and this is taken by ReplaceSel to add the text.
Please note that this problem happens only when I use the translated japanese/chinese chars for "Test Name" and "Test Result". If I just use the english strings as shown in the code it works fine.
Am I missing setting something for the rich edit for other lang OS (especially lang that supports DBCS) except english. Please help me out on this.
Thanks in advance.
Rajeev.
|
|
|
|
|
USe variable of CString type with CEDITCONTROL
and do this
CString show= ur_str_variable + " \n ";
( Value type variable .... m_strCtrlEdit)
m_strCtrlEdit = m_strCtrlEdit + show;
( Control Type Variable ..... m_EditCtrl)
m_EditCtrl . LineScroll(1);
UpdateData(FALSE);
i hope this will work ....
Bcoz when u use UpdateData (FALSE)
it will show the value in the control from its value type variable.
GOOD LUCK
|
|
|
|
|
Is there a way to differentiate between HD's and other various USB devices such as a USB Flash Card?
I'm currently using GetDriveType() == DRIVE_FIXED but it can't tell the difference between HDs and memory sticks etc.
Todd Smith
|
|
|
|
|
|
Hello,
does anyone of you know of a good profiler that runs under Windows 98? Most I found work under 2000/XP only (codeglow, AMD code analyst etc.),or are crap (like LTProf... can't really get it to work on larger projects) . I only own the standard version of MSVC so I don't have the MS profiler. Thanks
|
|
|
|
|
Is it possible to have an Edit Box wuth spin controls that allows the user to enter data such as 123.45 and increment/decrement the value.
All I have seen deal only with integers.
grahamfff
|
|
|
|
|
|
Hi!
I've just written my small framework (CApplication ) to create a simple Window and waiting for messages.
It's doing nothing more but a RegisterClassEx , CreateWindow and ShowWindow .
The message pump is as follows:
while(PeekMessage(&msg, NULL, 0, 0,PM_REMOVE) || !g_App.g_AppDone)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
The strange this is, once started the app takes up 50% of CPU time and 1.6megs of RAM - for a simple window being idle
What the hell is going wrong?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greeeg wrote:
The strange this is, once started the app takes up 50% of CPU time
I assume you are acquiring this number from Task Manager, yes? If so, does it remain at 50%, or thereabout, for the life of the application? Read MSDN article Q74042 on why the while loop does not let the system go idle.
Greeeg wrote:
...and 1.6megs of RAM - for a simple window being idle
This number is often misinterpreted. Read this aricle for a good explanation.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
seems to me that there is one "accepted" way of presenting settings/preferences to the user, in a dialog box with some tabs; which is the Microsoft way.
either that or the other more "linux" way which is to replace the tabs ( situated at the top ) with a list of items ( with/out graphics ) on the left of the dialog ( like in firefox )
any other ways ? prefered ways ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
MY personal preference is the Mozilla way - you have a tree-like structure of main pages on the left, and clicking on a node shows options for that item on the right. This is good if you have a ton of stuff. If you just have a few preferences, a regular old PropertySheet is probably best.
The bigger question is where to put the "Preferences..." menu option so your users can even find it. There doesn't seem to be a good standard for that.
"Fish and guests stink in three days." - Benjamin Franlkin
|
|
|
|
|
Navin wrote:
The bigger question is where to put the "Preferences..." menu option so your users can even find it. There doesn't seem to be a good standard for that.
I tend to use Tools | Options... which seems to be the replacement for the old File | Preferences... menu item.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Tabs are better so long as you can get by with only one row of tabs. (Microsoft fails this all the time)
The linux way comes from the idea that you should give users a million options and let the user choose what to do. There is no good UI for doing this (at least not that we know of), the linux thing is a compromise, hard to figure out, but once you know how it works it is easy to find the option you are looking for.
If you can't get by with one row of tabs see if there is a small set of things the user is likely to want to change, and put that on a different screen and make it easier to access. The rest should be called advanced settings and placed in the linux style control.
|
|
|
|
|
in my project, when the dialog box (window) is initialized( i,e Onintdialog())the "ok" button is disabled, and i want it to enable automatically after 8 seconds. plz can any one guide me to enable the button after 8 seconds...
|
|
|
|
|
Create a timer in the OnInitDialog() handler. In the OnTimer() handler, enable the OK button and kill the timer.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
OnInitDialog() :
((CButton*)GetDlgItem(IDOK))->EnableWindow(FALSE);
SetTimer(100 <font style="color:green;"></font>, 8000 <font style="color:green;"></font>, NULL <font style="color:green;"></font>);
<font style="color:green;">
OnTimer(UINT nIDEvent) :
<font style="color:blue;">if</font> (nIDEvent == 100) {
((CButton*)GetDlgItem(IDOK))->EnableWindow(TRUE);
KillTimer(100);
}
TOXCCT >>> GEII power
|
|
|
|
|
Hi,
how can i show an existing image in a c++ window. I mean i want my code to open a window and display an existing image in that window.
In a future work i will try to show an image sequence in that window.
For example, i have image001.bmp, image002.bmp,.. image016.bmp.
I want to open a window and display the images as a slide show in that window. Maybe going to the next image can be assigned to pressing a key on the keyboard. Or maybe a time feature could be used. I mean, in the window, existing images will be displayed each 0.5 seconds with the same order in the sequence.
Could someone help me with an explanatory piece of code?
Thank you ...
|
|
|
|
|
nyquisttt wrote:
how can i show an existing image in a c++ window. I mean i want my code to open a window and display an existing image in that window.
Use a static control and draw the image on it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi all,
I have an app that uses FindWindow to find the window handle to another app's window, and it looks like it is hanging. It doesn't do it every time, but from my logging statements, I can tell that FindWindow is the last thing called when it's hung up.
I've seen the various articles/comments about the dangers of using FindWindow, ie: uses SendMessage internally & can hang if another app's thread is waiting/hung, etc.
I have written an alternative function for some other purpose that works similarly to FindWindow but checking all the top level windows, starting w/ the desktop window, but that too uses GetWindowText (ie: SendMessage()) & I think will have the same liability.
My question is: What's a good alternative to using FindWindow ?
I would alter my similar function to use SendMessageTimeout, but I am using Windows CE, and that function is not supported.
Please help, won't you?
What are the alternatives to using FindWindow?
here are some details about how I'm using FindWindow
LPCTSTR szPossibleNames[] =
{ _T("name1"), _T("name2"),...,_T("nameN") };
for(int i=0; i < X; ++i)
{
if( FindWindow(NULL, szPossibleNames[i]) )
break;
}
Is using FindWindow in a loop like this just asking for trouble? It's like I'm making it do risky things over & over again....
Just for fun, and in the case it can help somebody point out an alternative to me, here's the code for my 'alternative func':
HWND FindChildAmongManyChildDialogs(HWND hWndMain,
LPCTSTR szClassName,
LPCTSTR szWindowTitle)
{
CString str, strTitle;
TCHAR szClass[ 200 + 1 ] = {0};
CWnd * pChild = CWnd::FromHandle(::GetWindow(hWndMain, GW_CHILD) );
CWnd * pLast = NULL;
if( pChild )
pLast = pChild->GetWindow(GW_HWNDLAST);
if( !pChild )
return NULL;
do{
GetClassName(pChild->GetSafeHwnd(), szClass, 200);
pChild->GetWindowText(strTitle);
if(_tcsicmp(szClass, _T("Dialog")) == 0 )
{
HWND hChild = FindChildWindow(pChild, szClassName, szWindowTitle);
if( hChild )
return hChild;
}
pChild = pChild->GetWindow(GW_HWNDNEXT);
}while( pChild && (pChild != pLast) );
return NULL;
}
HWND FindChildWindow(CWnd * pParent, LPCTSTR szClassName, LPCTSTR szWindowTitle)
{
ASSERT( szClassName || szWindowTitle );
ASSERT( pParent );
CString strTitle;
TCHAR szClass[ 200 + 1] = {NULL};
CWnd * pChild = pParent->GetWindow(GW_CHILD);
ASSERT( pChild );
CWnd * pLast = NULL;
if( pChild )
pLast = pChild->GetWindow(GW_HWNDLAST);
if( !pChild )
return NULL;
do
{
GetClassName(pChild->GetSafeHwnd(), szClass, 200);
pChild->GetWindowText(strTitle);
if( (!szClassName || _tcsicmp(szClass, szClassName) == 0)
&& (!szWindowTitle || strTitle.CompareNoCase(szWindowTitle) == 0) )
{
return pChild->GetSafeHwnd();
}
pChild = pChild->GetWindow(GW_HWNDNEXT);
}while( pChild && (pChild != pLast) );
return NULL;
}
Last question:
Is using FindWindow(_T("dialog"), <window title="">)
better than using FindWindow(_T("dialog"), <window title="">) ?
Does specifying the class name prevent it from using the sendmessage call internally for those cases where the window is obviously not a dialog?
Thanks! Any help would be swell.
Wes
|
|
|
|
|
Wes Jones wrote:
have an app that uses FindWindow to find the window handle to another app's window, and it looks like it is hanging.
You are correct about FindWindow() 's use of SendMessage() and the deadlock that can occur.
Wes Jones wrote:
My question is: What's a good alternative to using FindWindow ?
That all depends on what you are wanting to do.
Wes Jones wrote:
Last question:
Is using FindWindow(_T("dialog"), )
better than using FindWindow("dialog", ) ?
"Better" depends on if you are using Unicode or not. The _T() macro will work in either case as the preprocessor will resolve it accordingly.
Wes Jones wrote:
Does specifying the class name prevent it from using the sendmessage call internally for those cases where the window is obviously not a dialog?
What if two windows have the same class? FindWindow() is still no help.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|