I'm not sure I understand you perfectly. You want to open a custom form from a standard window? And you want to pass the current window no to the form? Or something similar? I try to give an answer the best I can.
You could simple create a standard button column and assign this button to a callout that opens this custom form of yours. The current window number is known in the callout and could be set for example to the environment or even to the form itself if you have component to set it to. If you want to receive the window number of the opened form. Well first of all you know it if you registered it in the directory. But if you didn't and the form inherited cpanel, then it has a getWindowNo method. I've created a callout that opens a custom form I've made to add products to a sales order. It passes the current window when opening (since my class inherits cdialog).
If I wanted the new window no and my class AddProduct would've inherited CPanel I could just get it by adding (after setVisible) "addP.getWindowNo();" . But this is just a dialog so it doesn't have its own window no.
This is the complete callout. I hope it helps.
public String AddProduct(Properties ctx, int windowNo,
GridTab mTab, GridField mField, Object value)
throws AdempiereSystemError {
if (mTab.getRecord_ID() <= 0)
return "";
se.cyberphoto.form.AddProduct addP = new se.cyberphoto.form.AddProduct(Env.getWindow(windowNo), true);
addP.setVisible(true);
return "";
}
Best regards
Nils