|
Hello, I would like to click the "OK" button of the window programmatically.
How can I do this if I know the ID of window and button.
Thanks & Regards,
Suman
-- modified at 3:07 Monday 19th February, 2007
|
|
|
|
|
Use WM_COMMAND .
SendMessage(hWnd,WM_COMMAND,(LPARAM)IDOK,0);
|
|
|
|
|
Hi prasad_som, where would one find a very good example of the SendMessage function, Explaining all of the commands that can be used and so on. I have looked on MSDN but the example they give is a bit crappy ...
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: Hi prasad_som, where would one find a very good example of the SendMessage function, Explaining all of the commands that can be used and so on
SendMessage is very generic function, can be used with all window messages.
It includes command messages.
So, you can see in documentation of messages(WM_SETTEXT etc.), how it can be used with SendMessage , how to send extra information etc.
Or something else you was looking for ?
|
|
|
|
|
No thank you, I'll dig around and see what I can find. But thnk you very much for the help and steering me into the right direction.
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Welcome !
|
|
|
|
|
Its easy it has four parameters SendMessage(Handle to window,Specifies message,WPARAM,LPARAM);.;)
Like this:
SendMessage(hWnd,WM_CLOSE,0,0);
|
|
|
|
|
See this[^] thread.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks a lot for great help from you both!!
Best Regards,
Suman
|
|
|
|
|
Hi,
I have created MSI package using VS 2005, but whenever i install the msi package it is asking for me where to install, but i want it to ask only at the first installation, if am installing second time it should not ask me, it should go to default folder which i have selected previously
Manjunath S
GESL
Bangalore
|
|
|
|
|
Hi,
I need to change the color of the CStatic text. How can i do that ?
Thanks
Bye
|
|
|
|
|
sakthimuthu wrote: I need to change the color of the CStatic text. How can i do that ?
See here[^].
|
|
|
|
|
Use OnCltColor .
HBRUSH CMylg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID() == IDC_STATIC)
{
pDC->SetTextColor(RGB(255, 34, 0));
pDC->SetBkMode(TRANSPARENT);
}
return hbr;
}
|
|
|
|
|
if i do so, I am getting error like,
"m_brush Undecalred Identifier"
How do i resolve this ?
Thanks
|
|
|
|
|
sakthimuthu wrote: "m_brush Undecalred Identifier"
You just delete that line.
That brush variable stands for backfground color for text, if you want different.
|
|
|
|
|
Where is m_brush on your code?
|
|
|
|
|
It was there, considered as member variable of dialog class. Refer MSDN example of OnCtlColor .
|
|
|
|
|
hi,
I have added this "OnCtrlColor" on my code. But, When i do debugging it the program control does not come to this "OnCtrlColor" fn.
Why ?
Can you help me ? Kindly
bye
|
|
|
|
|
Did you insert WM_CTLCOLOR of peroperty window to your project or insert OnCtrlColor to your code
|
|
|
|
|
Hi,
I have CMapStringToString object as a static member variable of a class and using it in static method of that class, but the linker doesn't recognise that object, can any one knows what's the problem?
Warm Regards,
Mushq
|
|
|
|
|
Probably you forgot to write its defintion. Static variables should be used this way,
class MyClass
{
static CMapStringToString obj;
};
CMapStringToString CDlg6Dlg::obj;
|
|
|
|
|
Thanks Prasad
prasad_som wrote: CMapStringToString CDlg6Dlg::obj;//this is needed, other wise linker will give error
but why it is necessary to redeclare that in cpp.
|
|
|
|
|
Its not redeclaration, its definition\initialization. And its by rule.
Read C++ documentation for static keyword.
|
|
|
|
|
hi all, i am coding a routine where i need to know about the status of network which got connected through cyberoam client. i need to get notification when cyberoam fails and connects.i have used IsNetworkAlive but cud able to get notification when the network is disabled or enabled but cudnt get when cyberoam disables or enables!!!!
plz help
regards and thanks in advance
sudhir
|
|
|
|
|
I'd written keyboard hook dll in MFC.
i am able to convert keys like "a" into any of the alphabets of 'b' to 'z'.
But when i am trying to assign it virtual key value of gujarati fonts i am not getting the things right can you help me what is wrong?
sdfggdsgdssdgdsfg
sdfgds
-- modified at 6:11 Monday 19th February, 2007
|
|
|
|