|
Now, i want to Set Focus for Edit Box in Dialog using PostMessage, then what will be the values of both?
|
|
|
|
|
Use the SetFocus() function for this.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In a dialog, use WM_NEXTDLGCTRL which automagically handles the subtleties in how dialogs handle focus. More from Raymond: Clickety[^]
|
|
|
|
|
You should use SetFocus API in this case as David said earlier.
If you see documentation for WM_SETFOCUS , it will tell you, what should be values passed, as wParam and lParam .
It applies to all windows messages.
|
|
|
|
|
I think you will find WPARAM is a WORD and LPARAM is a long. MSDN is right, they are generic parameters, what they mean changes according to what the message is. MSDN will tell you what they mean in each instance, you just need to find the help for the message you're after.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: I think you will find WPARAM is a WORD and LPARAM is a long.
And I thought I was old
WPARAM and LPARAM are both pointer size these days - UINT_PTR and LONG_PTR, respectively.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
where con i find example vc++ programs so that i can learn multithreading
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The best place to start is here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Dear frineds i ve created an exe project in MFC. now my problem is how to hide the dialog box during runtime?
is there anyway to do that? if so pls let me know.
thanks(in anticipation)
Malini Nair
|
|
|
|
|
this->ShowWindow(SW_HIDE);
|
|
|
|
|
Hi,
Does anyone knowes how can I obtain the virtual memory size of the process I'm running in?
Thanks,
|
|
|
|
|
How about VirtualQueryEx() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
hi all,
I have a series of JPEG file coming from a source. I have to create a MPEG file from the series of JPEG file, which can be played in Media Player. How can I do this. What algorith i have to use or else i have to use COM and ActiveX control for the same. Can u give any idea regarding this.
Thanks and Regards
Yudhisthira Attry
|
|
|
|
|
Unless you have an MPEG-1 encoder available, you'll need to understand MPEG-1 compression.
The MPEG Home Page[^]
Which part is giving you trouble?
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
hi,
I m not understanding how to start that. how to take JPEG for converting MPEG-1. which encoder i have to use and how i have to use. please help me.
i never did such type of programming.
thanks
Yudhisthira Attry
|
|
|
|
|
There's several steps involved - reading the jpeg, decompressing the jpeg, compressing the jpeg
in mpeg format, and writing the mpeg file.
Windows has ways to read/decompress the JPEGs no problem...
Converting video frames to MPEG-1 requires an encoder which you can find/buy from 3rd party
vendors or write your own if you can learn the specification (I gave you the link).
Windows doesn't include an MPEG-1 encoder due to licensing.
If you choose to not write your own encoder, a google search for "MPEG-1 encoder" may help.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Good morning, i want to send, for example a WM_LBUTTONDONW, to windows to simulate a mousehit.
windows should manage this message and send them to the correct window.
I tried this with
SendMessage (NULL, WM_LBUTTONDOWN, 0, MAKELPARAM(y, x));
but it does't works and with
SendMessage (HWND_BROADCAST, ...);
windos sends the message to all active programms.
can someone help me,
thanks
|
|
|
|
|
if you want simulate a click action in some place in screen its better to use the SendInput function than sending the WM_LB... messages.
nave
|
|
|
|
|
thx, i found also an other solution,
i send the message to that window, which i get with the funktion
HWND WindowFromPoint(POINT Point);
thx
|
|
|
|
|
Hi,
I want to get the background color of a property page (from its child). I have written the following code which works fine if the child is in a dialog but not for the property page
Here is my code (taken from //http://www.thescripts.com/forum/thread281595.html)
//methods in the child control
bool getColorMethod1()
{
bool bRet=false;
if (GetParent())
{
CDC* pParentDC=GetParent()->GetDC();
if (pParentDC)
{
HBRUSH hbrush;
hbrush =(HBRUSH) GetParent()->SendMessage(WM_CTLCOLORDLG,(WPARAM)pParentDC->m_hDC,(LPARAM) GetParent()->m_hWnd);
if (hbrush)
{
LOGBRUSH lb;
if ((BOOL)GetObject(hbrush, sizeof(lb), &lb))
{
if (BS_SOLID == lb.lbStyle)
{
m_clr = lb.lbColor;
bRet = true;
}
}
}
ReleaseDC(pParentDC);
}
}
return bRet;
}
bool getColorMethod2()
{
bool bRet=false;
CWnd *pParentWnd=GetParent();
if (pParentWnd)
{
CDC* pParentDC=GetParent()->GetDC();
if (pParentDC)
{
CDC memDC;
CBitmap memBitmap;
CBitmap* oldBmp;
CRect rc;
pParentWnd->GetClientRect(&rc);
memDC.CreateCompatibleDC(pParentDC);
memBitmap.CreateCompatibleBitmap(pParentDC,rc.Width(),rc.Height());
oldBmp=memDC.SelectObject(&memBitmap);
if (pParentWnd->SendMessage(WM_ERASEBKGND, (WPARAM)memDC.m_hDC, 0))
{
m_clr=memDC.GetPixel( 0, 0);
bRet=true;
}
memDC.SelectObject(oldBmp);
memBitmap.DeleteObject();
memDC.DeleteDC();
ReleaseDC(pParentDC);
}
}
return bRet;
}
None of the above methods are returning me the correct color for the control on the property page but they work fine on the dialog
So can any body pleeeeeeaaaaaaaaaase help
Thanks
|
|
|
|
|
I'm not sure, why this bunch of code is required for this.
Doesn't following code suffice.
CDC* pDc= GetParent()->GetDC();
COLORREF crBkgnd = pDc->GetBkColor();
ReleaseDC(pDc);
|
|
|
|
|
I have a legacy app that reads a lot of config settings from several Excel files.
The app reads the settings from Excel using OLE. I think it's slow.
Some ideas about the best way to speed up the reading ?
Excel is used because our customer asked for it (every sheet is a grid of values and it's an easy way for them to change the values)
|
|
|
|