locked
Can't get message if my application installed in programfiles(x86) RRS feed

  • Question

  • Hi...

    I  have two applications. One app will send messages to another by using "SendMessage".

    If I installed the application(reciver) in  "Programfiles(x86)" folder, the app can't get the message from another app. It still got some messages like  code 32,132,512,675,4960, but it can't get code 74(0x004A).

    If I installed the app in "C:\" folder, the app run correctly. 

    Sorry, My english is not good, I wish you can understand what I mean.

    Thanks!

    Partical code showed below..

    protected override void WndProc(ref Message m)
            {
                switch (m.Msg)
                {
                    case 0x004A:
                        {
                             // do something
                        }
                        break;

               }}

    Sunday, December 22, 2019 2:25 AM

Answers

  • Thats what User Interface Privilege Isolation is for.
    But I really expected GetLastError to return 5, as it is documented to.
    • Marked as answer by GaryChiang Tuesday, December 24, 2019 2:09 AM
    Monday, December 23, 2019 4:11 PM

All replies

  • What is the LRESULT of the SendMessage call when you pass 0x004A?

    And are you sure this is Windows 10 specific? Using WM_COPYDATA for IPC was used in pre Vista times. Since Vista, there are restrictions (User Interface Privilege Isolation)

    You are probably better served on a developer forum.

    Sunday, December 22, 2019 3:09 AM
  • I send the datastruct below,

    typedef struct
    {
    int date;
    int time;
    int contracts;
    int maxContracts;
    double price;
    char future[20];
    char recipe[20];
    }

    I don't have win8 or vista, so, I can't  make sure this problem will / will not happen in win8 or vista. 


    Sunday, December 22, 2019 11:29 AM
  • so does SendMessage fail? when yes: call GetLastError.
    I guess it returns 5.

    There are multiple options for IPC: Interprocess Communications
    is there a good reason you are using WM_COPYDATA? 

    Sunday, December 22, 2019 2:25 PM
  • It return 1.

    And I found some information :

    1. The App run well at VS.

    2. The App run well at C:\

    3. The App can't open, if app without administrator permit (in ProgramFiles(X86) folder).

    4. The App can run, if app with administrator permit (in ProgramFiles(X86) folder), but can't get message.

    5. I upgrade VS from 2017 to 2019 recently.


    I also re-install the old file in ProgramFiles(X86) folder. It build by VS2017 one month ago. The code with some different, but not much.  The app run well without administrator permit.

    Sunday, December 22, 2019 3:33 PM
  • Try to turn the UAC control to the lowest possible setting.

    Besides, after upgrade VS version, reinstall all your apps which is developed by VS is a common method.

    Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, December 23, 2019 2:15 AM
  • I did some test today!

    If two applications with different privilege, they can't send messages to each other.

    It is no problem, if both applications run under administrator privilege.


    • Edited by GaryChiang Monday, December 23, 2019 12:16 PM
    Monday, December 23, 2019 12:16 PM
  • Thats what User Interface Privilege Isolation is for.
    But I really expected GetLastError to return 5, as it is documented to.
    • Marked as answer by GaryChiang Tuesday, December 24, 2019 2:09 AM
    Monday, December 23, 2019 4:11 PM
  • Thanks for your kindly help!!
    Tuesday, December 24, 2019 2:13 AM