|
Use ModifyMenu, refer this thread[^].
|
|
|
|
|
if your application is a simple SDI or MDI,
Add this statement,where ever you want to change the menu title.
::SetWindowText(this->m_pMainWnd->m_hWnd,"TestCaption");
Appu..
"My blood group is not B+.But I have it my blood"
|
|
|
|
|
Of course not prasad_som he doesnt need
|
|
|
|
|
Hi,
does anyone know a way to find out if a certain menu handle denotes a popup menu or a menu bar? The GetMenuInfo() API function does not seem to provide this information. If someone knows for sure that it is really not possible to obtain the information about the menu type from the menu handle - this could also help ...
Best regards,
Daniel
|
|
|
|
|
Did you check GetMenuBarInfo ??
Appu..
"My blood group is not B+.But I have it my blood"
|
|
|
|
|
GetMenuBarInfo() takes the handle of the owning window, not a menu handle.
|
|
|
|
|
schwadan wrote: If someone knows for sure that it is really not possible to obtain the information about the menu type
It is possible,
Use GetMenuState .
UINT nState = GetMenuState(m_hMenu,0,MF_BYPOSITION);
if (LOBYTE(nState) & MF_POPUP)
{
}
|
|
|
|
|
I just tried it out: The example works if a pass the handle to the parent menu bar for m_hMenu. If I pass the handle of the popup menu itself, the MF_POPUP flag is not set in the result. This is also what one would expect according to the API doc.
It seems it is really not possible to retrieve the menu type from the menu handle itself. It seems I've found a hole in the Win32 API ...
Daniel
|
|
|
|
|
schwadan wrote: The example works if a pass the handle to the parent menu bar for m_hMenu.
It meant to used that way only, watch second paramter, where you can give menu items ID.
You may like to explore GetMenuItemInfo ,too.
|
|
|
|
|
How do you add an application icon using Visual Studio 6 for a WIN32 console exe application? Thanks.
|
|
|
|
|
Add an icon resource with ID 1. Windows will use the first icon resource in the EXE.
I've noticed on XP in Windows Explorer the custom icon doesn't show in list or detail view modes.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
|
I have developed a text editor supporting international languages.
One problem still bother me: The location of the IME window.
When I have an asian user entering asian characters, (s)he does so through an IME window which is located in a seemingly unpredictable/uncontrollable location.
Is there a way I could set the location, size, and font (or at least font size) used by this IME window?
How could I know when it is used or not?
|
|
|
|
|
hi,
i would like to know the procedure for loading a jpg file and separating into RGB components in Visual C++ / C++. I have to start with the fast fourier transform of the image. I have background in C, but not that much. I have got my fft code written in matlab. I can write the code for fft in C++, but i dont know how to load the image. it would be highly helpful if it would be suggested here!
thanks a ton,
-cedance
|
|
|
|
|
Going to roll your own loader? Cool project.
Lots of useful info can be obtained and/or linked to from here: JPEG Homepage[^]
You'll probably need to understand the JFIF file format and the compression itself.
Enjoy!
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
|
Hi,
thanks a lot for the links. but, cant i directly load like any other file using fopen command in C or similar commands? does it require a library separately for definite??
thanks a lot,
-cedance
|
|
|
|
|
You can easily open the file and read the data, the problem comes if you want to display the picture on the screen / printer etc. Here you need a bitmap.
Assume that the picture that the jpg represents was taken with 24 bit colour - this means that each pixel was represented by 24 bits. Saving all this information to a file results in LARGE files. The jpg format is a lossy compression format that allows you to store the picture at around 2 bits/pixel or less (1.5 - 2 bits per pixel usually results in a picture indistinguishable from the original). What is stored is a whole bunch of fourier coefficients and some tables of quantization levels. Basically you have to invert a lot of fourier cosine transforms to recover the original bitmap. If you know what I'm talking about then you should be able to do the decoding from the spec, if not, read up on it before you decide to start.
Sorry - I just re-read your original post - seems like you do understand about FFTs , so if you understand C you can do exactly the same in C++ as this is generally a superset of C. You can use fopen and read the file into a buffer. There are a bunch of C++ things you could do depending on your application, but as far as getting the contents of the file into a buffer, they are not significantly better.
|
|
|
|
|
hi cp9876
thanks a lot for ur quick reply. i guess you misunderstood my question, reg. your explanation in the second paragraph. i already have written the code for fft both decimation in time and frequency in matlab. i was told by my professor to create a stand alone application using VC++ which i am not familiar to that extent. i have done a bunch of usual programs with C++ thats it! and i have loaded the jpeg files in C++ for these stuffs before but dont remember how i did it, nor do i have the source code of those now with me! i can write the program from matlab to C, not a big issue i guess, i know the algorithm... all i need to do is create an application that loads an image and calculates the fft and ifft.
i needed the syntax for that fopen to read jpg files into the buffer exactly... can you tel me where i can find them or can u post it here??
thanks a lot,
-cedance
|
|
|
|
|
I guess your problem is not with the syntax for using fopen or CFile (if it is you can easily find this in MSDN), but once you have the handle to the file how you unpack the information - the detailed file format to put into your arrays and tables. Can't help you here, however a quick google on "reading jpeg files" threw up links to standards and some open source software that does what you want (even a C++ one) - should be a good place to start.
|
|
|
|
|
JPEG is a compression scheme, not a file format. JPEG File Interchange Format (JFIF) is a file format commonly used for storing and transferring images that have been compressed according to the JPEG scheme.
For displaying the image you need to first decompress the image.
|
|
|
|
|
Hi,
I am not sure if I explained it right... sorry for the confusion. Like that of *.bmp images, there are *.jpg images right? My question is, how will one load this *.bmp or *.jpg picture file into an array for further processing in C/C++?? I need to say, construct a Gaussian filter or median filter or whatever, for further processing like blurring, etc... contrast, or take the FFT of the image, in this case... And then, I have to store the values obtained in a file. If it could be stored as a picture back itself, then fine, otherwise, please specify how to do it.
Its like, after calculating the fft, i run the filters from the fft obtained results, like bessel or gaussian filters and then restore the modified (blurred, in this case) image. This is what i hav to do. In case I made some mistakes in explaining here too, please specify.
thanks,
-cedance
|
|
|
|
|
So you want to load and decompress the image, and THEN do some processing on the pixels?
The CImage class can help
#include <atlimage.h>
...
CImage image;
image.Load("C:\\TEST.JPG");
Then you can use
image.GetWidth()/image.GetWidth() to get the image dimensions in pixels
image.GetBPP() to get the bits-per-pixel
image.GetPitch() to get the bytes-per-row in the pixel data
image.GetBits() to get a pointer to the RGB pixel data
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hi Mark,
thanks a lot. Will try this one...
regards,
-cedance
|
|
|
|
|
Hi,
My understanding of your query is as follows::
You need to do some processing on the image (raw bits that means pixel values). Now you have the .jpeg image file, a compressed file. so first you need to extract the pixel values from jpeg file. As jpeg file is compressed file first you need to decompress using decompression logic.
Please refer http://www.faqs.org/faqs/jpeg-faq/part2/section-15.html[^]
Regards,
Paresh.
|
|
|
|