|
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
what so funny!
ddd
|
|
|
|
|
Well you obviously have to capture the screen, the keyboard and mouse, so for the keyboard and mouse i would use some kind of windows hook
If you want it to run as in the remote desktop connection then it would simply been a couple of hooks, but if you want the local user to still have control then it gets a tad more complex
|
|
|
|
|
any article or the link that can guide me toward this. i mean api's to capture the screen and how to hook the key board and mouse.tt
ddd
|
|
|
|
|
Hi
I have the following code:
int x=100;
CString s;
s=x;
I need to put the number 100 in s how?
/\|-||\/|/\|)
|
|
|
|
|
itoa(number,char*,10);
CString cs;
cs=char;
V
|
|
|
|
|
Halawlaws wrote:
I need to put the number 100 in s how?
s.Format("%d",x);
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
u can use the CString function Format
CString s;
s.Format("%d",x);
"Don't forget to rate the solutions, if they help you.
|
|
|
|
|
This theoretical snippet of code would be within the PreHandleEvent function of my MSHTML EditDesigner object (IHTMLEventObj* pIEventObj is one of the parameters).
IHTMLDocument2* pDoc;<br />
IHTMLElement* pElem;<br />
IDispatch* pDisp;<br />
pIEventObj->get_srcElement(&pElem);
pElem->get_document(&pDisp);
OK, so I supposedly have a pointer to the Document. But what I don't understand is how do I then use that IDispatch pointer to invoke the methods available through the IHTMLDocument2 object?
Specifically, I'm trying to use the IHTMLDocument2 object's "elementFromPoint" method to retrieve IHTMLElement objects from specific points within the client area.
I'm clearly missing some cast that I need to do.
|
|
|
|
|
David Fleming wrote:
OK, so I supposedly have a pointer to the Document. But what I don't understand is how do I then use that IDispatch pointer to invoke the methods available through the IHTMLDocument2 object?
<br />
IDispatchPtr pDisp = this->GetHtmlDocument();<br />
IHTMLDocument2* pDoc; <br />
hr = pDisp->QueryInterface( __uuidof( IHTMLDocument2 ), (void**)&pDoc );<br />
Now you have an interface to the HTML document and then you can use elementFromPoint[^]
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Excellent. Thanks.
But now I have another question. What I'm trying to do is implement a HTMLEditDesigner and trap keyboard input in the TranslateAccelerator event. If the user is moving into an element that is "off limits", I want to cancel it.
The elementFromPoint() method is using the mouse coordinates (which I did not realize upon reading it, but... duh!). My question is: let's say the user is on a line below a restricted line and presses the up arrow key (thus moving into a restricted area -- or at least attempting to); I trap the keydown event in the TranslateAccelerator callback, but it seems to me that the element I get (using pIEventObj->getSrcElement) always has BODY as the tag (using pElement->getTagName), even if the cursor is moving into a BOLD, DIV, etc. What's the snag or trick? Why can't I seem to get the actual tag? BTW, it works fine on mouse clicks trapped in the PretranslateEvent callback, but this callback does not seem to trap arrow key presses (my understanding is that that is what TranslateAccelerator is for, and supposedly it is called before PretranslateEvent).
Thanks.
|
|
|
|
|
I've never used the IHTMLEditDesigner interface. When I need to provide DHTML into a CHtmlView I use JavaScript inside the DHTML code and search for a certain tag id (get_id).
In the case you've exposed, I agree with you that get_srcElement it'd be the correct method to know the event source. Have you trusted that TranslateAccelerator only fires one time for each keybord hit? I mean if you validate the DISPID (DISPID_HTMLELEMENTEVENTS2) to be the correct one.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
hi all... want to exchange a list control data between dialogs, but when I tried it, it failed and I don't know why..can anyone help?
//I initialize the 2nd dialog at the 1st dialog class
CAddNeighborsDialog* dlg = new CAddNeighborsDialog;
int count = 0;
/*inserting data to m_listAddNeighbors(CListCtrl data type)in dialog 2 from m_strData(CStringArray data type)*/
while(count*29<m_strdata.getsize())
{
="" int="" nitem="dlg-">m_listAddNeighbors.GetItemCount();
dlg->m_listAddNeighbors.InsertItem(nItem,m_strData.GetAt((count*29)+10));
dlg->m_listAddNeighbors.SetItemText(nItem,1,m_strData.GetAt((count*29)+1));
count++;
}
if(dlg->DoModal() == IDOK)
{
//I try to test it using message box, but the message box shows nothing
MessageBox(dlg->m_listAddNeighbor.GetItemText(0,1));
}
}
pls help...
thx
|
|
|
|
|
I am not sure about the rest of your code, but...
firebolt77 wrote:
//I try to test it using message box, but the message box shows nothing
MessageBox(dlg->m_listAddNeighbor.GetItemText(0,1));
This is definitely not going to work, because all controls on a dialog die, when DoModal() comes back. Therefore, you are using GetItemText() from a list control that does not exist.
You can try this:
Keep a list. E.g, CStringArray variable in your dialog, then override OnOK(), and fill this CStringArray with the items etc in OnOK(). Then later, after DoModal(), you can access this list, and it will still contain the data.
this is this.
|
|
|
|
|
thx...it works...
Thx for the reply...
|
|
|
|
|
I imagine that it's because the dialog it's been destroyed after closing it: add a breakpoint into OnDestroy message handler in your dialog's class. It doesn't fail because it still exists but it has no value.
You should retrieve the data before it's destroyed but it depends on how/where you have defined the dialogs.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
firebolt77 wrote:
CAddNeighborsDialog* dlg = new CAddNeighborsDialog;
Why do this, especially when there is no delete shown? It just ties up the memory manager unnecessarily.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hello All
I want to do a multiple selction of items in combo box,So how should i proceed for that . can anybody help me about this ?
Thanks in advance,
Santosh
|
|
|
|
|
You need to use CListBox[^] instead of a combo box.
In the resource editor you can set the List box properties to have multiple selection behavior: "Styles" tab > "Selection" Drop down menu. Then you are able to use GetSelCount, ...
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
I want to pass member variable values b/w different dialog boxes of my application.How I do that....do I have to make one dialog box class parent of another??how i do that??
|
|
|
|
|
The parent dialog or window is the one that comes in first and gets out last. It creates other dialogs, windows etc.
My bit-weird way would be:
Make pointer-variables for each of shared variables in the parent.
Assign them the address of the variable in the child dialog when creating the dialog.
E.g.
class CParent
{
int* m_pVariable;
};
CChild* c;
c = new CChild;
m_pVariable = &c->m_Variable;//put the address of the variable in parent when creating the child.
Now...
class CSecondChild
{
int* m_pVar;
};
CSecondChild* cc;
cc = new CSecondChild;
cc->m_pVar = m_pVariable;
Here, the value in CSecondChild::m_pVar is the value of the variable CChild::m_Variable.
When you change m_Variable in CChild, it is reflected in CSecondChild's m_pVar.
My code is confusing I think.
this is this.
|
|
|
|
|
jee haan app ka code is definitly cofusing....dont u think this can be done by making one dialog class parent of another....Ive done this and it works...but the problem is that I want to pass all the values of child dialogs back to the main dialog.
Thanx for the reply
AH
|
|
|
|
|
I don't exacly get your point. Do you have all child dialogs visible at the same time, or is it DoModal() for each child dialog?
If you are using DoModal() for each child, then get the data from each of them:
CChild c;
if (c.DoModal() == IDOK)
{
int a = c.m_Variable; //Do this for all variables you need.
...
}
this is this.
|
|
|
|
|
Respected all
Regards!
the last time i recieved the answers of my query was not a professional way. that's y i m sent again
how i can read data from a data file which has extenstion is *.Dat which is in the follwing format
---------------------------
filename.dat
data file
genertaed from the processing of the control system
dfgdfgdfg cgb fbgd
345345 dgdfg
dgdfg
XLOC YLOC INDIX
45 56 2344
56 67 1245
50 90 4562
45 87 9337
-----------------------------------------------------------------
and in the given data file i have to read only the data of columns under XLOC,YLOC,INDIX and the file always is in this format.
So please guide me.
waiting for + response.
david
|
|
|
|
|
FILE* fp;<br />
char x[20], y[20], index[20];<br />
int i;<br />
int ind;<br />
char buf[200];<br />
int len;<br />
fp = fopen("text1.dat","r");<br />
while (! feof(fp))<br />
{<br />
memset(buf,0,sizeof(buf));<br />
fgets(buf,200,fp);<br />
len = strlen(buf);<br />
if (len == 0)<br />
continue;<br />
<br />
memset(x,0,sizeof(x));<br />
memset(y,0,sizeof(y));<br />
memset(index,0,sizeof(index));<br />
<br />
ind = 0;<br />
i = 0;<br />
while (i < len)<br />
{<br />
if (buf[i] == ' ')<br />
break;<br />
x[ind] = buf[i];<br />
ind++;<br />
i++;<br />
}<br />
i++;<br />
ind = 0;<br />
while (i < len)<br />
{<br />
if (buf[i] == ' ')<br />
break;<br />
y[ind] = buf[i];<br />
ind++;<br />
i++;<br />
}<br />
i++;<br />
ind = 0;<br />
while (i < len)<br />
{<br />
if (buf[i] == ' ')<br />
break;<br />
index[ind] = buf[i];<br />
ind++;<br />
i++;<br />
}<br />
<br />
MessageBox(x);<br />
MessageBox(y);<br />
MessageBox(index);<br />
<br />
}<br />
fclose(fp);
What you need to do is string-processing, not some filing technique.
I hope it works.
this is this.
|
|
|
|