windows - INNO Setup: How to get the primary monitor's resolution? -


I am trying to script an installer with INNO and I'm stuck at a point where I have a screen resolution The machine in which the setup is running and uses that value to create a shortcut in the desktop, with that resolution in the form of that argument. I know how to create a shortcut, though I do not know how to remove the screen resolution and how to pass that information (possibly stored in a custom variable) to use it in desktop shortcuts.

Thank you for your time :)

Edit: I can not change the application because I am not authorized to do this. Please do not suggest to do so.

My solution of this GetSystemMetrics () , found in user32.dll can go. This part of the code gives me exactly what I want and tested with a double monitor setup on Windows 7 Professional (64-bit).

  [Code] Function GetSystemMetrics (nIndex: Integer): Integer; External 'GetSystemMetrics @ User 32.dll stdcall setuponly'; Const SM_CXSCREEN = 0; // NIM-value to get the width of sensor area for full-screen window on primary display monitor, SM_CYSCREEN = 1 in pixels; // enum-value to get the height of the customer area for a full-screen window in pixels on the primary display monitor. Start the function Setup (): Boolean; Var HDC: Integer; X-ray: integer; Yres: integer; Start xres: GetSystemMetrics (SM_CXSCREEN); Yres: = GetSystemMetrics (SM_CYSCREEN); // Vertical resolution MsgBox ('current resolution' is + IntToStr (xres) + 'x' + IntToStr (yres), mbInformation, MB_OK); Result: = True; End;   

Edit : It looks like the index was SM_CXSCREEN and SM_CYSCREEN. Changed that code to change.

Comments