Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
Windows
(Moderators:
FPK
,
Tomas Hajny
) »
Window rendering error after calling CallWindowProc and DefWindowProc
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Creating a "compressed" s...
by
paweld
[
Today
at 10:09:51 pm]
TStringGrid.Columns.Count...
by
Vodnik
[
Today
at 09:45:01 pm]
Lazarus 3.9.9 Variable Wa...
by
Martin_fr
[
Today
at 09:27:11 pm]
Installing Lazarus on a R...
by
JuhaManninen
[
Today
at 09:09:05 pm]
i can't inatall Dam dialo...
by
majid.ebru
[
Today
at 08:35:11 pm]
Lazarus Release Candidate...
by
af0815
[
Today
at 08:34:01 pm]
TCustomShellTreeView.GetF...
by
Alexx2000
[
Today
at 07:22:01 pm]
Can TreeView Node Colours...
by
Bart
[
Today
at 07:21:27 pm]
Two paintbox, how to set ...
by
krolikbest
[
Today
at 06:38:39 pm]
Advance Record operators ...
by
ad1mt
[
Today
at 06:32:01 pm]
https page download
by
BubikolRamios
[
Today
at 06:18:50 pm]
Un-register an LCL Compon...
by
JuhaManninen
[
Today
at 06:10:49 pm]
Error: -macosx_version_mi...
by
Koenijn
[
Today
at 06:03:37 pm]
[SOLVED] TPanel slider po...
by
Pe3s
[
Today
at 05:46:45 pm]
Unable to write "/usr/sha...
by
Rbart
[
Today
at 05:27:42 pm]
Can I disable procedure '...
by
Hartmut
[
Today
at 05:02:00 pm]
TAnchorDockPanel - Save a...
by
kapibara
[
Today
at 04:44:58 pm]
Is there an indexable str...
by
jamie
[
Today
at 04:16:54 pm]
Anyone interested in test...
by
cpicanco
[
Today
at 03:59:22 pm]
[Solved] How to shuffle l...
by
Thaddy
[
Today
at 02:24:10 pm]
Virtual Method
by
Mr.Madguy
[
Today
at 01:13:41 pm]
Difference between TSpeed...
by
Zoran
[
Today
at 12:44:57 pm]
BGRA Controls Package Ico...
by
paweld
[
Today
at 11:48:50 am]
unable to rebuild Lazarus
by
Paolo
[
Today
at 11:36:47 am]
[SOLVED] Lazarus png file
by
Pe3s
[
Today
at 11:22:32 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Window rendering error after calling CallWindowProc and DefWindowProc (Read 2086 times)
Pixelmak
New member
Posts: 7
Window rendering error after calling CallWindowProc and DefWindowProc
«
on:
December 21, 2021, 11:10:47 am »
I am trying to get Windows messages via WndCallback in Windows 11. But, after receiving the message, the window is not rendered normally. What am I doing wrong? (Screen in Attachment)
Code: Pascal
[Select]
[+]
[-]
unit
Unit1
;
{$mode delphi}{$H+}
interface
uses
Classes
,
SysUtils
,
Forms
,
Controls
,
Graphics
,
Dialogs
,
StdCtrls
,
Windows
;
type
{ TForm1 }
TForm1
=
class
(
TForm
)
Button1
:
TButton
;
procedure
Button1Click
(
Sender
:
TObject
)
;
procedure
FormCreate
(
Sender
:
TObject
)
;
private
public
end
;
function
WndCallback
(
Ahwnd
:
HWND
;
uMsg
:
UINT
;
wParam
:
WParam
;
lParam
:
LParam
)
:
LRESULT
;
stdcall
;
var
Form1
:
TForm1
;
PrevWndProc
:
windows
.
WNDPROC
;
implementation
function
WndCallback
(
Ahwnd
:
HWND
;
uMsg
:
UINT
;
wParam
:
WParam
;
lParam
:
LParam
)
:
LRESULT
;
stdcall
;
begin
result
:
=
CallWindowProc
(
PrevWndProc
,
Ahwnd
,
uMsg
,
WParam
,
LParam
)
;
end
;
{$R *.lfm}
{ TForm1 }
procedure
TForm1
.
FormCreate
(
Sender
:
TObject
)
;
begin
PrevWndProc
:
=
Windows
.
WNDPROC
(
SetWindowLongPtr
(
Self
.
Handle
,
GWL_WNDPROC
,
PtrUInt
(
@
WndCallback
)
)
)
;
end
;
procedure
TForm1
.
Button1Click
(
Sender
:
TObject
)
;
begin
writeln
(
'Button clicked'
)
;
end
;
end
.
Logged
Pixelmak
New member
Posts: 7
Re: Window rendering error after calling CallWindowProc and DefWindowProc
«
Reply #1 on:
December 21, 2021, 11:14:27 am »
Oh, I'm sorry. This code works now. I don’t know for what reason this error occurred.
Perhaps the reason was that I used DefWindowProc instead of CallWindowProc
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
Windows
(Moderators:
FPK
,
Tomas Hajny
) »
Window rendering error after calling CallWindowProc and DefWindowProc
TinyPortal
© 2005-2018