неужели ни кто не инкапсулировал APIшные функции ???
PHP код:
#define.PD_RETURNDC (0x00000100)
#define.PD_COLLATE(0x00000010)
static container getPrintDlg(int _hwnd)
{
#define.structSize(4*21)
Binary struct = new Binary(#structSize);
DLL _DLL = new DLL("Comdlg32");
DLLFunction _getPrintDlg = new DLLFunction(_DLL, "PrintDlgExA");
_getPrintDlg.returns(ExtTypes:: DWord);
_getPrintDlg.arg(ExtTypes::Pointer);
struct.dWord (#offset0, #structSize ); //lStructSize = sizeof(PRINTDLGEX);
struct.dWord (#offset4, _hwnd ); //hwndOwner = hWnd;
struct.dWord (#offset8, 0 ); //hDevMode = NULL;
struct.dWord (#offset12, 0 ); //hDevNames = NULL;
struct.dWord (#offset16, 0 ); //hDC = NULL;
struct.dWord (#offset20, #PD_RETURNDC | #PD_COLLATE );//Flags = PD_RETURNDC | PD_COLLATE;
struct.dWord (#offset24, 0 ); //Flags2 = 0;
struct.dWord (#offset28, 0 ); //ExclusionFlags = 0;
struct.dWord (#offset32, 0 ); //nPageRanges = 0;
struct.dWord (#offset36, 10 ); //nMaxPageRanges = 10;
struct.dWord (#offset40, 0 ); //lpPageRanges = pPageRanges;
struct.dWord (#offset44, 0 ); //nMinPage = 1;
struct.dWord (#offset48, 1000 ); //nMaxPage = 1000;
struct.dWord (#offset52, 1 ); //nCopies = 1;
struct.dWord (#offset56, 0 ); //hInstance = 0;
struct.dWord (#offset60, 0 ); //lpPrintTemplateName = NULL;
struct.dWord (#offset64, 0 ); //lpCallback = NULL;
struct.dWord (#offset68, 0 ); //nPropertyPages = 0;
struct.dWord (#offset72, 0 ); //lphPropertyPages = NULL;
struct.dWord (#offset76, 1 ); //nStartPage = START_PAGE_GENERAL;
struct.dWord (#offset80, 0 ); //dwResultAction = 0;
if (_getPrintDlg.call(struct))
{
info(int2str(struct.dWord (#offset8)));
}
return conNull();
}
может свежий взгляд на код поможет... ошибки не возникает.. но окошко не всплывает и естественно возвращается нулевой дискриптор... может я где что не так определяю ???