|
Hi all (again)
=-=-=-=-=-=-=-
I have a Win32 application ... (Not using MFC)
and my dialog I have a button control (IDC_MY_BUTTON)
and I need to change the color of its text...
Please Help..
BTW:
I change the buttons font using WM_SETFONT,
everything OK, but I cant change the font to "Comic Sans MS"
10q all
=-=-=-=-=-=-=
The Server
=-=-=-=-=-=-=
|
|
|
|
|
Handle WM_CTLCOLORBTN message in button's parent. Make required changes in DC passed in message parameter.
|
|
|
|
|
Hi,
I'm looking for a function to return the status of a process.
status such as Running or Not Responding.
Thank u in advance.
|
|
|
|
|
One solution is WaitForSingleObject().
Kuphryn
|
|
|
|
|
GetExitCodeProcess() returns the process's exit code, or STILL_ACTIVE if the process is running.
As for getting 'running' or 'not responding' in the sense of the Applications tab of Task Manager (in Windows NT), I think Task Manager has some kind of hook to be able to tell this. You could try using SendMessageTimeout() to send a message to the top-level window - if it responds within the timeout, it's responding. I'd suggest using either WM_NULL or a guaranteed-unique registered message from RegisterWindowMessage() - perhaps a string representation of a GUID?
--
Mike Dimmick
|
|
|
|
|
I've added a menu to a dialog application and am trying to grey out some parts of the menu. However, the call to my UPDATE_COMMAND_UI function is not called until after the the menu has been clicked. I'm guessing I have to do something different since it is a dialog app, but I don't know what and can't seem to find it. How can I do this?
Thanks in advanced
|
|
|
|
|
Hi!
This code may help you!It has everything about changing dynamically menu items:
void CExampleView::OnUpdateEditInsertolecontrol(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
// Specific for the example
pCmdUI->Enable(m_pControl == NULL);
}
void CExampleView::OnEditInsertolecontrol()
{
// TODO: Add your command handler code here
COCBrowserDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// Your code ...
// Change menu item (Insert OLE Object -> Delete OLE Object)
CMenu *menu;
// 'Edit' is the second submenu (index = 1)
menu = AfxGetApp()->m_pMainWnd->GetMenu()->GetSubMenu(1);
menu->ModifyMenu(ID_EDIT_INSERTOLECONTROL, MF_BYCOMMAND, ID_EDIT_DELETEOLECONTROL, "&Delete OLE Control");
}
void CExampleView::OnUpdateEditDeleteolecontrol(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
// Specific for the example
pCmdUI->Enable(m_pControl!= NULL);
}
void CExampleView::OnEditDeleteolecontrol()
{
// TODO: Add your command handler code here
// Your code ...
// Change menu item (Delete OLE Object -> Insert OLE Object )
CMenu *menu;
menu = AfxGetApp()->m_pMainWnd->GetMenu()->GetSubMenu(1);
menu->ModifyMenu(ID_EDIT_DELETEOLECONTROL, MF_BYCOMMAND, ID_EDIT_INSERTOLECONTROL, "&Insert OLE Control...");
}
I didn't write it myself I got it from this website http://cui.unige.ch/OSG/people/Past/fuentes/Mfc/mfc.html
Well... I am a beginner ...
|
|
|
|
|
I am facing problem with GDI+ bitmap memory deallocation.
delete of the the bitmap doesn't release the memory it gets accumulated and it doesn't free up the memory until i close my application.
And i end up in virtual memory problem since it eats up all the memory and crashes my application.
Please suggest a scenario where in i can delete my bitmap pointers memory and run my applicaiton without any problem.
Thanks in Advance.
|
|
|
|
|
No. You can intercept them, so as to redirect them to your app, but you can't do anything to the message itself.
~RaGE();
|
|
|
|
|
Rage wrote:
but you can't do anything to the message itself.
Almost. a WH_GETMESSAGE hook can modify the message, but not delete it.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
A WH_MSGFILTER hook can delete messages as well as modify them.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yes you can, by installing a WH_MSGFILTER hook, but it slows down the system quite a lot, and shouldn't be done unless necessary.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
The WH_MSGFILTER hook can be either thread-specific or system-wide, but only for threads in the same process as the thread that set the hook, so it's not a true system-wide hook. To get true system-wide behaviour, use the WH_SYSMSGFILTER hook.
Are the two windows in your process or in another process? If they're in your process, a much easier solution would be to subclass the windows.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
In that case, it will be much easier to subclass them and override OnActivate() and make it do nothing. It will also be a lot nicer to the system
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Coming from a Turbo Pascal / Turbo C++ background, I miss the good 'ole days of having complete control over a console screen using the conio.h libraries.
I have discovered that I can mimic certain functions using the platform SDK (changing colours etc), but does anyone know of where I can get some more information on using these functions more effectively? Or even if there are any (free) libraries that are compatible with VS6 that I can use.
I have tried a search on CP, but to no avail.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
Are you talking about the console functions?
|
|
|
|
|
DavidCrow wrote:
Are you talking about the console functions?
I am.
But specifically all those very useful functions that were available, like GotoXY(), ClrScr(), etc.
I'm asking for some sort of document that explains, at least, how to achieve the equilavent results.
The MSDN documentation on the console functions, personally, does not have enough practical examples and usage.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
The equivalent of GotoXY() would most likely be SetConsoleCursorPosition(). Clearing the screen can be done with FillConsoleOutputCharacter().
|
|
|
|
|
Have a look a Mike Dunn's C++ FAQ which answers these questions and more.
http://www.codeproject.org/cpp/cppforumfaq.asp#cons_gotoxy[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Ah Ha!!!
That's what I needed.
I knew I was a dumbass, but I never bothered to comfirm it.
Cheers.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
Hi !
In my MDI app with A CSCrollview, I handle the SETCURSOR message to get the cursor changed. However, I'd like to have the normal arrow back when the user wants to use the scrollbar (that is, the cursor should take its original shape when it is hovering the scrollbar, and take my custom shape everywhere else in the scrollview).
What's the best way to achieve that ?
~RaGE();
|
|
|
|
|
BOOL CMyView::OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message)
{
if(nHitTest == HTCLIENT)
else
return CScrollView::OnSetCursor(pWnd, nHitTest, message);
}
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Great ! Thanks !
~RaGE();
|
|
|
|
|
You're welcome
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
I wanted to convert my MDI app to SDI without having to start a new project. Is this possible for me to do without having to restart my project over and using app wizard?
thanks in advance.
|
|
|
|