Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-02

How to resize window under win32?

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Hankovec

Hello to all,
please, I've this problem:
I'm launching another program from Freepascal program through "exec" (under win32). Is any way how to set the position and size of started program (the program doesn't save it's position and size and starts always on the same bad position). So I need code that can set the position and size of another program. Is it possible to do it by Freepascal? Can anybody help me with the code, please?

Thanks a lot

Martin H.

Jeff Pohlmeyer
I'm launching another program from Freepascal program through "exec" I need code that can set the position and size of the started program.

I haven't used Windows in a while, but I think you need CreateProcess() instead of WinExec()

You can to set the dwX, dwY, dwXSize, and dwYSize fields of the lpStartupInfo parameter .

The function is declared in:
C:\FPC\RTL\WIN32\WININC\UNIDEF.INC

and the structures are in:
C:\FPC\RTL\WIN32\WININC\STRUCT.INC

( or where ever your files are )

The MSDN documentation is at:
<url>
http://msdn.microsoft.com/library/default.asp
?url=/library/en-us/dllproc/base/startupinfo_str.asp </url>

( That's all on one line )

See also:
http://www.delphicorner.f9.co.uk/articles/wapi4.htm http://www.google.com/search?q=CreateProcess+Delphi

__________________________________________________ Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/