Options

AxaptaWindows

MikerMiker Member Posts: 105
edited 2007-02-14 in Dynamics AX
Hi all.
There is up to your attention the fine method to define opened windows in Axapta.
You can use it in other purposes.

static void CountAxaptaWindows(Args _args)
{
DLL user32;
DLLFunction AxaptaVisibleWindows;
HWND MdiClient, child;
str windowText;
boolean isVisible(int _ind)
{
return AxaptaVisibleWindows.call(_ind)? true:false;
}
;
user32 = new DLL('USER32');
AxaptaVisibleWindows = new DLLFunction(user32, 'IsWindowVisible');
AxaptaVisibleWindows.returns(ExtTypes::DWord);
AxaptaVisibleWindows.arg(ExtTypes::DWord);
MdiClient = WinAPI::FindWindowEx(infolog.hWnd(), 0, 'MDIClient', '');
for (Child = WinAPI::FindWindowEx(MdiClient, 0, '', '');
Child ;
Child = WinAPI::FindWindowEx(MdiClient, child, '', ''))
{
if (Child != 0)
{
WindowText = WinAPI::getWindowText(child);

if (WindowText != "" && isVisible(child))
{
info(WindowText);
}
}
}
}


MikeR
going to Europe

Comments

  • Options
    HarishHarish Member Posts: 172
    Nice one :)
    Harish Mohanbabu
    Long way to go before I sleep..
  • Options
    MikerMiker Member Posts: 105
    Thanks
    going to Europe
Sign In or Register to comment.