|
|
Hi everybody!
I wrote a code to display a messagebox when WM_QUERYENDSESSION message is posted.This is the code i wrote!
bool CMainWnd::OnQueryEndSession()
{
MessageBox(NULL,"QueryEndSession message is posted",MB_OK);
}
Is this correct! I expected to get a messagebox when i wanted to logoff the system. But it didnt work!Is anything wrong with my code!If so,I humbly request you to respond me!
Thanks in advance!
Regards
Shalini
-- modified at 6:55 Friday 2nd March, 2007
|
|
|
|
|
ShaluMalu wrote: Is anything wrong with my code
No.
Are yo sure ON_WM_QUERYENDSESSION() is there is message map.
|
|
|
|
|
Hi All.
I have problem, in my program I use 4 thread and thay all use:
<br />
<br />
wchar_t* MyFolder(wchar_t* pSearch)<br />
{<br />
wchar_t Folder[2048]= {L'\0'};<br />
size_t n=0; <br />
<br />
wcscpy(Folder,pSearch);<br />
<br />
for(n=wcslen(Folder); n >= 0; n--)<br />
if(Folder[n] == L'\\')<br />
{<br />
Folder[n+1]=L'\0';<br />
break;<br />
}<br />
<br />
return Folder;<br />
}
this function, and wen I debug it, I olvais have problem to this function.
I think thare is one of two:
1) I have not much experience
2) I do some mistake [in threads or in this function].
can help?
|
|
|
|
|
Read about CCriticalSection on MSDN
Regards
Anil
|
|
|
|
|
david bagaturia wrote: wchar_t Folder[2048]= {L'\0'};
david bagaturia wrote: return Folder;
Folder goes out of scope when the function exits so you should not return a pointer to that memory. Allocate the memory using new() or allocate the buffer in the calling function and pass it to this function
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
As indicated by Josh, the problem is because, you are returning address of local object. Create it on heap, and return it.
david bagaturia wrote: for(n=wcslen(Folder); n >= 0; n--)
This is in fact very bad coding practice, It causes unnecessary multiple calls of a functions.
Modify it to,
size_t n =wcslen(Folder);
for(n; n >= 0; n--)
-- modified at 9:07 Friday 2nd March, 2007
|
|
|
|
|
prasad_som wrote: It causes unnecessary multiple calls of a functions.
Actually it doesn't. wcslen() is only called once.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
My Bad !
It was my oversight.
I thought, its comparing each time.
|
|
|
|
|
I want to give user some messages before closing the MDIchild window.
But I am not getting the WM_CLOSE message. I receive WM_DESTROY messsage.
How to get the WM_CLOSE message in MDIChild window.
Regards
Anil
|
|
|
|
|
_anil_ wrote: How to get the WM_CLOSE message in MDIChild window
Add handler for it.
Are you sure ON_WM_CLOSE() is there in message map ?
|
|
|
|
|
Yes ofcourse I have added.
Regards
Anil
|
|
|
|
|
Thenm, there should not be any problem.
|
|
|
|
|
How is the window being closed?
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hello,
I have been searching for this but can't find any answer. I would like my app to be able to handle left-click on popup menu (not menu items). Suppose my menu is:
Item 1
Popup > PopupItem1
PopupItem2
Item2
Everybody known how to handle left-click on Item1, Item2, PopupIem1 and PopupItem2. But how can one detect a left-click on the "Popup" item? Is this feasible with a regular CMenu instance?
Thanks!
|
|
|
|
|
Nicolas Bonamy wrote: Everybody known how to handle left-click on Item1, Item2, PopupIem1 and PopupItem2. But how can one detect a left-click on the "Popup" item? Is this feasible with a regular CMenu instance?
Hope I understood you!
This is from the documentation...
TPM_LEFTBUTTON If this flag is set, the user can select menu items with only the left mouse button.
TPM_RIGHTBUTTON If this flag is set, the user can select menu items with both the left and right mouse buttons.
|
|
|
|
|
No sorry this is not my point. This will not add a notification if the user clicks on the "Popup" item. This will only change the behavior when clicking on "real" menu items.
|
|
|
|
|
Hi.
In my application I have added a listbox on a dialog box. This list contain numbers of elements that user has to scroll so much to see all the contents.
I want to minimize the scrolling efforts of user and I want to provide auto scrolling to the list box. The elements of the list box should get scroll automatically when user movies the mouse pointer over scroll bars of the list.
How I can proceed to achieve this?
Thanks
Sameer Thakur
|
|
|
|
|
What would be the difference between an registered dll and a normal dll that doesn't have to be registered, would there be any performance differences?
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Assuming the DLL's are the same as far as their core code is concerned, No.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Yes the code would be the same ... Thanx for clearing that one up John.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: Yes the code would be the same ... Thanx for clearing that one up John.
Normal dll should be present in Exe Current Directory or environment path.. but no such compulsion with registered dll as it path is stored in registry
|
|
|
|
|
So that is the difference between the two? (in a nutshell)
Thanks for the response.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Hello,
I have a Dialog, where in I show some text and draw some images using DrawText() and Draw(..) functions respectively.
Now I need to introduce an IEControl on this dialog. I wish the IE control to behave as if, its the background of my dialog, i.e. when I draw text on my main dialog, some part of the text is present on the main dialog and some part of the text spills over the IE control(this behavior is desired.) however, I wish to show my text in the foreground and the IE control to be on the background.
However windows is not providing any APIs for definind Z-Order for a child window and the text out on the dialog.
Any pointers in this regard will be highly appreciated.
Thanks
Suyash
|
|
|
|
|
No, there's no Z-order for drawing on a window. It's up to you to make sure you draw on top
of whatever you want the text to be on top of.
I'm not sure what "IEControl" you are using so I'm not sure how you could potentially know when
it's appropriate to draw the text.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|