|
You can find lots of sample here.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
hi there,How can I enumerate all the screensaver and set one of them as the default screensaver? Can anybody give me a hit? thanx advanced.
|
|
|
|
|
Screen savers have the .scr extension and are winnt\system32 (or whatever your system32 dir is).
I could tell you more, but I'd have to kill you
No kidding, that is all i know about screen savers.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I'm on a work trip in Tokyo for June so a little out of contact with various filters on this net connection here. So, this question may have been answered already.
My temp email at which to post a reply is wolfram_s@hotmail.com
This will be cancelled whe the trip is over.
I received my latest MSND Libray DVD just before I left for here and low and behold Microsoft in their kindness got me to install IE6 and a the Installer, and also assumes that I am using VS.Net which I am not for this project. Hence my F1 help support has stopped working.
Does anyone know of a work around to make it work with VS 6?
Any help will be muchly appreciated.
Happy programming!!
|
|
|
|
|
Wolfram Steinke wrote:
Does anyone know of a work around to make it work with VS 6?
Sorry, October 2001 was the last MSDN that worked properly with VC 6. (Unless there's a hack I haven't heard of, although I doubt it because any hack would've been posted about 5 times in the Lounge within a day. )
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I need a function that take an integer and returns the month name. I can not use special function calls. I tried to do this bu declaring enum MonthNames = {January, February... etc etc and by not using enums and still had problems. Any help would be appreciated.
Sincerely,
Derek
|
|
|
|
|
IMHO, it would be very easy to write such a method.
I can not use special function calls.
What do you mean by that??
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I'm using STL, not MFC. I would like to store the Month names in an enum or something and easily be able to pass in 3 and have returned "March" or pass in 11 and have returned "November"
|
|
|
|
|
inline std::string GetMonthFromInt(int iMonth) {
static std::string sMonths[] = {
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" };
if ((iMonth >= 1) && (iMonth <= 12)) {
return sMonths[iMonth - 1];
} else {
throw "Bad month number";
}
}
or if you don't want the overhead of copying strings:
inline const std::string& GetMonthFromInt(int iMonth) {
static std::string sMonths[] = {
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" };
if ((iMonth >= 1) && (iMonth <= 12)) {
return sMonths[iMonth - 1];
} else {
throw "Bad month number";
}
}
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Call GetLocaleInfo() and query for LOCALE_SMONTHNAME1 thru LOCALE_SMONTHNAME12. This way the string gets automagically localized on all languages.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
You are a well full of knowledge when it comes to localization!!!
How many projects have you created with localization, and do you do this for every project that you create?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
When I worked at Symantec, everything we wrote had to be localizable. Mostly that meant making the code DBCS-enabled, and having all strings that the user might see in the string table. I've only needed GetLocaleInfo() once - I did a scheduling wizard and used it to show the names of the days of the week.
As for my present work, I automatically write DBCS-ready code out of habit.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Michael Dunn wrote:
I automatically write DBCS-ready code out of habit
That is how I write code as well. Although I have never had to use the GetLocaleInfo functions or anything to that effect. It is something that I am interested in learning because not many people I know, know how to use those functions, or even know that they exist. So it would increase my value as a developer for international software.
However, I really find that stuff dull and would rather learn 3D computer graphics or something like that
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Some sample code for Derek who asked in email
TCHAR szMonth[128];
GetLocaleInfo ( LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1, szMonth, 128 );
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
my app want to modiy clipboard that the other app already open it.
What's could I do ?
How is it ?
Thank you so much
|
|
|
|
|
An application cannot modify the clipboard if another application has it open already.
The clipboard owner must close the clipboard, then another application could open, modify, and close it, then the original owner could open it again with the modifications in place.
|
|
|
|
|
How do most people do their program in Doc/View?
I find it weird that Doc/View have been used in such a way in filezilla, a GPL ftp client and server.
http://sourceforge.net/projects/filezilla/
Such that the view have access to the window itself and encapsulation have been broken.
Is it a common and easier way to do things this way?
From what i have read in books, we should have accessor methods to access the private members in the Document class, and the view class should use these accessor methods.
Perhaps in this example, filezilla does not really have a "document" thus his use of direct access to the window to c
What do you guys think of this progam?
And how should Doc/View be used in programs like this?
Leaning newbie
Give a man a fish and he eats today. Teach a man to fish and he can feed himself for the rest of his life
|
|
|
|
|
Someone recommended that I use the CFileFind class to check the contents of a folder. I tried it and it works great only it check the contents of the folder that my program was in. I can't seem to check the contents of any other folders. How can I accomplish this?
-Raffi
Why do today what can be put of until tommorrow?
|
|
|
|
|
GREETINGS!
virtual BOOL FindFile( LPCTSTR pstrName = NULL, DWORD dwUnused = 0 );
Specify full path in pstrName:
CFileFind hFile;
hFile.FindFile("C:\\Windows\\*.dll",0)
Than use hFile.FindNextFile();
Good luck!
LOVE & PEACE to everyone
|
|
|
|
|
Look for the example in MSDN for FindNextFile .
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Hi,
I need to be able to show and hide bitmaps in a dialog dynamically. Basically, I want to use the bitmaps to make a card game, but I need to be able to specify their (the cards) locations. I need to be able to do something of the following (yes, I know the following code wont do anything):
ShowBitmapXYZ(0,0);
Or something along those lines.
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Draw your bitmap in a static control, use SetBitmap(), ShowWindow() and MoveWindow() to control which bitmap where
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
What does SetBitmap() do? Also, how can I display multiple copies of the same bitmap?
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Selevercin wrote:
What does SetBitmap() do?
From MSDN:
CStatic::SetBitmap
HBITMAP SetBitmap( HBITMAP hBitmap );
Return Value
The handle of the bitmap previously associated with the static control, or NULL if no bitmap was associated with the static control.
Parameters
hBitmap
Handle of the bitmap to be drawn in the static control.
Remarks
Call this member function to associate a new bitmap with the static control.
The bitmap will be automatically drawn in the static control. By default, it will be drawn in the upper-left corner and the static control will be resized to the size of the bitmap.
You can use various window and static control styles, including the following:
SS_BITMAP Use this style always for bitmaps.
SS_CENTERIMAGE Use to center in the static control. If the image is larger than the static control, it will be clipped. If it is smaller than the static control, the empty space around the image will be filled by the color of the pixel in the upper left corner of the bitmap.
Selevercin wrote:
how can I display multiple copies of the same bitmap?
Use multiple static controls
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
Ok, my program is crashing on the code. This is what I have:
<code>
CStatic card;
HBITMAP hBitmap;
hBitmap = ::LoadBitmap(NULL, MAKEINTRESOURCE(IDB_2));
card.SetBitmap(hBitmap);
card.ShowWindow(SW_SHOW);
card.MoveWindow(100, 100, 23, 35, TRUE);
I know it is the SetBitmap() that is causing it, but what did I do wrong?
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|