|
Very cool...Thanks alot
Happy new years! (in about 6 morre hours)
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Quick question
Why does the following not work?
BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;
switch(pnmv->hdr.code){
case LVN_MARQUEEBEGIN: break;
return TRUE;
}
return CListCtrl::OnNotify(wParam, lParam, pResult);
}
Thanks again
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
You have the break in the wrong place
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Shite...I didn't even see that...
Thanks again!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
I have a class, named MyListCtrl which is inherited from CListCtrl. Why I didn't get LVN_MARQUEEBEGIN notification in MyListCtrl::OnNotify() when clicking and dragging???
|
|
|
|
|
Hi,
i'm new to vc++ and mfc, and i used to program in visual basic but i decided to try vc++ to make more powerful apps. anyways, when i tried to make a dialog, i found how restrictive the ui styles were in vc++, and only a few properties can be changed unlike vb which you can change almost anything. for example you can't change the dialog background color in vc++ and you could in vb.
anyways, i'm wondering how you guys deal with this problem. are there any simple solutions to making a better ui, like adding certain commands in the code?
thanks.
|
|
|
|
|
jc00 wrote:
for example you can't change the dialog background color in vc++ and you could in vb.
Who said....We can do anything using VC++..changing Background colour is just nothing...Just overide WM_CTLCOLOR method in the dialog...
jc00 wrote:
anyways, i'm wondering how you guys deal with this problem
Just read Good Books...
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
All of those things can be done in VC, it's just a different process, and requires learning some API's, many of whose names are duplicated/similar in VB. In fact, you'll find that VC probably gives you GREATER control over the UI, not limited control. You're just new to it and possibly expected it to be more straightforward. Things are more cryptic to learn in VC, but once you understand the framework, you can create powerful apps in VC as quickly as you can in VB. (my opinion).
Paul
|
|
|
|
|
The easiest way to change dialog background colors is to call SetDialogBkColor() in your CWinApp::InitInstance()
However this is the least flexible solution, if memory serves me correctly this changes all dialogs in your application. There are other alternatives which are almost as easy to accomlish:
1) WM_CTLCOLORDLG like the fellow before me suggested
2) WM_PAINT
3) WM_ERASEBKGND
Only these require handling messages, instead of simple function calls like the above. I think VB basically wraps windows messages with Event handler functions, much like MFC does, but in MFC terminology there usually refered(spelling) to as virtual class member functions.
MFC Classwizard will easily let you map WM_PAINT to a member function called OnPaint(). It's been a long while since I programmed in VB, but i think it's equivelant was Form_Paint()
All in all VB hides alot of details from YOU the programmer.
Cheers!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Thanks everyone. The background color changes perfectly, but changing the font in only certain parts of the dialog seems to be a big deal, especially after seeing people create HTML parser classes just for it.
Are there any good online sources that will teach me about the API functions and more about vc++ code?
thanks and happy new year.
|
|
|
|
|
I have inserted the splash Screen and status bar component in my Project . How can i remove them and then insert new components in thier place..
Do reply.. soon
Samir Sood
|
|
|
|
|
I really dunno whats the big deal in it..
As u placed them previously...put the new components....
I really dunoo what u exactly wanted....
Can u be more clearer.....
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Delete the files the dialog splsh screen is declared and defined in and then remove the *.h and *.CPP files from your project
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
dear all,
i have an mfc app which starts a thread and executes exe files in the thread at specified times using CreateProcess(...) function.
i use TerminateProcess() to terminate those processes.
Everything is working fine.
i know that ExitProcess() is a better way to terminate a proceess, but when i use
ExitProcess(GetLastError()); the processes do not terminate.
how do i terminate my processes using ExitProcess()?
is it safe to use TerminateProcess() b'coz its seems to be working fine.
thanx
Happy New Year.
|
|
|
|
|
|
TerminateProcess will just kill the process abruptly. If this is not a problem for the processes you're creating, then fine. However, if you need to end these processes gracefully, then you need to communicate with them that it's time to exit.
ExitProcess only works for the current process so you need to find another route. One way is like Norm suggested: send a message to the main window to destroy itself (PostQuitMessage). Another is for those processes to monitor a shared memory variable or perhaps a file and exit when a certain condition is met.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
in a chat program i'm playing with, i have a buddy list that gets filled from the servers data sent to it, shows online , offline, all the good stuff, when i try to clear the list, i can't, and tried with both, a listctrl and listbox... if i call the ClearList(); in the function with the add things, it'll clear it, but not later
is focus going somewhere and staying there? please shed a little light for me.
thanks in advance.
shotgun
|
|
|
|
|
I am writing a simple web browser for the Pocket PC running Win CE 3.0 (I am no expert programmer!). I have a display problem. Images i create in MS Paint displays perfectly, but I have to display a processed image created in Visual Studio 6. However, the image is all distorted when I try to display the processed one vs. the paint ones. All images are bitmaps. Has anyone encounterd this before or knows what the issue maybe? Thank you.
sparky
|
|
|
|
|
i want to set at the frount (that window area should not be covered by any other window ) all thoes windows that are apperaing on the desktop one by one.but i could not successed.
i am using this code but could not get success.
is there any mistake or any other logic to do that plz help.
EnumDesktopWindows(NULL,cbEnumWindows1,(LPARAM)( &EnumParam ) );
EnumWindows( cbEnumWindows1, (LPARAM)( &EnumParam ) );
BringWindowToTop(ch_Hwnd);
ShowWindowAsync (ch_Hwnd,SW_SHOWNORMAL);
ShowWindowAsync(ch_Hwnd,SW_SHOWNORMAL);
ShowWindowAsync(ch_Hwnd,SW_RESTORE);
ShowWindowAsync(ch_Hwnd,SW_SHOWNORMAL);
ShowWindowAsync(ch_Hwnd,SW_SHOW);
SetForegroundWindow(ch_Hwnd);
::SendMessage(ch_Hwnd,WM_PAINT,(WPARAM )0,(LPARAM)0);
::SendMessage(ch_Hwnd,SW_OTHERUNZOOM,(WPARAM )true,(LPARAM)SW_OTHERUNZOOM);
r00d0034@yahoo.com
|
|
|
|
|
Hi guys,
The first call to LoadString() in my app fails because AfxGetResourceHandle() returns NULL. I found that this is because in it called in my app object's InitInstance(). Seems that the resources haven't been loaded yet or something like that. Anyone know how to fix this? Moving the code to later in the initialization does not appear to be a solution...
Thanks in advance,
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Is this an MFC program? I put these lines at the very beginning of the InitInstance function and it worked ok.
CString something;
int x = something.LoadString(ID_FILE_SAVE_AS);
MessageBox(NULL,something,"",MB_OK);
also tried this and it worked too
char buf[255];
int x = LoadString(AfxGetInstanceHandle(), ID_FILE_SAVE_AS, buf, sizeof(buf));
MessageBox(NULL,buf,"",MB_OK);
|
|
|
|
|
Yeah, I'm not sure what happened here. It started working again --- must have been some weird compiler glitch or something... ?
Thanks though!
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Edits on focus calls up a dialog for entering a number, all works fine except when you CANCEL.
So I have created a cancel button:
void CNumberEntry::OnCancel()
{
CDialog::OnCancel();
idigit = 0;
sRangevalue = " ";
UpdateData(false);
EndDialog(2);
}
But after this the dialog won't pop up?
Any ideas?
Thanks.
}
|
|
|
|
|
This is some strange code.
1. What is sRangeValue and idigit? (And why don't you use the m_ prefix convention for member variables?)
2. Do you realize that CDialog::OnCancel already calls EndDialog?
3. Why do you call UpdateData(false)?
4. Does it work fine for OnOK? If so, could you post the code for OnOK?
6. Could you post the code that pops up your CNumberEntry dialog box?
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
These aren't member variables. The number entry code as posted is used as a soft keyboard. So I have to retain values as they are input so I can allow other functions such as clear and delete to remove characters.
I believe that the only reason I had to write my own cancel function is that some how I delete the OnCancel or it just wasn't working and I don't know how to get the original code back.
The OnOK function does work fine as it returns and the values are there. I don't do anything with this function in CNumberEntry as it just returns and I set the new values.
I don't know why I have the UpdateData(false)...I've tried so many thing and it has just hung around.
if(GetNumDlg.DoModal()== OnOK)
{
//number returned is sent to the host computer for update...
}
Thanks for taking the time to look at this.
Jim
|
|
|
|