|
According to MSDN It needs to be passed as a WM_NOTIFY message.
I recommend that you avoid this complication and simply put the code for your SELCHANGE in a separate place that's easy to call, like inside a separate function or perhaps your own message. Then you can just call that directly from the WM_INITDIALOG logic.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
That is what I actually did, I have reproduced the code for the first tab but I thought maybe it would be better logic to write the code once and then just send the message. Why do you think that it is better this way?
|
|
|
|
|
I am trying to make a little utility, that will delete from workstations an old network printer connection, add new one and set it as the default printer. I am using NT4.0.
To be able to set the default printer, I need to know the port name. When I use PRINTER_INFO_2, I get the IP-address like "123.32.12.89:XJPRINT". I got the same using PORT_INFO.
I would need to know the "weird" NExx: port name. Like currently my default printer is in port NE04.
I can find in the registry a list of my printers (e.g. \\SERVER01\HP4100 -> "winspool,Ne04:,15,45"), but is there an another way to get that "Ne04" information??
Ps. Whatta heck is that NExx: for??? Compatibility issue with older windows versions?
------------------------------------------
Experience is the name every one gives to their mistakes.
-- Oscar Wilde
Experience is one thing you can't get for nothing.
-- Oscar Wilde
|
|
|
|
|
..and so I digged the registry.
(just talking to myself)
------------------------------------------
Experience is the name every one gives to their mistakes.
-- Oscar Wilde
Experience is one thing you can't get for nothing.
-- Oscar Wilde
|
|
|
|
|
The world of drivers... abandon all hope, ye who enter!
Even a broken clock is right twice a day.
|
|
|
|
|
hi there,
I have a dialog and in it i have a button on which I want to send mail to a particular person. It just has the email address like someone@someone.com. when i click on it I want this E-mail to be entered into outlook's To address field. How can i do so. My guess was that there should be some function or methind doing so but could not find any. Can Anyone please help..thanks in advance
Himanshu
|
|
|
|
|
Use ShellExecute with the third parameter set to "mailto:someone@someone.com". This will use the default e-mail sender which you have chosen for yourself, either Hotmail, Outlook, etc...
|
|
|
|
|
Hi,
thanks for your help..but i dould not understand how to use it can you quote and example. here i see shellexecute as
HINSTANCE ShellExecute( HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
there are few parameters i don't know.
thanks in advance.
himanshu
|
|
|
|
|
thanks for your help i did it with the same.
thanks a lot..
cheers..
Himanshu
|
|
|
|
|
Hi!
I have to get the free space of a Network Ressource (shared folder). I used Windows 2000 all the time, but MSDN says, that the source depends on the OS. So for Windows XP it should be different.
<br />
NETRESOURCE NR;<br />
ZeroMemory(&NR, sizeof(NR));<br />
NR.dwType = RESOURCETYPE_DISK;<br />
NR.lpLocalName = "N:";<br />
NR.lpRemoteName = "\\\\MICHAEL-COMPUTER1\\NetShare";<br />
DWORD Res = WNetAddConnection2(&NR, NULL, NULL, 0);<br />
<br />
unsigned long secPerCluster;<br />
unsigned long bytesPerSector;<br />
unsigned long freeClusters;<br />
unsigned long totalClusters;<br />
int space_remaining;<br />
<br />
GetDiskFreeSpace("N:\\", &secPerCluster, &bytesPerSector,&freeClusters, &totalClusters );<br />
<br />
space_remaining = secPerCluster * bytesPerSector * (freeClusters/1000) ;<br />
<br />
CString str;<br />
str.Format("%i",space_remaining);<br />
AfxMessageBox(str);<br />
I read the whole MSDN article - but
Thanks!!!
mfg mike
PS: Sorry for my bad English
|
|
|
|
|
Is there any easy way to prevent the selection rectangle from following my mouse when clicking and dragging on the CListCtrl ?
Without having to use OwnerDrawor CustomDraw???
Thanks!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Add the LVS_SINGLESEL style to the control.
--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
|
|
|
|
|
Thats the catch. I need multiple selection. CustomDraw or OwnerDraw, will that work?
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Hockey wrote:
Thats the catch. I need multiple selection
Ah, in that case handle the LVN_MARQUEEBEGIN notification and return TRUE to cancel the marquee.
--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
|
|
|
|
|
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
|
|
|
|