Page 1 of 1

Importing SetWindowSubclass?

Posted: Sun Jun 13, 2010 9:15 pm
by Justin
This throws a polink error:

Code: Select all

import "comctl32.lib"
	SetWindowSubclass(hwnd.i, pfnSubclass.i, uIdSubclass.i, dwRefData.i)
	DefSubclassProc(hwnd.i, uMsg.i, wparam.i, lparam.i)
endimport

SetWindowSubclass(0, 0, 0, 0)
I used PE Explorer and the function names are ok, what happens?

Re: Importing SetWindowSubclass?

Posted: Sun Jun 13, 2010 9:27 pm
by ts-soft
Use another static lib, the one from pb doesn't have this functions.
Use for example the lib from pellesc, this should work.

Re: Importing SetWindowSubclass?

Posted: Sun Jun 13, 2010 9:57 pm
by Justin
That did it. Shouldn't PB use the newest libs?

Re: Importing SetWindowSubclass?

Posted: Sun Jun 13, 2010 10:20 pm
by ts-soft
Justin wrote:That did it. Shouldn't PB use the newest libs?
the new functions doesn't work on older os, so pb requires not the newest.

Re: Importing SetWindowSubclass?

Posted: Fri May 04, 2018 9:21 am
by Poplar

Code: Select all

Prototype p_SetWindowSubclass(hWnd.i, pfnSubclass.i, uIdSubclass.i, dwRefData.i)
Prototype p_RemoveWindowSubclass(hWnd.i, pfnSubclass.i, uIdSubclass.i)
Prototype p_DefSubclassProc(hWnd.i, uMsg.i, wparam.i, lparam.i)
Prototype p_GetWindowSubclass(hWnd.i, Proc.i, ID.i, RefData.i)

Define.i hComCtl32

hComCtl32 = OpenLibrary(#PB_Any, "comctl32.dll")
If hComCtl32
  Global SetWindowSubclass.p_SetWindowSubclass = GetFunction(hComCtl32, "SetWindowSubclass")
  Global RemoveWindowSubclass.p_RemoveWindowSubclass = GetFunction(hComCtl32, "RemoveWindowSubclass")
  Global DefSubclassProc.p_DefSubclassProc = GetFunction(hComCtl32, "DefSubclassProc")
  Global GetWindowSubclass.p_GetWindowSubclass = GetFunction(hComCtl32, "GetWindowSubclass")
  CloseLibrary(hComCtl32)
EndIf
__________________________________________________
Code tags added
05.06.2018
RSBasic

Re: Importing SetWindowSubclass?

Posted: Fri May 04, 2018 8:40 pm
by chi
If you want this to be permanent:
Copy comctl32.lib from PellesC to PB\PureLibraries\Windows\Libraries and run this code (CompilerSelect 2) in the IDE and hit 'Restart Compiler'