|
harsha_1234 wrote: i have a combo box whose type is dropdown and i want that it should be only
selectable i mean user should not be able to edit in that combo box.
You can't. By using the CBS_DROPDOWN or CBS_SIMPLE style, there will be an edit control as part of the combobox. If you do not want this, you must use the CBS_DROPDOWNLIST style instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I am new to C++ and MFC.I am creating a zoom application(dialog based application) using VC++ in VS2005. While invoking this application, it will zoom whatever screen appears in the screen. I have a problem now. I am opening a modal dialog created in another application, When I tried to invoke the zoom application(which is also a dialog), it closes the previously opened dialog(opened by the another application).
Please clarify how to resolve this issue. I understand that the dialog
opened by the other application receives some message and got closed,
while invoking the zoom application. Please help me to retain that
dialog also while opening the zoom application.
Thanks in advance.
Sri
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
How can we give shaded background color to our GUI.
Means form upperside some dark color and when we moved to bottom
the darkness of the color to be reduced and turned to as light color.
How can i do it?
|
|
|
|
|
kiranin wrote: GUI.
How vague. GUI means a dialog? Read This article[^]
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Thank you Brahmma, Now i want change the same color to caption bar and border also....
Is it possible?
-- modified at 6:22 Tuesday 28th November, 2006
|
|
|
|
|
they are all classes inheriting from CWnd.
so your own class for each, inheriting from the class you want to modify, overload the right function, and that's it...
|
|
|
|
|
The SetProcessDefaultLayout function changes the default layout when windows are created with no parent or owner only for the currently running process. -by MSDN-
In my case, i already used SetProcessDefaultLayout to change the default layout of my windows, the problems is that child windows ( for example a dialog wich shows the Police ) don't respect the layout of it's parent.
Is there an idea ?
|
|
|
|
|
I want to invert bitmap thro 180 degree and want to display it into dialog box.
please suggest me something.
Thank you.
There Is Nothing Right & Wrong
|
|
|
|
|
abhijit bhopale wrote: I want to invert bitmap thro 180 degree
Invert or rotate?
abhijit bhopale wrote: There Is Nothing Right & Wrong
Actually, there is.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Thank u..
Rotate.
There Is Nothing Right & Wrong
|
|
|
|
|
I'm coding in C++, but just using basic C++ libraries (ie. not MFC or WTL etc.).
I would like to know if there is a more elegant/better way to do what I have coded below, just to learn something.
Basically, given a "code" I want to verify that each "digit" is Octal (ie. 0-7), and that the "code" is exactly 4 characters.
I'm using this as an opportunity for a "code review" by you peers to see if I can learn something.
bool Xpdr::IsValidCode(const wchar_t* code)
{
// Has 4 numeric digits
if (wcslen(code) != 4)
{
return false; // Code MUST be 4 digits
}
for (int i=0; i<4; i++)
{
// Check each digit is octal
if (code[i] < 0x30 || code[i] > 0x37)
{
return false; // Code digits must be 0 - 7
}
}
return true;
}
Thanks for your thoughts on how to make this better / more efficient.
|
|
|
|
|
I think a possible alternative solution is:
bool Xpdr::IsValidCode(const wchar_t * code) const
{
for( int i = 0; i < 4; ++i, ++code)
{
if( *code < '0' || *code > '7')
{
return false;
}
}
return *code == 0;
}
I hope this works. In addition you can "unroll" this short loop and replace it with a series of "if"-s and autoincremented code pointer.
-- modified at 5:47 Tuesday 28th November, 2006
|
|
|
|
|
Ah, very interesting. Nice touch verifying that there is a terminating NULL.
By unroll are you meaning something like this:
bool Xpdr::IsValidCode(const wchar_t * code) const
{
if( *code < '0' || *code > '7') { return false; }
code++;
if( *code < '0' || *code > '7') { return false; }
code++;
if( *code < '0' || *code > '7') { return false; }
code++;
if( *code < '0' || *code > '7') { return false; }
return *code == 0;
}
|
|
|
|
|
Stick^ wrote: [...]By unroll are you meaning something like this[...]
Yes (actually you need one more ++ : return *++code == 0 ). Or even like this:
inline bool Xpdr::IsValidCode(const wchar_t * code) const
{
return
code[0] >= '0' && code[0] <= '7' &&
code[1] >= '0' && code[1] <= '7' &&
code[2] >= '0' && code[2] <= '7' &&
code[3] >= '0' && code[3] <= '7' &&
code[4] == 0;
}
|
|
|
|
|
Stick^ wrote: for (int i=0; i<4; i++)
{
// Check each digit is octal
if (code[i] < 0x30 || code[i] > 0x37)
{
return false; // Code digits must be 0 - 7
}
}
Have you considered wcstol(code, ..., 8) ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
No, but I am thinking that function won't help me, because what I am trying to do is verify that input (a WCHAR*) typed by a user is in the range 0000 - 7777, with only octal (ie 0-7) digits. They could enter anything on their keyboard, so I need to validate it, not just convert it.
Thanks guys.
|
|
|
|
|
Stick^ wrote: No, but I am thinking that function won't help me, because what I am trying to do is verify that input (a WCHAR*) typed by a user is in the range 0000 - 7777...
Which is exactly what it does. If you sent it "7778", it would return an error status.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I do not know how to use the UpdateResource() function to create an ICON
resource within an .exe file. I have managed to create raw data resources
with this function, but not ICONs. Does anyone know how to make this work
given a file path to an .ico file. I need to change the icon in an .exe
file when it is displayed in explorer.
Many thanks
|
|
|
|
|
Atom wrote: I do not know how to use the UpdateResource() function to create an ICON
resource within an .exe file.
Was there any problem? Have you tried creating an RT_GROUP_ICON instead.
For more information read the article Icons in Win32 in MSDN .
|
|
|
|
|
Hi all,
I am writting a program which would like to detect if the PC is waken-up when it is in "stand-by" mode. Is there any method to do so? any reference source/material is welcome, thanks~
|
|
|
|
|
StarMeteor wrote: any reference source/material is welcome, thanks~
Look up WM_POWER , WM_POWERBROADCAST , WM_POWERCHANGE_NEEDACK in MSDN .
|
|
|
|
|
Is it possible to set hook for Joystick?
Please help!
|
|
|
|
|
Hello people
Can anybody explain why my CSocket Receive call fails when i use it with threading
With Rgds
Girish
Software Developer
|
|
|
|
|
Hi,
check error code
-----------
Mila
|
|
|
|