I have an .NET application that always starts itself with its border style to ‘None’, as it is supposed to be an full-screen application with a fixed resolution.
However, i would like to add the window border (Fixed3D) to this window when the application starts so that I am able to move it around my desktop.
My first idea was to have a tray app running, monitoring event messages, and somehow change the window style when this specific application starts. However, I am not sure if this will work and how to do this.
Anyone that can point me in the right direction?
You should probably look into using the
SetWindowLongPtrfunction of user32.dll.You’ll need to get the window handle associated with the application’s main window. This could potentially be done using:
You can then set the appropriate styles using the
GWL_STYLEconstant (value -16 in decimal) andSetWindowLongPtr.Changing the Style of the Main Window should help you find the styles that you need.