Archicad C++ API
About Archicad add-on development using the C++ API.

Change focus event

Emkave
Booster

Hello. I am trying to implement one algorithm but for that I need somehow to detect that you have opened a certain window in Archicad that changes the focus of the application to that window, for ex. a modal dialogue or windows such as those:

Emkave_0-1732985822992.png

 

or

 

Emkave_1-1732985895811.png

or

 

Emkave_2-1732985924330.png

 

 

I guess you got it. Do you know any Archicad API command that could help detecting such focus changes? I have been searching for that command, however, I am either blind or the command does not exist. Thank you in advance!

 

Operating system used: Windows 11

1 REPLY 1
Miklos Vegh
Graphisoft
Graphisoft

Hi, there is a function in the DG.h header file:

DG_DLL_EXPORT bool CCALL DGIsInModalState (void);

This can be used to decide whether a modal dialog is open or not.

And if you attach to the DG::ApplicationObserver, you will be notified about modal state change.

class DG_DLL_EXPORT ApplicationObserver: public GS::EventObserver
{
	...
	virtual void	ModalStateBegin (void);
	virtual void	ModalStateEnd (void);
	...
public:
	ApplicationObserver ();
	virtual ~ApplicationObserver ();
};

Setup info provided by author

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!