|
There is no WM_ message with a value of 40,000!
So if your app is receiving it then it must be from a RegisterWIndowMessage call somehwre in your code.
Roger Allen
Sonork 100.10016
yet to be identified being from the planet Paltinmoriumbanfrettybooter
|
|
|
|
|
|
Hi,
How do i secure my System Tray
I mean to say that no user should be able to
tamper or even click on my system Tray
Anything - direct or inderect method would do
Sameer
|
|
|
|
|
Unplug your mouse
(2b || !2b)
|
|
|
|
|
James Pullicino wrote:
Unplug your mouse
Won't help, you can access it using the keyboard.
Perhaps it's better to not allow users to log on to that machine at all, or to install some OS that doesn't have a "tray"?
|
|
|
|
|
I was wondering if Nish, who says has started most threads on CP forums, will be the one to post message no. 40000 on this forum.
Best regards,
Alexandru Savescu
|
|
|
|
|
I just told him
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
I just told him
Thanks for that James.
Though I was too late.
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Alexandru Savescu wrote:
I was wondering if Nish, who says has started most threads on CP forums, will be the one to post message no. 40000 on this forum.
Too late Alexandru, too late. Thanks anyway.
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Never mind Nish.
I am confident that you will be the one to post message no. 50000 and also no. 100000, messages that will have a bigger impact on this forum.;)
Best regards,
Alexandru Savescu
|
|
|
|
|
Alexandru Savescu wrote:
I am confident that you will be the one to post message no. 50000 and also no. 100000, messages that will have a bigger impact on this forum.
Thanks for your kind words Alexandru
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
What is the easiest way to change the font in every control on your dialog and the dialog itself?
|
|
|
|
|
Here ya have an example (but in Win32 API):
// create a static control
HWND text = ::CreateWindow("Static", "My title", WS_CHILD | WS_VISIBLE |
SS_CENTER | SS_NOTIFY, 10,115, 355,40, firstclass2, (HMENU)ID_STATIC, hInstance,NULL);
Create a font (Arial)
HFONT font2 = ::CreateFont(38, 0, 0, 0, FW_BOLD, TRUE, 0, 0, 0, 0, 0, 0, 0, "Arial");
// Put it on the static control
::SendDlgItemMessage(wndParent, ID_STATIC, WM_SETFONT, (WPARAM)font2, 0L);
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
or trap the OnCtlColor() message and set your font(s) there for all or each control
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
Then you'd either be setting every control each time its invalidated or you'd have to keep track of a variable to know that it's already been done. Why not in OnInitDialog since by definition it's a one-initialization task?
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
1) In the dialog's header file declare a CFont object:
CFont m_font;
2) In the dialog's c'tor inititialize the font:
LOGFONT lf;
memset(&lf, 0, sizeof LOGFONT);
lf.lfHeight = PointSizeToHeight( 8, dcClient.m_hDC );
lf.lfWeight = FW_NORMAL;
strcpy(lf.lfFaceName, "MS Sans Serif");
lf.lfWeight = FW_BOLD;
int bStat = m_font.CreateFontIndirect(&lf);
if (!bStat)
{
TRACE("Failed to create m_font.\n");
ASSERT(bStat);
}
3) Here is the PointSizeToHeight helper function:
int PointSizeToHeight( int iPointSize, HDC hDC )
{
int iRetVal = 0;
ASSERT(hDC != NULL);
if (hDC != NULL)
{
iRetVal = -(MulDiv(iPointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72));
}
return (iRetVal);
}
4) In the OnInitDialog, cycle through the dialog's controls, setting the font of each control:
CWnd* pChildWnd = NULL;
pChildWnd = GetTopWindow();
while(pChildWnd != NULL)
{
pChildWnd->SetFont(&m_font);
pChildWnd = pChildWnd->GetNextWindow(GW_HWNDNEXT);
}
That should do it.
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
I have tried searching MSDN, google, codeproject, codeguru, and #winprog and haven't found a solution. Hopefully someone here can help me.
I'm implementing accelerators (hotkeys) in my MFC dialog based app.
BOOL CKRipperApp::ProcessMessageFilter(int code, LPMSG lpMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (code < 0)
CWinApp::ProcessMessageFilter(code, lpMsg);
if(m_haccel)
{
if (::TranslateAccelerator(m_pMainWnd->m_hWnd, m_haccel, lpMsg))
return(TRUE);
}
return CWinApp::ProcessMessageFilter(code, lpMsg);
}
This works great, unless I've set up an accelerator as Ctrl+O or Ctrl+X or some commonly used hotkey... which I have. I have a browser control and under the "Navigate" menu, I have a "&Open Url" choice with Ctrl+O as the hotkey. This will not work!!! Why not?
Please someone help me!
thundercatzlair
|
|
|
|
|
The Browser is an ActiveX Control and any hotkeys are
directly processed by it, but if you want to trap them
you can implement the ISimpleFrameSite and then
trap the messages in ISimpleFrameSite::PreMessageFilter.
|
|
|
|
|
I guess I don't understand how the browser control will intercept something like Ctrl+O because on my dialog I have a tab control with about 5 tabs and only on the first tab do I have a browser control. Even when I'm not currently on the first tab, the Ctrl+O still doesn't work.
If you think the browser control would still intercept those keystrokes, could you explain how to implement the ISimpleFrameSite?
thanks,
thundercatzlair
|
|
|
|
|
Dear All,
In a application i have use CRectTracker to draw
a rectangle. It worked but the drawed rectangle
cannot be seen. The following is the code:
CRect re;
CRectTracker rt(re, CRectTracker::solidLine | CRectTracker::resizeOutside);
if(rt.TrackRubberBand(&m_viewc, pt, FALSE))
{
do something;
}
I really want to see the rectangle.
What is my mistake?
Thanks in advance!
xyz
|
|
|
|
|
You haven't set up the CRect object that you are passing to the CRectTracker constructor. You need to define the starting x,y and the x,y size in that object. For example, if you create a dialog-based app to test and then put the following code in the OnOK handler, the rectangle will definitely show up where it's supposed to.
CRect re(10,10,50,50);
CPoint pt(50,50);
CRectTracker rt(re, CRectTracker::solidLine | CRectTracker::resizeOutside);
if (rt.TrackRubberBand(this, pt, TRUE))
{
}
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Thanks for your reply!
In fact, the size of rectangle is determined by
mouse movement, and the above code is embeded in the
LButtonDown function.
I really want to know if the rectangle must be drawn.
Best Regards,
xyz
|
|
|
|
|
No. The CRectTracker does all that for you. Here's all I added to a dialog's LBUTTONDOWN handler:
void CRectTrackerDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
CRect re(point, point);
CRectTracker rt(re, CRectTracker::solidLine | CRectTracker::resizeOutside);
rt.TrackRubberBand(this, point, TRUE);
CDialog::OnLButtonDown(nFlags, point);
}
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
It's not works yet.
This is my code:
PreTranslate(MSG *pMsg)
{
switch(pMsg->message)
Case WM_LBUTTONDOWN:
CPoint pt;
pt.x = GET_X_LPARAM(pMsg->lParam);
pt.y = GET_Y_LPARAM(pMsg->lParam);
CRect re;
CRectTracker rt(re, CRectTracker::solidLine | CRectTracker::resizeOutside);
if(rt.TrackRubberBand(&m_viewc, pt, TURE))
{
do something;
}
}
xyz
|
|
|
|
|
The code I sent you definitely works if you put it in an LBUTTONDOWN handler. However, even if you're using PreTranslateMsg (why?) the following will work as well:
switch (pMsg->message)
{
case WM_LBUTTONDOWN:
{
CPoint pt;
pt.x = GET_X_LPARAM(pMsg->lParam);
pt.y = GET_Y_LPARAM(pMsg->lParam);
CRect re(pt, pt);
CRectTracker rt(re, CRectTracker::solidLine | CRectTracker::resizeOutside);
rt.TrackRubberBand(this, pt, TRUE);
}
break;
default: break;
}
return CDialog::PreTranslateMessage(pMsg);
}
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|