|
Hello everybody,
I want to paint something outside my app.
like a multimedia keyboard:
when I increase or decrease the volume something
appears on screen.
best wishes.
thanks
|
|
|
|
|
Use GetDesktopWindow() API to get Handle to Desktop Window, Then create a DC with this handle and enjoy
Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth!
-Fyodor Dostoevsky, The Brothers Karamazov
|
|
|
|
|
Dear friends,
I try to develop a program which can hook into IE (toolbar buttons and/or menu items in IE window) to get all text in all text fields in a HTML page being displayed by IE. This will perform when user click on the toolbar button or menu item.
I don't know how to start and from where to begin. Could you please help me on this and thanks in advanced.
|
|
|
|
|
You will have to write a BHO(Browser Helper Object).
You can start from here[^]msdn
Also look for BHO samples here in codeproject also.
There is no spoon.
mail
|
|
|
|
|
Thank you suhredayan very much for your kind help. I'm searching in codeproject for the sample code.
I will go back to this topic if there are some confusion to me and need your help again.
Once again, thank you.
|
|
|
|
|
you are welcome TPN.
There is no spoon.
mail
|
|
|
|
|
Hi!
I’m creating an ActiveX control in my myapp.aspx-page using the <object> - tag.
<br />
<OBJECT id="objComp" style="Z-INDEX: 101; LEFT: 24px; WIDTH: 974px; POSITION: absolute; TOP: 40px; HEIGHT: 538px"<br />
</OBJECT><br />
At this time I’m only using the ActiveX technology to publish my MFC application on the net. I’m about to make a call to may webpage like this:
http://www.mypage.com/myapp.aspx?user=bill&password=12345
How may I pass the “user” and the “password” into my ActiveX?
Can I how do I access the properties of my ActiveX from my page?
The ActiveX is supposed to run on the client – not on the server.
_____________________________
...and justice for all
APe
|
|
|
|
|
hi
ya its for sure that ActiveX runs on client side
you can access methods as well as properties exposed by your control from your page
e.g. if your control exposes a method like SetUseridPassword(BSTR usrID,BSR password) then you can access it as follows
<OBJECT
ID="MyActiveXID"
CLASSID="clsid:your-control-class-id-here"
CODEBASE="TestAX.ocx"
TYPE="application/x-oleobject"
>
then on any event (like button's onClick) call the following following function like onClick='InitValues'
don't forget to define this script in head section of your page.
<script language="JavaScript">
function InitValues()
{
MyActiveXID.SetUseridPassword("testusr","tstpassword")
}
</script>
Muhammad Azam
|
|
|
|
|
It really looks like you have the solution of my problem. I try to implement it with javascript.
THANKS!
_____________________________
...and justice for all
APe
|
|
|
|
|
hi
its my pleasure if i could be of any help for you
regards
Azam
|
|
|
|
|
Hi All,
I used SuspendThread and ExitInstance to stop a thread created using AfxBeginThread Function. But in some newsgroup messages it is stated that this is not the right method. I've used PostThreadMessage using WM_QUIT, but this is not working. So How to stop a thread created using AfxBeginThread function.
Thanx in Advance
Sujan
|
|
|
|
|
To use PostThreadMessage it should be a UI Thread with message loop. Wot kind of thread you created worker thread or UI thread ?
There is no spoon.
mail
|
|
|
|
|
Hi suhredayan,
Thanx for your reply.
It's a worker thread. TerminateThread is working but i am using critical
section for data handling, so MSDN states that it is a DANGEROUS function. Think that i must have to use waitforsingleobject().
Sujan
|
|
|
|
|
The thread must finish execution on its own based on some condition. Use WaitForSingleObject or WaitForMultipleObjects if you got wait for some signal and u can also give time. There are other methods also that can be used to stop execution like signalling a flag etc.
|
|
|
|
|
Hi Dubey,
Thanx 4 ur reply.I'll try to implement it using waitformultipleobjects.
Sujan
|
|
|
|
|
|
Hi
Thanx for the link i'll look into it
Sujan
|
|
|
|
|
You could create a shutdown event to stop the worker thread execution.
Here's an example how to do it:
int CYourThreadClass::ThreadFunction()
{
while(1)
{
HANDLE h[2];
h[0] = m_eventShutdown.m_hObject;
h[1] = another handle;
DWORD dwRet = ::WaitForMultipleObjects(2,h,FALSE,YOURTIMEOUT)
if(dwRet==WAIT_OBJECT_0)
return 0;
else if(dwRet==WAIT_OBJECT_1)
else if(dwRet==WAIT_TIMEOUT)
else if(dwRet==WAIT_FAILED)
}
}
|
|
|
|
|
Hi Markowski
Thanx a lot. I am working with it.
Sujan
|
|
|
|
|
Hi Andrzej
One silly question. Sorry. How to manage with WAIT_OBJECT_1.Instead shall i use the created thread handle. I used it and it is always getting into that "Wait Timeout" state. OR have to create another event.
Thanx in advance
Sujan
|
|
|
|
|
Here's an example which manages with WAIT_OBJECT_1 . The example demonstates how to print to the debug output every 1 s:
int CYourThreadClass::ThreadFunction()
{
while(1)
{
int nCounter = 0;
HANDLE h[2];
h[0] = m_eventShutdown.m_hObject;
h[1] = m_eventPrintToDebug.m_hObject;
DWORD dwRet = ::WaitForMultipleObjects(2,h,FALSE,INFINITE)
if(dwRet==WAIT_OBJECT_0)
return 0;
else if(dwRet==WAIT_OBJECT_1)
TRACE("Counter = %d\n",n_Counter++);
else if(dwRet==WAIT_TIMEOUT)
else if(dwRet==WAIT_FAILED)
}
}
|
|
|
|
|
Hi Andrzej,
Thanx A Lot. I am working with it.
Actually i creating a number of threads using AfxBeginThread(..) function and trying to end them.
The code goes like this
CWinThread *multthreads[MAX_CONNECTIONS];
int count;
UINT DataAccessThreading(LPVOID pParam)
{
CoInitialize(NULL);
int* ind= (int *)pParam;
int index=*ind;
free(ind);
while(TRUE)
{
HANDLE h[2];
h[0] = m_eventShutdown.m_hObject;
h[1] = multthreads[count]->m_hThread;
DWORD dwRets = (DWORD) multthreads[count]->m_hThread;
DWORD dwRet = ::WaitForMultipleObjects(2,h,FALSE,INFINITE);
if(dwRet==WAIT_OBJECT_0)
{
TRACE("THREAD EXIT SUCCESSFULL-Not Killing \n");
return 0; //exit thread
}
else if(dwRet== (DWORD) multthreads[count]->m_hThread)//handle your synchronization object
{
test.CacheRefresh(index);
Sleep(refreshInterval); //Added by Sujan
}
else if(dwRet==WAIT_TIMEOUT)//handle timeout
{
TRACE("Wait Timeout \n");
}
else if(dwRet==WAIT_FAILED)// handle error
{
TRACE("Wait Failed \n");
}
}
return 0;
}
and the OnInitDialog i am creating a thread by using
int *p=(int *)malloc(sizeof(int));
*p=i;
multthreads[i]=AfxBeginThread(DataAccessThreading,p,0,0,NULL);
Am i going on the right way. Please comment on this.
While using this code i am not getting my event called at all.
SORRY FOR DISTURBING YOU.
AGAIN Thanx A Lot
Sujan
|
|
|
|
|
Hi Andrzej,
If you have got the problem with my code. I am waiting for your responce.
SORRY 4 DISTRUBING U Much
Sujan
|
|
|
|
|
Does this article help?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes Yes
Thanx David. Now i am working with it.
Sujan
|
|
|
|