Hi ppl, i'm new here and this is my first post.
I got this code and it works fine! It just set "myprinter" as default printer.
Code:
HINSTANCE lib;
lib = LoadLibrary("printui.dll");
if ( lib == NULL ) {
printf("%s\n", "printui.dll");
return 0;
}
LPFUNC PrintUIEntry;
PrintUIEntry = (LPFUNC)GetProcAddress(lib, "PrintUIEntryW");
if ( PrintUIEntry == NULL ) {
FreeLibrary( lib );
printf("%s\n", "PrintUIEntry");
return 0;
}
_bstr_t bstrParam;
bstrParam = " /y /n \"myprinter\"";
PrintUIEntry(
GetDesktopWindow(),
lib,
(wchar_t *)bstrParam,
SW_SHOW
);
FreeLibrary( lib );
But i need to know if it worked. I need an exit code, or boolean response.
Someone knows how to retrieve it?