how to use HWND provided by SPY++ in my Application [modified]
-
hi ok as guys are not able to understand what i am asking i will try to be specific run spy++ and in windows section(ctrl+w) you see different windows handel values, i want to use one of those value in my program and send a message to that particular window, defined by the window handel id, exm: in spy++ one appliction window has id 2222 i want to send message to 2222 window handel id how to do tht, as far i know u simply cant do like this HWND h=2222; my app for suppose there is xyz window or application, i query for HWND in Spy++, it returns me 2222, i want to use tht value in my application to send a message to tht window, SendMessage( hwnd a, ...,...,...); how to do hwnd a = 2222; any idea or suggestion, the basic doubt is how to use a handel value provided by spy++, if app does nt have a window or a hidden application or tray icon. -- modified at 17:10 Sunday 17th December, 2006
swarup wrote:
it returns me 2222, i want to use tht value in my application to send a message to tht window, SendMessage( hwnd a, ...,...,...); how to do hwnd a = 2222;
You can use this value as handle in
SendMessage
.swarup wrote:
if app does nt have a window or a hidden application or tray icon.
:confused: How would you get handle , if there is no window ?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
swarup wrote:
it returns me 2222, i want to use tht value in my application to send a message to tht window, SendMessage( hwnd a, ...,...,...); how to do hwnd a = 2222;
You can use this value as handle in
SendMessage
.swarup wrote:
if app does nt have a window or a hidden application or tray icon.
:confused: How would you get handle , if there is no window ?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Actually he can, if the app has the window hidden.
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.
why cant you , if you dont see a window tht does mean one ap does nt hv a window, anyway tht is not my problem what is ma problem is i knw from external program the hwnd value and i want to use tht value in ma application to send message to tht hwnd value, any idea
-
Actually he can, if the app has the window hidden.
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:
Actually he can, if the app has the window hidden.
Yes, But I was concerned about "if application does not have window" statement.
Prasad Notifier using ATL | Operator new[],delete[][^]
-
why cant you , if you dont see a window tht does mean one ap does nt hv a window, anyway tht is not my problem what is ma problem is i knw from external program the hwnd value and i want to use tht value in ma application to send message to tht hwnd value, any idea
As said earlier. You can use
SendMessage
. if you have handle to that window. No matter if its hidden.swarup wrote:
knw from external program the hwnd value and i want to use tht value in ma application to send message to tht hwnd value, any idea
Then what problem?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
CPallini wrote:
Actually he can, if the app has the window hidden.
Yes, But I was concerned about "if application does not have window" statement.
Prasad Notifier using ATL | Operator new[],delete[][^]
In fact, his words where a bit inaccurate. Anyway what he was asking was enough clear, at least to me...
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.
-
As said earlier. You can use
SendMessage
. if you have handle to that window. No matter if its hidden.swarup wrote:
knw from external program the hwnd value and i want to use tht value in ma application to send message to tht hwnd value, any idea
Then what problem?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
i know i have to use sendmessage, but how to code it in my application, now dont tell me use this way SendMessage(2222, "any message","any message","any message"); how to use a hwnd value returned or shown by spy++, in the VC++ program programaticaly
swarup wrote:
how to use a hwnd value returned or shown by spy++, in the VC++ program programaticaly
Mentioning
SPY++
from start leads to confusion. You can look in to this[^] article, to see how to get windows handle. Alternatively, you can useFindWindow()
, if you have title to window in question.Prasad Notifier using ATL | Operator new[],delete[][^]
-
In fact, his words where a bit inaccurate. Anyway what he was asking was enough clear, at least to me...
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:
Anyway what he was asking was enough clear, at least to me
It was not clear, atleast for me ..:) I was assuming from start, he has way to get window handle. But he was asking for it in actual.
Prasad Notifier using ATL | Operator new[],delete[][^]
-
swarup wrote:
how to use a hwnd value returned or shown by spy++, in the VC++ program programaticaly
Mentioning
SPY++
from start leads to confusion. You can look in to this[^] article, to see how to get windows handle. Alternatively, you can useFindWindow()
, if you have title to window in question.Prasad Notifier using ATL | Operator new[],delete[][^]
no i dont want sample for spy, i can make spy++, 1st ? can there be a window with out name 2nd dont u think there are windows or application who has a window but hidden. so in tht case how to get there handel you query in SPY++ and you come to know about the handel value now you want to hard code tht value in your app and send some message for this do u have any idea or it cant be done ?
-
hi ok as guys are not able to understand what i am asking i will try to be specific run spy++ and in windows section(ctrl+w) you see different windows handel values, i want to use one of those value in my program and send a message to that particular window, defined by the window handel id, exm: in spy++ one appliction window has id 2222 i want to send message to 2222 window handel id how to do tht, as far i know u simply cant do like this HWND h=2222; my app for suppose there is xyz window or application, i query for HWND in Spy++, it returns me 2222, i want to use tht value in my application to send a message to tht window, SendMessage( hwnd a, ...,...,...); how to do hwnd a = 2222; any idea or suggestion, the basic doubt is how to use a handel value provided by spy++, if app does nt have a window or a hidden application or tray icon. -- modified at 17:10 Sunday 17th December, 2006