MeetingShare_StartAppShare example

Description
Can somebody please provide an example in electron how to share an app with electron-sdk?

The function MeetingShare_StartAppShare says:

@param {String} zn_hShare_app Specifies which the window is to be shared (require hexadecimal)

However there is no function to get the list of available apps. Could somebody please explain how this function is supposed to be used in Electron?

I tried pid, hex(pid), px${hex(pid)} but none of them seems to work.

Which version?
v5.2.41762.1027

To Reproduce(If applicable)
Steps to reproduce the behavior:

zoommeeting = zoomsdk.GetMeeting();
zoommeetingshare = zoommeeting.GetMeetingShare();
zoommeetingshare.MeetingShare_StartAppShare({
      zn_hShare_app: `???`
    },
  );

Smartphone (please complete the following information):

  • Device: Dell
  • OS: Windows 10

The ideal solution would be if Zoom SDK could provide a method to get all the running applications which are available for sharing, just like in the Zoom app itself.

It already works like that for the lists of microphones, speakers and camera devices. Would be good for consistency. Otherwise the developers will need to install 3rd-party native windows/mac libraries.

I would be very happy to support you testing this functionality.

Hey @karens,

Thanks for using the dev forum!

That is a good suggestion. I will let the team know. For now, can you try using the enumWindows API https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumwindows?

Thanks!
Michael

Hi Michael,

Thanks for your reply. Your suggestion works, although the procedure does not return Applications which are opened by Electron.
The combinations of these functions works:

const user32 = Library('user32.dll', {
    EnumChildWindows: [W.BOOL, [W.HWND, W.WNDENUMPROC, W.LPARAM]],
    EnumWindows: [W.BOOL, [W.WNDENUMPROC, W.LPARAM]],
    GetWindowThreadProcessId: [W.DWORD, [W.HWND, W.LPDWORD]],
    IsWindowVisible: [W.BOOL, [W.HWND]]
  });

This is far from ideal because of no Mac support, performance and limited support of ffi-napi library.
If you could add a AppListing method to your roadmap, that would be fantastic.