|
Sorry, this has probably been answered a thousand times so far. I want to paint the background of my edit controls a specific color. LOL, everything I try always seems to paint the background of my TEXT in the edit control a color, but I want the entire control painted that color, and before any text is entered! This is probably just a couple of lines I'm sure, but the help would be appreciated!
Thanks
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
From what I recall the thing is a little tricky, but fortunately Yury Golstman has it all wrapped up in a beatiful manner as shown in his article Colored/Blinking Controls and Dialogs with any Font[^].
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Cant get this to build on VC++ 6.0, Win2000.
Error when run pre-built ver. :the procedure entry point TzSpecificLocalTimeToSystemTime could not be located in the DLL KERNEL32.dll.
When attempting to re-build the .exe on my own, I get the undeclared identifier on this var/object/method. IS there a .h file missing?
"g:\program files\touch\touch.cpp(307) : error C2065: 'TzSpecificLocalTimeToSystemTime' : undeclared identifier"
Perhaps a lib I need to link with? (I tried <time.h>...)
Appreciate a nod, thx
deraeler
deraeler@hotmail.com
|
|
|
|
|
MSDN docs say this function is WinXP-specific.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yes I'm running Win 2k. Guess I'm SOL, unless you know of a workaround?
kudos to you for finding this so quickly, curious how MSDN came up with a response so fast....?
thanks..
|
|
|
|
|
|
Yes I'm running Win 2k. Guess I'm SOL, unless you know of a workaround?
thanks..
|
|
|
|
|
Hi,
I have a rather bizarre configuration that is causing me some headache.
An application running as the Interactive User acts as COM server.
A service spawns another application - therefore running under the System account - that tries to create an instance of the running COM server.
The spawned application fails with CO_E_SERVER_EXEC_FAILURE.
Additional info:
- The COM server uses TypeLib marshalling.
- I've tried to flatten the security access on the COM server - no change.
- A test application running using the logged on user account succeeds in creating the instance of the COM object.
- The COM server is a former MFC app that has been converted to use ATL with the very nice .NET plugin to make the conversion.
I have a feeling that is something related to security, but I'm quite surprised not to see 'access denied' rather than 0x80080005.
Any ideas? Thanks,
Alberto
|
|
|
|
|
I wrote two MFC applications which are installed on separate PCs on a NT network. The first MFC application needs to know when the second MFC application starts. I want to monitor how many people and who are using the second MFC application by passing the users logon info.
Any links or ideas on how to do this?
|
|
|
|
|
Many ways are possible:
- sending info using sockets;
- sending info via pipes, mailslot, ...;
- sending info via windows messaging;
...
Vitali
|
|
|
|
|
Hi! In my program I have a path to a file that I want to delete. I have looked all over google and here and can't find any explanation of what code I should use to delete this file without running any risks of formatting hardrdives etc...
I thought of using ShellExecute with del but was not sure if that was such a good idea.
Any help greatfully received!
Dom
|
|
|
|
|
What is wrong with ::DeleteFile(LPCTSTR pszFileName)?
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!
|
|
|
|
|
Thanks I new it had to be simple but for some reason the simplest answers are the hardest to find answers for.
Cheers
Dom
|
|
|
|
|
|
If you wish to send files to the recycle bin instead of just deleting them, use the SHFileOperation(...) function. It is a little tricky to use, but you can do a lot of cool stuff with it. See the MSDN.
Hack on!
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
i always thought
system("del file.txt")
was efficient.
*.*
cin >> knowledge;
|
|
|
|
|
int unlink(const char*) works too
todo....
:: insert inpirational text here ::
|
|
|
|
|
the typical newbie... they always want to code things much too difficult for them... i know that feeling...
Don't try it, just do it!
|
|
|
|
|
I tried to add this following function to a class in my project:
void SetPen(COLORREF penColor=0x00000000, UINT penStyle=PS_SOLID, int penWidth=0);
Adding this by hand gives no problem, except that the workspace window is bugged... trying to get to the definition in the .cpp file doesn't work.
The project will compile ok though, because the function really is there.
Now, if you add it using the workspace menu, a warning will appear that declaration en definition are not identical, and a corrupted definition is placed in the .cpp file....
void CMyClass::SetPen(COLORREF penColor);
This will NOT compile ofcourse...
It's easily fixed, replace UINT with unsigned int , but any typedef similar to the UINT one will show this behaviour.. (I'm using Visual Studio 6.0 SP5)
Anyone know a more permanent solution to this annoyance?
I wonder when Microsoft is held liable for damages due to their shoddy work...
|
|
|
|
|
I don't know any solution, but such problems force me to not use the ClassView tools, and instead resort to manual coding. I have always considered it a bonus if I happen to click on a function declaration in ClassView and it takes me directly to the definition.
Originally for sometime, I thought that it was me messing up, but found that it weren't. I now know that included the struct or defintiion longhand in the header file, and the typedefs can be used without problem in the declaration code bodies.
I too use SP5 but the same happened on SP3 too.
Sorry I can't be any help
|
|
|
|
|
I am new in windows programming and want to know, how to create bitmapped command button in Win32 API in detail.
|
|
|
|
|
Its very puzzling. I have a slider that controls the brightness of the image. The algorithm that does this is fine. The problem is that while I have the mouse pressed down on the slider, the image performs fine, following the slider nPos. But as soon as I let the mouse go, the image turns black. Some time ago I implemented the same thing in my MDI view class with the slider in the toolbar. That works fine. I cant see that I did anything different except that the slider then was in the same class (view) as the function being run in OnHScroll). But now I have a Cdialog instead with the slider, and its OnHScroll triggers the parent Cdialog to run the image brightening algorithm. The code in the slider CDialog is:
void CDlgSettings::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
pSld = (CSliderCtrl*)pScrollBar;
if (pSld !=0)
{
if(*pSld == m_sliderBright)
{
m_pParentWnd->SetBrightness(nPos);
}
if(*pSld == m_sliderContrast)
{
m_pParentWnd->SetContrast(nPos);
}
m_pParentWnd->DisplayLocal();
}
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
The displayLocal merely refreshes the display with the newly brightened palette.
As long as the mouse is held down on the slider, the image shows correctly. Soon as I let up, it goes dark.
Thanks for the help,
ns
|
|
|
|
|
nPos is only valid if nSBCode is SB_THUMBPOSITION or SB_THUMBTRACK. when you let up the mouse, you get a WM_HSCROLL message with nSBCode set to SB_ENDSCROLL and nPos set to zero. You will probably get the same result if you just click on the slider's track bar.
The key is to use CSliderCtrl::GetPos() to get the current position, and simply ignore nPos.
m_pParentWnd->SetBrightness(pSld->GetPos());
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi all,
Any Ideas how can i get access to IHTMLParamElement Interface... I have inserted an ActiveX control in MSHTML... i got IHTLMObjectElement interface pointer.. but now i need to change the properies of this ActiveX control at run time..
I have tried it via DOM. I get IHTMLDOMNode for ActiveX but i can't seem to have access to childNodes. It seems <object> tag doesn't support child nodes...
any ideas are welcome.. even a hint will do
cheers
|
|
|
|
|
Why can't you just directly set property of an ActiveX control through script or otherwise without messing with HTML?...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|