|
Like CPallini said:
EnumChildWindows(hwndDlg, EnumChildProc, 0);
...
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
{
...do something with hwnd, a handle to a child window of hwndDlg...
return TRUE;
}
*EDIT* Return a value from EnumChildProc()
|
|
|
|
|
Raj Gopal wrote: so plz give me solution to get the handle of all controls in a dialog
Mark Salsbery already did. Anyway have a look also there [^] where a similar request has been posted.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Raj Gopal wrote: s thr ny way of enumeration for this? plz provide me some sort of example.
try this simple api GetNextDlgTabItem
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
if you want to get handle of all controls on a forum you can use of
CWnd *pwnd2;pWnd2 = GetTopWindow(); and on a loop use of pWnd2 =pWnd2 ->GetNextWindow();
|
|
|
|
|
hello all:
i want to run a avi files by a vc project.
there was problem, i want to rotate the radio by 180 degree,like a video in the water.
how can i do?
i need a good idea or some samples.
sorry for my poor english.
thanks in advance!
henry
-- modified at 2:11 Monday 4th December, 2006
|
|
|
|
|
|
can somebody tell me how to get object or resource id of all the controls by passing dilaog handle progrmatically.
|
|
|
|
|
You can use EnumChildWindows , calling, inside your callback function, GetDlgCtrlID .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
thank you.
actually i need an handle of all the controls in a dialog.
can you please send me an example illustrating EnumChildWindows();
i m sorry for posting the message twice.
|
|
|
|
|
CPallini wrote: EnumChildWindows, calling, inside your callback function, GetDlgCtrlID.
What about simple call to GetNextDlgTabItem!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
ThatsAlok wrote: What about simple call to GetNextDlgTabItem!
Does not work unless the control has the WS_TABSTOP set (I know, usually a control HAS this style set).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: Does not work unless the control has the WS_TABSTOP set (I know, usually a control HAS this style set).
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hello everyone
I want to learn how can I do this :
write a recursive function member level() for class template BST that determines the level in the BST at which a specified item is located .The root of the BST is at level 0 , its children are at level 1 , and so on
and this is the code for //--- Definition of search()
Code:
template <typename DataType>
bool BST<DataType>::search(const DataType & item) const
{
BST<DataType>::BinNodePointer locptr = myRoot;
bool found = false;
for (;;)
{
if (found || locptr == 0) break;
if (item < locptr->data) // descend left
locptr = locptr->left;
else if (locptr->data < item) // descend right
locptr = locptr->right;
else // item found
found = true;
}
return found;
}
Rooro
|
|
|
|
|
Hi all,
I am using CToolTipCtrl as follows:
m_ToolTip.AddTool(this,sToolTip,rc,1);
m_ToolTip.SetMaxTipWidth(MAX_PATH);
m_ToolTip.Activate(TRUE);
m_ToolTip.SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);
MSG msg;
msg.hwnd = m_hWnd;
msg.message = WM_MOUSEMOVE;
msg.wParam = 0;
msg.lParam = MAKELONG(point.x , point.y);
msg.time = 0;
msg.pt.x = point.x;
msg.pt.y = point.y;
m_ToolTip.RelayEvent(&msg);
the tool tip is shown 100% ok, but when i log on to this site:
http://news.sky.com/skynews/home[^]
the tool tip stops from working. i think there is a control on that site that does something to my tool tip.
what am i doing wrong?
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
How can I change font of dialog box programatically at runtime.
I tested OnSetFont() member function and SetFont method but failed.
Thanks
|
|
|
|
|
IMHO you have to propagate the WM_SETFONT message to dialog controls (that are dialog child windows). For instance, you can call (inside OnInitDialog )
EnumChildWindows(this->m_hWnd, MyFunc, (WPARAM)(HFONT)(*m_pFont));
where MyFunc is something like this:
BOOL CALLBACK MyFunc( HWND hwnd, LPARAM lParam )
{
HFONT hFont = (HFONT) lParam;
SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont , MAKELPARAM(TRUE, 0) );
return TRUE;
}
and m_pFont is a pointer to a CFont object.
hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thank you very much.
But it does not change size of the dialog!
I want that changes after setting a bigger font for example.
|
|
|
|
|
Hadi Dayvary wrote:
But it does not change size of the dialog!
I want that changes after setting a bigger font for example.
MoveWindow()
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
I have a propertyPage in which I have CEdits. I want to display text entred in thoses CEdits from another CDialog.
for example in my Page I enter in the CEdit m_edit1 the CString "myName" I want that I transmit this value to an CEdit of a CDialog m_CEdit.setWindowText(m_edit1)
so they recommanded me to add message handlers to controls of this page.
what does it means ? and how I use these message in this CDialog in which I want to receive the data from this propertyPage ?
thank's
|
|
|
|
|
for example:
<br />
<br />
COleDateTime my_Time;<br />
<br />
int i = 600;
<br />
If use this method:
<br />
my_Time.Format(0000, 00, 00, 0, 10, 0);<br />
that ok, but if i = 12345, or 54321, the convert should very difficulty.
I hope obtain a easy method.
Thanks!
|
|
|
|
|
Look at the equal operators; they take __time64_t. Convert your value to __time64_t and then assign it. (Look of _time64 for how to use this.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
hanlei0000000009 wrote: int i = 600; // I want to convert i to COleDateTime (ten minute), how to convert?
if i always will be Time in Minute then what about passing this :-
CTimeSpan timeSpan(1000); //time in second
j=timeSpan.GetHours();
k=timeSpan.GetMinutes();
l=timeSpan.GetSeconds();
COleDateTime oleDatetime;
COleDateTimeSpan spanTwo;
spanTwo.SetDateTimeSpan(timeSpan.GetDays(),//int nDay,
timeSpan.GetHours(),
timeSpan.GetMinutes(),
timeSpan.GetSeconds()) ;
oleDatetime.m_dt= spanTwo.m_span;
a = oleDatetime.GetHour();
b = oleDatetime.GetMinute();
c = oleDatetime.GetSecond();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
|
Hello everybody,
I am a newbie to C++ programming and I need to do some hex addition with VC++ and then output the result as ASCII.
Here is my problem:
hex1(5A 30 35 30 30) which is equal to decimal(387355848752), I want to add hex(100) to hex1, result is hex2(5A 30 35 31 30) equal to decimal(387355849008). This is exactly equal to adding 256 to the first decimal.
I know unsigned int data type can only support 4294967295 which is still not enough for my case, and I would like to know how to convert these hex to ASCII with VC++? (Help received! Thx)
Besides, I need to convert the output to ASCII string format, which is "Z0500" and "Z0510" respectively, how can I do that?
Your help is very much appreciated, thank you!
Here is the code with help from forum member, but my second question is not yet solve:
#include <iostream>
#include <atlstr.h>
#include <string.h>
#include <sstream>
#include <conio.h>
#include <ctype.h>
int main()
{
long long h;
long long h1 = 0x5A30353030LL;
long long h2 = 0x5A303F3F30LL;
long long h3 = 0x100LL;
CString Str;
unsigned char Write_Buff[1];
for (h=h1; h<=h2; h+=h3)
{
_tprintf_s(_T("%I64X\n"), h);
Write_Buff[0] = h;
Str.Format("0x0%x",Write_Buff[0]);
Sleep(10);
}
_getch();
}
|
|
|
|