|
Thank you for your idea. It works. This is very similar to my first approach which used a CButton. It is really not hard.
But I have a slight problem - I get ugly flickers when I scroll the View. This is because of my desire the keep the control in the same position during scroll. So after every scroll, I have to MoveWindow. (That's why I tried before on WS_POPUP styles/control bars - I wanted the scrolls not affect the position of the control.)
Any ideas?
Thanx in advance.
Ferdz
|
|
|
|
|
I don't really use the Doc/View system, but if I understand correctly, you are making the control a child of the view rather than a child of the "frame". If the control is a child of the frame, it will not be repositioned when the view is scrolled (it is a sibling rather than a child of the view).
Ray
|
|
|
|
|
I would love to see some code that demostrates the proper way to throw and catch exceptions without using MFC.
I am supposed to derive my own class from std::exception, use with win32 command RaiseException() or do I just create my own exception class.
Which is the preferred method?
|
|
|
|
|
I'm not sure if this is a subscription area of the Microsoft site or not (I access it through work where we have access to both) but there's a great series of articles that discusses C++ exceptions. Everything you want to know about exceptions and more - it's a 17 part series.
http://msdn.microsoft.com/library/default.asp?URL=/library/welcome/dsmsdn/deep051099.htm
|
|
|
|
|
Hi codeproject visitors,
1)I would like to implement multiple toolbars with tabs.
2)I think that I will use the CFolderTabCtrl (MSJ Q&A C++ April 1999) control as a starting point.
3) But I would appreciate any advice on How To implement such feature in MFC.
Thank-you for your attention
|
|
|
|
|
Is there an example of a list control where the text in any column wraps (changes the row height and the text appears underneath) if it is longer than the column width?
Michael Dunn wrote an article where he said he acheived this by handling the NM_CUSTOMDRAW message, but he didn't show any code on how to do it.
Does anybody know how to do this?
Larry
|
|
|
|
|
I am looking for some guidance in writing an openGl application to animate a turning book page. Does anyone have any ideas.
|
|
|
|
|
Hi !!
I'd like to find a way to intercept all displayed texts (on controls, menu, dialog box) for an application.
The goal is to intercept such messages and translate text before they are displayed on the application.
I think i should use a hook and functions like EnumWindows in order to perform translation.
Such a tool still exists but i think it's very good approach in order to enable Multilanguage application.
We can imagine that for one application we exports all texts then translate them into a database or ascii file.
Then the Dynamic Translator Application intercepts messages for a specified application and translate them before they are displayed.
Who has already tries to do such a think ?
The only one tool that perfectly fills the goal is WizTom (85 000 $ !!!!!!).
Who can help or give some answers ?
Thanks
|
|
|
|
|
Wow, $85,000 I'll have to check this out, what's the URL?
I suppose your talking about not requiring code changes to an existing application, and also that you aren't simply talking about modifying the table of resource strings.
Fundamentally I guess, Windows must use one of DrawText, DrawTextEx, or TextOut to accomplish it's own text painting requirements, so intercepting these calls, determining which windows are being written to, and dynamically replacing text should be possible.
I've never done this, but I imagine in what you are proposing that the size of the text and the translated text will be different, so there will be clipping and layout problems.
Also, you'd need to differentiate between the text painting calls that were being made for the labels, titles, etc., from those that were actually the "interactive" parts of the application. For example, in a data input form, I'd want to replace the text labels, but not the edit box contents...
scratches head and contemplates an hour or two in the on-line docs...
Good luck, and let us know how you progress.
|
|
|
|
|
There are a few password sniffing programs I've seen that do this (I hope this is not what you are trying to do...
You could install a CBT (Computer based training) hook which will give you notifications of most things that occur on the desktop. When a window opens you could, as you say, enumerate the windows and call GetWindowText on each (this will give you the text). Shouldn't be too hard...
If you work it out then it would make a great article...
|
|
|
|
|
Working on developing international applications myself, I'd say (assuming you have the source-code) that you should re-write some small parts of your code to ensure all strings are within a resource file or a language DLL and you replace all of your string initialisations with a call to retrieve a given enumerated string from there. Hot switching languages then becomes a case of switching between DLL's and is a damn sight easier (assuming you can re-initalise all of your user-interface components).
I have a derived CString class that stops me from being lazy, since it must retrieve information from such a source.
If you don't have the source code then your results, with the proposed solution, will be variable at best! Many strings are concatinated and decorated with information on the fly... automatic translation of these, especially where word order or tenses can change as the result of some other setting would make this very hard!
Ray
|
|
|
|
|
Has anyone seen a FIFO CEdit control to get around the 64K barrier. If not does anyone have a suggestion on how to start one?
|
|
|
|
|
I am looking for help with using Windows API calls to print, specifically, StartDocPrinter,
WritePrinter, etc. When writing to the Adobe Acrobat PDF Writer the Save As dialog does
not appear as it does when the StartDoc call is used. Any pointers to good web sites, code
samples, etc. would be greatly appreciated. Printing in Windows seems a bit of a black art.
Thanks.
|
|
|
|
|
I need to display results of a long process in a tabular form for easier understanding.
I am ready to code something from scratch. However why re-invent the wheel. Does any body know of any component which is capable of begin supplies with values and chart the values in a bar chart form,
eg, boys 20% and girls 80% would be diswplayed in two separate bars.
Also, I started cinsidering using the activeX components. Maybe there is one which uses the microsoft charting component.
I thanks you for your help
andre
|
|
|
|
|
There are a couple of chart controls at codeguru.com that might help. The newest one does bar charts. Some of them are real time trend charts as well as pie charts
|
|
|
|
|
I need an example of code on how 2 PC's are communicationing with theirs serial ports.
|
|
|
|
|
|
Somehting like this....
In your header file
static LRESULT CALLBACK KeyboardHook (int nCode, WORD wParam, DWORD lParam );
static LRESULT CALLBACK MouseHook(int nCode, WORD wParam, DWORD lParam);
In your source file
LRESULT CALLBACK CClientDlg::KeyboardHook (int nCode, WORD wParam, DWORD lParam )
{
if ( nCode >= 0 )
{
// WHAT YOU WANT IT TO DO
}
return (int)CallNextHookEx(hHookKB, nCode, wParam, lParam);
}
LRESULT CALLBACK CClientDlg::MouseHook (int nCode, WORD wParam, DWORD lParam )
{
mousecnt++;
if ( nCode >= 0 )
{
// WHAT DO YOU WANT IT TO DO
}
return (int)CallNextHookEx(hHookM, nCode, wParam, lParam);
}
In your initdialog or constructor
hHookKB= (HHOOK)SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)KeyboardHook, 0,GetCurrentThreadId());
hHookM= (HHOOK)SetWindowsHookEx(WH_MOUSE, (HOOKPROC)MouseHook, 0,GetCurrentThreadId());
|
|
|
|
|
This works for dll's? Which I presume I will need to put this in to get the system wide hook?
|
|
|
|
|
Sorry... should have specified.. to make it system wide...
make the 4th parameter of SetWindowsHookEx 0 (zero), instead of GetCurrentThreadID
|
|
|
|
|
I have to design a data acquisition card, it can use any bus (ISA or PCI), but I need some information about how to develop a windows driver for the card.
Thanks
|
|
|
|
|
http://www.jungo.com/windriver.html
It will save you a lot of time if you use something like this.
|
|
|
|
|
Does anyone know of a framework library (commercial, share- or freeware) like
MFC, or
BCG(http://msnhomepages.talkcity.com/WindowsWay/stasl/index.html), or
CJLibrary
(http://www.codejock.com/)
that's written to be used with straight C ?
I'm searching for over 3 weeks now on the internet. It looks to me that it's non-existent and/or impossible to do.
|
|
|
|
|
==================
The original message was:
Does anyone know of a framework library (commercial, share- or freeware) like MFC
...
that's written to be used with straight C ?
D-Flat is written in C. It's a text based GUI though. Some of the Unix GUI libraries/frameworks were written in C and are being ported to Windows. You can check the list of GUI libraries in the Mingw FAQ accessible from http://www.mingw.org and also check http://members.aol.com/lauram3017/uilibs.html for lists of available GUI frameworks. Many are in C++ but some have been written in C.
|
|
|
|
|
>>Some of the Unix GUI libraries/frameworks were >>written in C and are being ported to Windows.
GTK is one C framework originally developed for Unix. There's also a Windows port available.
|
|
|
|