|
You should be fine if you handle the WM_SYSCOLORCHANGE message. You could then refresh your color cache. In C#, you have to handle the SystemColorsChanged for the form or control.
Yves
|
|
|
|
|
Thanks, but it's not just the colour.
It's the text size, border sizes, and whether themes are enabled / disabled in XP. If a user changes these without changing the colour, then it won't update properly. I'm sure I read about a system metrics change method somewhere, but it was in the windows SDK.
Any other thoughts?
Cata
|
|
|
|
|
Hello,
I am sure this may have been dealt with by somebody. I am wondering how to load an own bitmap image in place of miscrosoft default icon in VC++ application.
Thanks for help in advance.
Murali
|
|
|
|
|
do you mean the icon in the about box or on the title bar? Just add it to the resource under icon IDR_MAINFRAME. For the about box you could add a picture control and add the bitmap to the resource as a bitmap and have the control reference that bitmap.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I am looking to change the icon at the title bar and the icon in the taskbar of windows when the application is executing. Also, I have only a bitmap of the image. Can you please tell me how I should add my bitmap image to application to show up in title and taskbars.
thanks
Murali
|
|
|
|
|
The icon for the title bar and the task bar come from the icon. Two ways to do this.
1. Convert your bitmap to a .ico file. Microangelo is a great tool to do this.
2. Import in the bitmap. Then copy and paste it over the icon. Both the 32x32 and the 16x16 icons. The only problem with this is that it will distort the bitmap some and sometimes does not look very nice.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Thanks Tom,
I was just following similar to steps you outlined while your email just arrived listing them ). Thanks again. Yes, that is true I lost some resolution in process of step 1 but that is OK for now.
One thing I did (before your email arrived) was generated the *.ico file using "CDMenu V2" trial version of software I obtained from internet. It worked well. However, I COULD NOT get my application to work with ONLY the 32X32 bitsize icon. I am not clear why this was so?
However, after reading your email and creating the 16X16 bitsize icon file as well, then it all worked. Can you explain why only the 32X32 icon file is not sufficient.
Thanks again
Murali
|
|
|
|
|
Is there some type of message I can set up or receive so that my app can tell when a new file is added to a particular folder?
[insert witty comment here]
bdiamond
|
|
|
|
|
|
There's also FindFirstChangeNotification() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
the limitation of the system way of doing things is that it cant watch network folders (afaik) ... depending what ur doing with the files and how often u could just scan the folders every n seconds and update ur list from that
"there is no spoon" biz stuff about me
|
|
|
|
|
l a u r e n wrote:
...it cant watch network folders...
Yes, files and folders on network volumes can be monitored just fine.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thank you. I accomplished what I was trying to do with ReadDirectoryChangesW() just fine. And it works for me on network folders as long as the drive is mapped. The only problem I'm having now is that I'm trying to let the user cancel 'watching' and start again. I put the function in a separate thread and am calling SuspendThread(),then delete(), which seems to be working, but I was just enlightened by Michael Blake through watching the task manager, this is not working correctly as it is steadily increasing the number of handles and threads being used and could eventually cause Windows to crash.
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
And it works for me on network folders as long as the drive is mapped.
It works with UNC as well.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I've tried using this syntax for the folder name: "\\Server1\files\" with and without ending backslash, and it just won't work for me. when I map the same folder to drive letter and use "L:\" it works just fine. Also, that was only a test. The real folder is a folder that holds zip files for bug reports for our clients that I want to alert me everytime we get a new bug sent and it parses the file and puts it in our bug database for use with our bug program (an app I wrote). If I use my "G:\" drive, I get the notification. If I use the real folder I want, ReadDirectoryChangesW() returns as soon as something is placed in the folder, but it doesn't succeed. A call to GetLastError returns "Unspecified Network Error". Usually ReadDirectoryDirectoryChangesW() hangs until it receives a notification, then continues with code in loop. Do you have any idea what the h___ is going on? Thanks in advance.
[insert witty comment here]
bdiamond
|
|
|
|
|
Check out the fwatch sample in MSDN. It comes with a .ini file where you include the names of the files you want to watch. Mine looks like:
[Directories]
\\pbssvr\ddrive\Users\David2Brian\53=
[Files]
cwb3mijs.dll=
cwb3uijs.dll= Now whenever anything happens to cwb3mijs.dll or cwb3uijs.dll, a line is printed to stdout.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I think I may have found what the problem is. The folder I'm trying to monitor is actually on a UNIX machine. Our network admin has it where it shows up in our network like it's on one of the regular windows servers, but it's not. I tried the fwatch program and put in the path (regular, and mapped as a drive letter), and it still won't work. It works on my local machine's folders and even on a folder on a different windows 2000 server, but not on the directory I'm trying to get it to work on. I guess I just wasted about 8 hours of company time
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
I guess I just wasted about 8 hours of company time
Nonsense. Programming is never about wasted time. Whether you found one way that does work, or a dozen ways that don't work, you've learned something nontheless. Right? Remember that Thomas Edison said that every wrong attempt discarded is often a step forward.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Of course you're right, thanks for the encouragement. I've rewritten it now using a user-configurable amount of minutes that will be used with the CFileFind class. After processing the zip file it will delete it, or move it to a backup location if they have one specified. Thanks for all your help!
[insert witty comment here]
bdiamond
|
|
|
|
|
Is there any way to capture an image from an USB WebCam?
|
|
|
|
|
yes there is.
here is what you have to do:
1) use the code you find below
2) create a BITMAPINFOHEADER
3) write the BITMAPINFOHEADER and the bitmap, that is captured below to a file.
hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL);
hdcCompatible = CreateCompatibleDC(hdcScreen);
hbmScreen = CreateCompatibleBitmap(hdcScreen, Videobild.right, Videobild.bottom);
if (hbmScreen == NULL)
MessageBox("Bmp konnte nicht erstellt werden");
hbmScreen = ::CreateDIBSection(dc.GetSafeHdc(), (LPBITMAPINFO) m_dibFile.m_lpBMIH,DIB_RGB_COLORS, (LPVOID*) &m_dibFile.m_lpImage, NULL, 0);
GDIObject=SelectObject(hdcCompatible, hbmScreen);
if(GDIObject==NULL)
MessageBox("Object konnte nicht selected werden");
if (!BitBlt(hdcCompatible, 0,0, Videobild.right, Videobild.bottom, hdcScreen, Videobild.left,Videobild.top, SRCCOPY))
MessageBox("Object konnte nicht geBitBltet werden");
|
|
|
|
|
There is always a way. I haven't actually looked at it for 2 years, so I can't help you directly. You'll probably want to look at DirectShow, everything that you want should be there. I believe I remember an example program in the SDK called Stillcap. Anyway good luck.
|
|
|
|
|
With a CTabCtrl added to a dialog box, it is possible to create it with style TCS_VERTICAL and TCS_RIGHT.
If I however want to use the nice and easy to use Property Sheet and Page classes, I have not yet found a method or variable to do the same setting.
I have found the method to get a handle to the sheet's TabCtrl, but how can I control the style ???
It seems as if the style can only be specified at create time.
I have found some nice code articles related to tab controls and property sheets on Code Project, but so far nothing like this.
Does anyone know ???
Regards,
/Thomas
|
|
|
|
|
There are a few classes that let you replace the tab control with a tree. This is an elegant solution especially on XP where the tab control is not drawn properly when it is not at the top. CTreePropSheet[^]and CTreePropSheetEx[^] both inherit from CPropertySheet and use CPropertyPage object for the pages so this should have minimum impact on your existing code.
Yves
|
|
|
|
|
Thanks for the tip !
The "tree" class looks nice, but in my case I'm afraid it will not work well.
The reason for that is that I'm doing a Windows CE application for a device with a small touch screen, to be clicked with the finger tips, and I'm afraid that the symbols in the tree are too small to click on.
The tabs in a property sheet are simply bigger, at least when I as in my case have only 4-5 of them.
|
|
|
|