Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to use HWND provided by SPY++ in my Application [modified]

how to use HWND provided by SPY++ in my Application [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
databasetutorial
12 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S swarup

    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

    P Offline
    P Offline
    prasad_som
    wrote on last edited by
    #2

    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[][^]

    CPalliniC 1 Reply Last reply
    0
    • P prasad_som

      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[][^]

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #3

      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.

      In testa che avete, signor di Ceprano?

      S P 2 Replies Last reply
      0
      • CPalliniC CPallini

        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.

        S Offline
        S Offline
        swarup
        wrote on last edited by
        #4

        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

        P 1 Reply Last reply
        0
        • CPalliniC CPallini

          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.

          P Offline
          P Offline
          prasad_som
          wrote on last edited by
          #5

          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[][^]

          CPalliniC 1 Reply Last reply
          0
          • S swarup

            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

            P Offline
            P Offline
            prasad_som
            wrote on last edited by
            #6

            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[][^]

            S 1 Reply Last reply
            0
            • P prasad_som

              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[][^]

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #7

              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.

              In testa che avete, signor di Ceprano?

              P 1 Reply Last reply
              0
              • P prasad_som

                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[][^]

                S Offline
                S Offline
                swarup
                wrote on last edited by
                #8

                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

                P 1 Reply Last reply
                0
                • S swarup

                  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

                  P Offline
                  P Offline
                  prasad_som
                  wrote on last edited by
                  #9

                  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 use FindWindow() , if you have title to window in question.

                  Prasad Notifier using ATL | Operator new[],delete[][^]

                  S 1 Reply Last reply
                  0
                  • CPalliniC CPallini

                    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.

                    P Offline
                    P Offline
                    prasad_som
                    wrote on last edited by
                    #10

                    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[][^]

                    1 Reply Last reply
                    0
                    • P prasad_som

                      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 use FindWindow() , if you have title to window in question.

                      Prasad Notifier using ATL | Operator new[],delete[][^]

                      S Offline
                      S Offline
                      swarup
                      wrote on last edited by
                      #11

                      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 ?

                      1 Reply Last reply
                      0
                      • S swarup

                        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

                        S Offline
                        S Offline
                        swarup
                        wrote on last edited by
                        #12

                        thanks guys, i dont need the program anymore

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups