SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Oct 1999
    Location
    Tyngsborough, MA
    Posts
    211
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GetAppID() & SendMessage()

    I'm trying to use SendMessage() to send a message to an application with a hidden window. It's kind of interesting because this app responds to a broadcast SendMessage() but I figure that's not very good form to do that. Anyway, that's how I figure it has a hidden window, otherwise it would not have responded to a SendMessage(). So I'm wondering how to get an AppID for such a application/window. I'd rather not delve into more WinAPI calls. GetAppID works for a window that's been declared and I can't/don't know how to declare a window for this app. Can I just create a bogus mainwin for this app and run with it?

  2. #2
    Senior Member
    Join Date
    Sep 1999
    Location
    San Jose,CA,USA
    Posts
    340
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetAppID() & SendMessage()


    When I need to get the appid I use the ps.exe routine located in the NT resource kit. It works just like it's ps unix counterpart and will give you pid's or AppId's for applications even if they have a hidden window (I am preety sure).

    I realize that you would have to process the return list from sys_execute and you may not want to write more code for it. But it is a resource and it has worked for me.

    I will send you a copy of ps.exe after I get to work (in an hour or so).


    [This message has been edited by rick_weth (edited 12-14-2000).]
    Smoke me a kipper, I'll be back for breakfast!
    Sincerely
    Richard Weth
    Sr. QA Engineer

  3. #3
    Senior Member
    Join Date
    Oct 1999
    Location
    Tyngsborough, MA
    Posts
    211
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetAppID() & SendMessage()

    I figured it out...
    [ ] LPCTSTR lpszClass = "CBSysTray"
    [ ] LPCTSTR lpszWindow = ""
    [ ] HWND hwndChildAfter = 0
    [ ] HWND hwndParent = 0
    [ ] UINT uiMsg = WM_COMMAND
    [ ] WORD wParam = ID_ABOUT
    [ ] LPARAM lParam = 0
    [ ]
    [ ] HWND hCBSysTrayWnd = FindWindowExA(hwndParent, hwndChildAfter, lpszClass, lpszWindow)
    [ ]
    [ ] BOOL bResult = PostMessage (hCBSysTrayWnd, uiMsg, wParam, lParam)

    I use FindWindowExA() to get a handle to a window belonging to the specified class, "CBSysTray". Then I post a message to that handle. I was able to look at our C++ code to figure out the class of the hidden window and the parameters needed for a call to PostMessage(). SilkTest didn't like it when I tried to pass NULL to PostMessage, that's why the handles are set to 0 and "".

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:43 AM.

Copyright BetaSoft Inc.