Home > Back-end >  DELPHI set transparent window
DELPHI set transparent window

Time:10-24

GetWindowLong
SetWindowLong
These two functions don't understand. Could you get me to explain. Don't use baidu. I simply can't understand what meaning, don't use jargon
 

Procedure TForm1. TrackBar1Change (Sender: TObject);
Var
H: HWND;
FormStyle: Integer;
The begin
H:=FindWindow (' Notepad 'nil);
If h & lt;> 0 then
The begin//GetWindowLong to obtain specified handle extended window style? Return is what things? Don't say what a 32-bit value. Don't understand completely
FormStyle:=GetWindowLong (h, GWL_EXSTYLE);
//SetWindowLong third and fourth parameters what mean
SetWindowLong (h, GWL_EXSTYLE FormStyle or WS_EX_LAYERED);
SetLayeredWindowAttributes (h, 0, trackbar1 Position, LWA_ALPHA);
end;
end;

CodePudding user response:

The function prototype:
LONG GetWindowLong (HWND HWND, int nIndex)

Parameters:
HWnd: a handle to the specified window
NIndex: need to get the type of information that

The return value:
Success, return the value of a request for 32-bit
Failure, returns 0, can use GetLastError to get error message
==============================
NIndex: GWL_EXSTYLE be extended window style

FormStyle:=GetWindowLong (h, GWL_EXSTYLE);
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
According to the window handle for extended window style -- -- -- -- -- -- -- 32-bit value plastic.
For example,
The window is placed at the top: WS_EX_TOPMOST=8
The toolbar window: WS_EX_TOOLWINDOW=128
The return value is composed of WS_EX_TOPMOST + WS_EX_TOOLWINDOW=136



SetWindowLong (h, GWL_EXSTYLE FormStyle or WS_EX_LAYERED);
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The handle to the current window set extended window style, the new style value is FormStyle or WS_EX_LAYERED

CodePudding user response:

reference 1st floor simonhehe response:
function prototypes:
LONG GetWindowLong (HWND HWND, int nIndex)

Parameters:
HWnd: a handle to the specified window
NIndex: need to get the type of information that

The return value:
Success, return the value of a request for 32-bit
Failure, returns 0, can use GetLastError to get error message
==============================
NInde...

Dizzy. All say don't baidu. Said is equal to didn't say, or do not understand

CodePudding user response:

Dizzy, do you know about window class? Modifed WNDCLASSEX,, don't know what to say is no use

CodePudding user response:

Brother, you know the first Windows the underlying mechanism: Win32 window class and the message loop mechanism
  • Related