|
On Windows XP Professional SP1 -FOR CERTAIN- the lParam is merely a number - the session ID. Several General Protection Faults will prove this to you.
I think the WTSSESSION_NOTIFICATION structure is passed to the HandlerEx routine in a Windows service application (have not tried that one yet...)
The wParam lets you know what is happening, and the lParam identifies the session ID.
You can use the session id in call to WTSQuerySessionInformation to get more details for a specific session identifier.
I am currently trying to get Microsoft to document specific recommendations for applications to follow in response to each of these messages. More specific than 'avoid anything troublesome'...
|
|
|
|
|
<--- dummy
I want to add the capability to connect via dial up PPP to my code.. (like MS DUN)... except I have no idea where to start. Any ideas fellas.. or anyone know of any source code sample I can peruse?
Ok.. come on you smart bastards.. help on Aussie wanker out here will ya!
Aus
|
|
|
|
|
Look at the msdn.microsoft.com for something called RASDIAL-something... Type RASDIAL and search for it.
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
Great!.. That has given me a start.. thanks mate. Have a good one.
Aus
Aus
|
|
|
|
|
You can get a good class for ras from Dundas, or use the RasApi. Look for the fuctions RasDial into Remote Access Service Functions
Best Reagars.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thanks mate.. appreciate it!!
Aus
Aus
|
|
|
|
|
Get the free RAS class library from Dundas Software.
This class library should do everything you need for your dialup. Plus it comes with complete source code. This class library is part of the Dundas TCP/IP product line, but was made available for free to help promote the product line.
Just to to www.dundas.com
Troy
|
|
|
|
|
Hi Chaps,
Anyone got any drag & drop code examples?
having a bit of trouble with the leftbuttonup function and the HitTest() not working properly
I did this:
void CRunEICDlg::OnLButtonUp(UINT nFlags, CPoint point)
{
if( m_bDragging )
{
ASSERT(m_pimagelist != NULL);
m_pimagelist->EndDrag();
CImageList* pTemp = m_pimagelist;
m_pimagelist = NULL;
delete pTemp;
ReleaseCapture();
m_bDragging = false;
}
// CPoint point;
// GetCursorPos( &point );
m_cTestSeq.ClientToScreen( &point );
UINT flags;
int item;
item = m_cTestSeq.HitTest( point, &flags );
item = item;
if( LVHT_NOWHERE | flags )
{
// add to end
item = item;
}
else if( LVHT_ONITEM | flags )
{
// insert before the item
item = item;
}
// }
CDialog::OnLButtonUp(nFlags, point);
}
But it doesnt recognise when the leftbutton was let go in the listControl window
any comments greatfully received
The Wudan Master
|
|
|
|
|
|
I am updating a list control with several operations, including deleting some entries and adding others. Due to the speed at which the new entries must be made, I have found that I need to do a SetDraw(FALSE) prior to adding and removing the entries to ensure that all of the time critical messages that are the basis of the entries are entered and none are missed. Although I am now catching all of the messages, I now find that the list control constantly flickers irritatingly. Is there a way to prevent this flickering? Any ideas are appreciated.
Thanks.
|
|
|
|
|
What messages are you catching? What does it have in common with blocking the redraws of list control?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
The messages are from a queue that is being populated by a program that is external to my application. Essentially, the program is on a network and maintains its own queue of the messages that are being sent on the network. When a message is processed, it is removed from the queue. My application taps into the queue and dumps each entry one-by-one into the list control. Since my app maintains a max size for the list control, when an entry is added to the list control, if it is at the max size, it will first delete the oldest entry and then add the new entry. The reason for the SetRedraw was that the list control was being redrawn both after the delete and the add. The messages in the other application are so quick that my app was missing messages because of this extra redraw.
Now, I no longer miss the messages, but the screen flickers. Any ideas?
|
|
|
|
|
Maybe you should switch into virtual list mode (LVS_OWNERDATA style) - you'd keep the strings in your own data structures and list would notify you that it needs repainting. You could even move message retrieval/storing into separate thread.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I currently have the message retrieval in a separate thread. I have reservations about changing the structures being used; the application currently works and has gone through the testing process and a structural change would mean more retesting time than is allotted for the project.
If you know of any other way, I would really appreciate it. I was kinda hoping that you would tell me about the little known "StopFlickering()" method.;)
Thanks a lot.
|
|
|
|
|
I'm trying to draw the caption of a dialog myself, but windows keeps painting the button on the caption bar.
Kilowatt said I had to put SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); in the WM_NCACTIVATE handler, but adding that doesn't work with me.
Probably I made a stupid mistake somewhere, or I forgot some obvious code, but simply adding the above code doesn't do anything at all. (SetWindowLong returns 0, when hDlg == m_hDlg)
[edit]
I forgot to mention that I return TRUE in WM_NCACTIVATE
[/edit]
What can I possibly be doing wrong, please help me.
Thanks a lot in advance!
|
|
|
|
|
What are you using to develop your code? MFC, SDK, WTL I will post an example.
Also, what exactly are you trying to accomplish, do you want to custom color the caption with different text and whatnot.
Are you trying to custom draw the buttons in the corner?
|
|
|
|
|
An example would be great! thanks!
I'm using MFC, I need to change the hight of the caption, and therefore I need to paint it myself. Also I'm thinking about moving/drawing the buttons, but that's not as important.
I think that covers about it, and again thanks.
|
|
|
|
|
See this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I read that article, but it didn't help me...
Only the caption of a CView is modified in that example, it's a bit different for a CDialog.
Thanks anyway
|
|
|
|
|
I do not have very much time, so here is a code snippet from a WTL dialog example, you should be able to simply translate teh code to MFC. This will not repaint any custom parts, however it will prevent any portion of the borders and caption from being painted.
LRESULT OnNCActivate(UINT , WPARAM , LPARAM , BOOL& )
{
::SetWindowLong(m_hWnd, DWL_MSGRESULT, FALSE);
return TRUE;
}
LRESULT OnNCPaint(UINT , WPARAM , LPARAM , BOOL& )
{
return TRUE;
}
|
|
|
|
|
Thanks for your reply.
I translated this part to mfc, with this as result:
LRESULT CAnothertestDlg::OnNCPaint(WPARAM wParam, LPARAM lParam)
{
::SetWindowLong(m_hWnd, DWL_MSGRESULT, FALSE);
return TRUE;
}
LRESULT CAnothertestDlg::OnNCActivate(WPARAM wParam, LPARAM lParam)
{
return TRUE;
}
This is pretty much the same as what you told me before and I still don't get it working.
I'm getting pretty desperate to get this working....
|
|
|
|
|
You have the examples backwards. it should be like this.
LRESULT CAnothertestDlg::OnNCPaint(WPARAM wParam, LPARAM lParam)
{
return TRUE;
}
LRESULT CAnothertestDlg::OnNCActivate(WPARAM wParam, LPARAM lParam)
{
::SetWindowLong(m_hWnd, DWL_MSGRESULT, FALSE);
return TRUE;
}
please run this and let me know what you see. You should see a window where the borders and caption never get painted. The minimize and maximize buttons will however still be painted.
By the way, the custom caption article that somebody else posted loks pretty good, teh key to making this work in the dialog is the SetWindowLong call in WM_NCACTIVATE.
|
|
|
|
|
Sorry, that was a typo, I compiled it with SetWindowLong in the other handler.
The SetWindowLong line doesn't make a difference, nothing happens at all. (at least nothing directly visual) Even without the SetWindowLong call the borders of the NC area aren't painted at all.
The border doesn't get painted, but that didn't happen in the first place, my problem was that not only the buttons were painted, but a small area around the buttons too, and there is a line drawn that seperates the client and the non-client area.
If I don't make a handler to NCACTIVATE at all windows paints the NC area as soon as it looses focus, otherwise not.
Maybe I didn't make myself entirely clear, but I would like windows to paint nothing at all outside of the client area, as windows refuses to draw the button without background.
Heh, this isn't as easy as I thought it would be, even explaining a simple problem can be quite hard.
|
|
|
|
|
Hi,
What is my trouble?
I would like to make ActiveX componet with more controls.
Something like child dialog - usable like ActiveX.
(like Calender in Windows) = one ActiveX,
for example with few Buttons, some Edits and so on.
(I don't need to resize it, just put it on some place.)
I am not ActiveX expert, and I don't know how to start...
Does anybody know how to start or some nice sample what should help me?
(Visual C++ and MFC will be welcome.
Thank you.
Viliam
|
|
|
|
|
The ATL appwizard will allow you to create a composite control.
I'm not sure if it supports MFC though.
Michael
|
|
|
|