Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
Marco Emmanuel90700
1 discussion post
Trying to run a downloaded scripted function to close discord, and I'm not sure what windowHandle is on the script. Do I just replace that with Discord?
Feb 11, 2024  • #1
User Image
JLJTGR
104 discussion posts
The specifics will only make sense if you know a little C/C++, but windowHandle is defined as type IntPtr... which is a memory address. Memory addresses could be absolutely anything, but in this context it will probably be the memory address of a window.

Think of it as a GPS location to the front door of someone's house. If you give a robot this location and tell it to open a door, it will probably open the door. Pick a random location and do the same, it probably won't work out as the robot might end up in the middle of a forest or inside some other building by mistake and there's no door to open. It will try anyways, but the operation will "crash".

Functions such as
BFS.Window.GetWindowByText("Discord")
might give you an IntPtr to the Discord window, if the window has that title. Passing that IntPtr to another function that wants a windowHandle will probably work. Like
BFS.Window.Close(someIntPtr)
might close that window. But Discord might only minimize to tray when you try to close its window, so that might not do what you want anyways. (I've never used the standalone Discord app, so maybe it does close?)
Feb 12, 2024  • #2
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)