|
I hope you are joking... the size of integers are only specified in realtive form (i.e. sizeof(char) <= sizeof(int) and so on).
Bitshifting based on static numbers are bound to fail.
Use comparisons instead (as in the post below).
And if the paths that I have followed/have tread against the flow/there is no need for sorrow
I am coming home
Return, Crüxshadows
|
|
|
|
|
int a = 145;
int b = -51;
bool fIsDifferent = (a >= 0) ^ (b >= 0);
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi !!
My app is being developed in MFC, VC++7. How can I make my controls resizable ?? I mean, when an user clicks on the corner to make the window bigger or smaller... please if the piece of code could be provided it would be great!!
Thank you very much !!
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
if ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
|
Hello everyone.
I have built a program with a listbox on the main dialog. I desire to use this listbox for multiple purposes, sometimes allowing the user to select an item out of it, othertimes not allowing them to select anything. What I am wondering, is it possible to have code within the program that changes the "selection" property of the listbox from "Single" to "None"?
Thanks!
|
|
|
|
|
One solution is to derive a class from CListCtrl and do custom selection. Otherwise, one possible solution is to intercept the mouse click.
Kuphryn
|
|
|
|
|
|
(I'm new at VC++). I've been looking for an hour on how to do this. I am wondering could you give me an example of how I would do this? (I tried looking for things such as m_ListBox.SetStyle() but could not find anything?)
Thanks for the reply I do appreciate it!
|
|
|
|
|
See CWnd::GetStyle() and ::SetWindowLong() to dynamically change a control's style.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Close, CWnd::ModifyStyle() is the function to use (assuming you're using MFC which it looks like you are)
m_ListBox.ModifyStyle ( LBS_MULTIPLESEL | LBS_NOSEL, LBS_NOSEL );
m_ListBox.ModifyStyle ( LBS_MULTIPLESEL | LBS_NOSEL, LBS_MULTIPLESEL );
m_ListBox.ModifyStyle ( LBS_MULTIPLESEL | LBS_NOSEL, 0 );
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Hi,
Can anyone please give me a clue about changing the background color of a word in a CRichEditCtrl control?
I've seen the documentation on Rich Edit 2.0 (whereever that lives!) and CHARFORMAT2 but whenever I try it the background color remains unchanged.
BazM
|
|
|
|
|
Hello,
see this article,
http://www.codeguru.com/richedit/SyntaxColorizer.html
With Regards,
R.Selvm
------------------------------------------
Wish you happy new year!
|
|
|
|
|
Hi there and many thanks for your reply.
I had already read this article but I dont think it helps with changing the background colour of an individual word.
However, I just found a great article by Andrew Forget (CodeGuru) about Rich Edit 2 and I am hoping that this does the trick.
Have a happy and prosperous new year!
BazM
|
|
|
|
|
I wish to copy a string of text to the Windows clipboard and paste it from it to an edit control.
what is the process? i tried consulting with MSDN, however, i couldn't understand the process, and where exactly is the reference to the Edit's handle.
Can someone explain shortly how it works, and what are the steps to be performed?
|
|
|
|
|
One solution is via COleDataSource.
char sString[5] = "2004";
sString[4] = '\0';
HANDLE cbData = ::GlobalAlloc(GMEM_MOVEABLE, 5);
PTSTR pData = static_cast<ptstr>(::GlobalLock(cbData));
_tcscpy(pData, sString);
::GlobalUnlock(cbData);
COleDataSource *pODS = new COleDataSource;
pODS->CacheGlobalData(CF_TEXT, cbData);
pODS->SetClipboard();
Check out MSND.
Kuphryn
|
|
|
|
|
Hello !
I'm currently working on an DOS App but i don't know how to use colors. For e.g. I want to set the BK color on BLUE and the Text color on WHITE. And i don't know to how to draw borders. I didn't found any Articels about this.
|
|
|
|
|
Hello,
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdOut, FOREGROUND_RED);
With Regards,
R.Selvam
|
|
|
|
|
Thanks. Works great
|
|
|
|
|
*plonk*
what you mean is a Win32 Console Application, not a DOS App
scio me nihil scire
My OpenSource(zlib/libpng License) Engine:
http://sourceforge.net/projects/rendertech
Its incurable, its a Pentium division failure.
|
|
|
|
|
I want to write a virtual printer driver.
The driver should be used from any print-dialog like any other printer which is installed on the system.
It should get the pages to print, change them and give them to the "real" printer.
Probably someone knows how to write such a driver an how to give the data further to the "real" printer.
Is this possible with Visual C++ and MFC? And how to make it?
I hope someone can answer me because there are very few things on this topic on the internet.
shojo
|
|
|
|
|
I want to develop a application which will connect me directly to yahoo messenger window(or any desktop application). i.e entering username and password in Login window will be handled by my application.
Any suggestions?
|
|
|
|
|
It is only a wild guess
I would Install a System wide CBT Hook and wait for the creation of Yahoo Login window (will work definitly)
then as soon as the window is created Use SetWindowText to set the Text in the username window and Password (might work)
and then send the dialog a message for Button click (will work)
Hope it helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Till CBT hook I am clear.After that how to wait for yahoo login window. Situation is not clear to me rather idon't know how to do it
|
|
|
|
|
SiddharthAtw wrote:
After that how to wait for yahoo login window
Check for the creation of login window in CBT Hook procedure
Use the Classname of Login window.
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
I need to get all users information from my windows system.
not only the users from local domain
I want to be able to see users from other domains who have rigths on my machine to indentify the privileges.
I used NetEnumUsers API but this function return only users from local domain
Anyone can help?
|
|
|
|