|
Hi!
I need to detect screen resolution change cause i am working in a toolbar that docks in the borders of the screen.
Thanks
|
|
|
|
|
Easy peasy.
Handle the WM_DISPLAYCHANGE message.
Nnnnext!
|
|
|
|
|
Thats what I get for answering a post before my first morning cup of coffee. I didnt even realize that was what he was asking.
Best Wishes,
-David Delaune
|
|
|
|
|
If you us the GetSystemMetrics Function[^]
int x = GetSystemMetrics(SM_CXSCREEN);
int y = GetSystemMetrics(SM_CYSCREEN);
On a multi-monitor system you can use SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN.
You could also use the GetDeviceCaps Function[^]
int x = GetDeviceCaps(hDC, HORZRES);
int y = GetDeviceCaps(hDC, VERTRES);
Best Wishes,
-David Delaune
|
|
|
|
|
There's a system event which should be what you're looking for documented here.[^]
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Hello all,
I am currently trying to do a project where I convert AVI files into MP4 and I was planning on using directshow to do this. Does anyone know where I might be able to find a filter which does the job for me. I would prefer this to be open source and free if possible.
If no one knows where I can get such a filter could anyone suggest somewhere I might find some info about performing the transform as I am struggling to find anything of use at the moment.
Thanks for the help.
|
|
|
|
|
FFMPEG[^] is a free open source project that supports almost all heard of formats.
But I think you cannot compile it with Visual Studio. But you could use its binary.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hello Guys
I have got an array of chars for example: char[0] = 'C'
char[1] = '\0'
char[2] = '+'
char[3] = '+'
Now i ve got a problem how to put this chars in BSTR,
so that i can have a BSTR with embedded NULL cahr?
Or how can i create a BSTR with embedded NULL char in the middle?
Any ideas?
|
|
|
|
|
|
BSTR is finished with a NULL char although it has a fixed length.With an embeded NULL char may cause program-exception.But if you insist to do that,check these code:
{
BSTR bstrTest = SysAllocString(L"C+++");
BYTE *pByte;
pByte = *(BYTE **)(&bstrTest);
*(pByte+2) = 0x00;
//bstrTest is your BSTR {0x43,0x00,0x2B,0x2B}
//print the fixed length
printf("the length is %i\n", SysStringLen(bstrTest));
//print the raw BSTR data
printf("the 1st unicode raw data is %x %x\n", (BYTE)(*pByte++), (BYTE)(*pByte));
pByte++;
printf("the 2nd unicode raw data is %x %x\n", (BYTE)(*pByte++), (BYTE)(*pByte));
pByte++;
printf("the 3rd unicode raw data is %x %x\n", (BYTE)(*pByte++), (BYTE)(*pByte));
pByte++;
printf("the 4th unicode raw data is %x %x\n", (BYTE)(*pByte++), (BYTE)(*pByte));
pByte++;
printf("the end raw data is %x %x\n", (BYTE)(*pByte++), (BYTE)(*pByte));
}
|
|
|
|
|
Hello,
I wrote an mfc application using vc 2008.When UI tried to test my application on other computers I am getting "Application is not confiured properly" message although I copied required dlls.Tested systems are Windows Xp and Vista.My own system is Windows Xp and I have vc 2008 installed.Running properly. What is missing on the test systems? .net 3.5? or latest service packs.
|
|
|
|
|
|
Thanks David,
I copied dlls manually.I recently download redist package. I see that package does some additional configurations on the system(not just a dll coppy ).I hope It is going to solve my problem.Thanks for your prompt answer
Best wishes
BilgeKaan
|
|
|
|
|
Bilge Kaan wrote: I see that package does some additional configurations on the system(not just a dll coppy ).
Yeah, its the latest Microsoft answer to one of the oldest known shared object problems aptly named DLL Hell[^] the configuration stuff your seeing is called Side-by-side Assemblies[^]
Best Wishes,
-David Delaune
|
|
|
|
|
hi. i have downloaded the complete zip file of CSmtp_v1_5 and i use Dev C++ 4.9.9.2 to compile the main file of this zip file. when i compile there is a message like this
[Linker error] undefined reference to `CSmtp::CSmtp()'
[Linker error] undefined reference to `CSmtp::SetSMTPServer(char const*, unsigned short)'
[Linker error] undefined reference to `CSmtp::AddRecipient(char const*, char const*)'
i am unable to compile this main.cpp file due tolinker error.please help me. how can i compile that main.cpp file?
ravi joshi
|
|
|
|
|
You need to tell the linker where to find the library built for CSmtp. Simple as.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I am using CImg library, i can upload a single image at a time. But i need to upload a sample of images.
Plzz help me in loading multiple images using the same library..![Confused | :confused:](https://www.codeproject.com/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
upload to where?
Uploading sounds more like a problem with a website?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Upload means load a image in the progg...actually i am doing project on face recognition. For this i need to load multiple images on progg. using the CImg libray..plzz reply??![Confused | :confused:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
shyampasari wrote: Upload means load a image in the progg
Well, in that case, use multiple CImg instances...using code from the tutorial[^], you could use this to load two images, a.jpg and b.jpg:
CImg<unsigned char> image("a.jpg");
CImg<unsigned char> image("b.jpg");
Note that to load JPG files into CImg, you need to link against <a href="http://www.imagemagick.org/script/index.php">ImageMagick</a>[<a href="http://www.imagemagick.org/script/index.php" target="_blank" title="New Window">^</a>].
<div class="ForumSig">Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p</div>
|
|
|
|
|
I have to load multiple images like from 10-20, also the no. of images is not known it varies with problem, so i thought use for loop
convert integer to char using sprintf then concatenate it with the format like---.jpg, .bmp etc
char fmt[]=".jpg"
for(int i=1;i<=15;i++)
{
sprintf(str,"%d",i);
str=strcat(str,fmt);
CImg<double> image("C:/Users/Shree Hari/Desktop/trial/str");
CImgDisplay main_display(image,"Image",0);
}
now that str will vary from
1.jpg
2.jpg
3.jpg
and so on and my database is also like as above mentioned
but it is not reading str!!!!
Plzz help me in this ![D'Oh! | :doh:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_doh.gif)
|
|
|
|
|
Hello,
I've been trying to solve that problem for some time now and I'll be very grateful to anyone who can suggest a solution. The problem is a little tricky but I hope I'll be able to explain it clearly.
I have an application which might need to notify the user of an event even if it's not focused at the moment or is minimized. Think of something along the lines of an app that copies files for 5-6 minutes and needs to say 'Your files were copied' at the end, but the user has switched to writing emails in the meantime. I don't want to grab the keyboard focus because he might be doing something like writing in notepad in which case he'll be randomly pressing hotkeys on my dialog instead of writing to notepad. But I can't figure out how to do this properly.
Right now I use this code (from my main dialog class):
SetForegroundWindow();
By calling SetForegroundWindow() my dialog comes to the foreground (or flashes - but I don't know how Windows decides which of the two) and sometimes will steal focus which I don't want, but there are many problems if my dialog is also minimized. In this case the taskbar icon of my dialog will seem to become active on the taskbar, but my dialog won't show itself (it'll remain minimized but receive keyboard focus it seems). If I uncomment the other two lines, then it solves all problems with minimizing as it first unminimizes the dialog, but it _always_ steals focus which I don't want.
My second problem with the main dialog being minimized is I also create a dialog containing some information about the event and I display it with DoModal, and if I call DoModal while the main window was minimized, when the user switches to my program the new dialog created with DoModal is shown but the main dialog is not. Any way to fix that?
So it's all very complicated and I'm not sure how it's supposed to be implemented. Again, all I want is to notify the user without stealing keyboard focus, even if my dialog is minimized at the time. Do I unminimize my dialog? How do I prevent it from stealing focus then?
Any help will be greatly appreciated!
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Instead of SetForegroundWindow, why not install a system nofitication icon[^] while your dialog is doesn't have focus. Then you can display a balloon tip[^] when you want to tell the user that you're done.
There are several Code Project articles on the subject here[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for the reply, this is interesting. I didn't think of doing that, but it'll certainly solve the problem.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I'm thinking of displaying an icon on the tray, and when the operation is done a balloon tooltip emerges and notifies the user. Optionally when the user clicks on it the focus is switched to my app.
The documentation seems a bit complicated, especially about which flags need to be used in the uFlags field of NOTIFYICONDATA. I see I need NIF_ICON and NIF_INFO for balloons, but do I need NIF_TIP also? Can you help me by telling me which flags do I need to set?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|