1) obtain the screen resolution
During cab installation, you can use setupDLLDoing some initialization work greatly facilitates ourDevelopment.
However, getsystemmetrics is used in setupdll.FunctionObtainScreenResolution problems occur. 320x240,800 x.
The original cause is not clear. It is said that setupdllis identified by wceload.exe, and wceloade.exe is not capable of obtaining resolution...
No matter what, we have to do another exe.ProgramTo be called by setupdll.
Add the following to install_exit:
Process_information Info;
CreateProcess (L "// program files // getmetricstest.exe", null, 0, null, & info );
Waitforsingleobject (info. hprocess, infinite); // wait until the process ends.
The getmetricstest.exe program is used to obtain the screen resolution. You can save the obtained parameters in the registry or temporaryFileAnd then setupdll to process these parameters.
2) Get the installation package name
During the installation of the cab, "installing xx. cab... ". the value between cab and cab achieves our goal.
First, use setupDLLYes, and then perform the action in install_exit. At this time, the hwndparent parameter is passed in, and you can use this parameter to make a try:
Tchar scabname [256];
Hwnd hdlg = getwindow (hwndparent, gw_child | gw_hwndfirst );
Uint uctrlid = getdlgctrlid (hdlg );
Getdlgitemtext (hwndparent, udctrlid, scabname, 256 );
Scabname is exactly "XX. Cab..." or "XX. Cab ...".