'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 'XX SUBCLS.DLL EXPORTED FUNCTION DOCUMENTATION XX 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX '=========================================================================================================== ' ClearAllMsgWatches ' ' Clears out all existing code watches ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall void ClearAllMsgWatches () '----------------------------------------------------------------------------------------------------------- ' Public Declare Sub SC_ClearAllMsgWatches Lib "SUBCLS.DLL" Alias "_ClearAllMsgWatches@0" () '=========================================================================================================== '=========================================================================================================== ' ClearLastErr ' ' Sets the last error number to ERRC_NoError (No Error) ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall void ClearLastErr () '----------------------------------------------------------------------------------------------------------- ' Public Declare Sub SC_ClearLastErr Lib "SUBCLS.DLL" Alias "_ClearLastErr@0" () '=========================================================================================================== '=========================================================================================================== ' ClearQuitMsg ' ' Function that sets the indicator back to the default - FALSE (0) ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall void ClearQuitMsg () '----------------------------------------------------------------------------------------------------------- ' Public Declare Sub SC_ClearQuitMsg Lib "SUBCLS.DLL" Alias "_ClearQuitMsg@0" () '=========================================================================================================== '=========================================================================================================== ' GetMessageInfo ' ' This function returns the information for the last CALLBACK function called if the uMsg ' parameter of that CALLBACK function matches one of the set code watches. This function ' should be called in a LOOP to continually retrieve the codes sent to the specified ' CALLBACK function. ' ' NOTE : The values are returned via the parameters passed to this function ' ' Param Use ' ------------------------------------ ' lpHWND Returns the hWnd retrieved from the last CALLBACK function that recieved a ' message being watched. ' puMsg Returns the nCode retrieved from the last CALLBACK function that recieved a ' message being watched. ' lpWPARAM Returns the wParam retrieved from the last CALLBACK function that recieved a ' message being watched. ' lpLPARAM Returns the lParam retrieved from the last CALLBACK function that recieved a ' message being watched. ' '=========================================================================================================== ' __declspec(dllexport) __stdcall void GetMessageInfo (LPHANDLE *lpHWND, PUINT *puMsg, LONG_PTR *lpWPARAM, LONG_PTR *lpLPARAM) '----------------------------------------------------------------------------------------------------------- ' Public Declare Sub SC_GetMessageInfo Lib "SUBCLS.DLL" Alias "_GetMessageInfo@16" (ByRef lpHWND As Long, ByRef puMsg As Long, ByRef lpWPARAM As Long, ByRef lpLPARAM As Long) '=========================================================================================================== '=========================================================================================================== ' SetLastErr ' ' Sets the last error number ' ' Param Use ' ------------------------------------ ' iErrNum Specifies the error number to set to ' '=========================================================================================================== ' __declspec(dllexport) __stdcall void SetLastErr (int iErrNum) '----------------------------------------------------------------------------------------------------------- ' Public Declare Sub SC_SetLastErr Lib "SUBCLS.DLL" Alias "_SetLastErr@4" (ByVal iErrNum As Long) '=========================================================================================================== '=========================================================================================================== ' SetPreviousHWND ' ' Sets the handle to the previous windows procedure. If this value is not zero (0), then the ' "WindowProc" callback function uses this value to call the "CallWindowProc" Win32 API. ' Otherwise the "DefWindowProc" Win32 API is called. ' ' Param Use ' ------------------------------------ ' hWnd Specifies the handle of the previous window to call in the WindowProc ' '=========================================================================================================== ' __declspec(dllexport) __stdcall void SetPreviousHWND (WNDPROC hWnd) '----------------------------------------------------------------------------------------------------------- ' Public Declare Sub SC_SetPreviousHWND Lib "SUBCLS.DLL" Alias "_SetPreviousHWND@4" (ByVal hWnd As Long) '=========================================================================================================== '=========================================================================================================== ' SetUnSubClsOnQuitMsg ' ' If this is set to TRUE, then when a WM_DESTROY Or WM_QUIT message is recieved, ' this library stops any subclassing that is in progress. ' ' Param Use ' ------------------------------------ ' NewValue TRUE (1) / FALSE (0) ' '=========================================================================================================== ' __declspec(dllexport) __stdcall void SetUnSubClsOnQuitMsg (BOOL NewValue) '----------------------------------------------------------------------------------------------------------- ' Public Declare Sub SC_SetUnSubClsOnQuitMsg Lib "SUBCLS.DLL" Alias "_SetUnSubClsOnQuitMsg@4" (ByVal NewValue As Long) ' Sets BOOL '=========================================================================================================== '=========================================================================================================== ' AddMsgWatch ' ' Searches all the currently defined code watches and if the specified watch ' does not yet exist, it adds the specified code to the list of codes ' to watch. ' ' Returns TRUE (1) if it successfully adds the code to the list of watches ' Returns FALSE (0) if it failed to add the code ' Call GetLastErr to get more information on the error that occured ' ' Param Use ' ------------------------------------ ' uMsg Specifies the message watch to add ' '=========================================================================================================== ' __declspec(dllexport) __stdcall BOOL AddMsgWatch (UINT uMsg) '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_AddMsgWatch Lib "SUBCLS.DLL" Alias "_AddMsgWatch@4" (ByVal uMsg As Long) As Long ' Returns BOOL '=========================================================================================================== '=========================================================================================================== ' GetHInstance ' ' Function that returns a handle to the current DLL instance ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall HINSTANCE GetHInstance () '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_GetHInstance Lib "SUBCLS.DLL" Alias "_GetHInstance@0" () As Long '=========================================================================================================== '=========================================================================================================== ' GetLastErr ' ' Returns the error constant that represents the error that was encountered in the last ' function called. See the ERRC_* constants. ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall int GetLastErr () '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_GetLastErr Lib "SUBCLS.DLL" Alias "_GetLastErr@0" () As Long '=========================================================================================================== '=========================================================================================================== ' GetMsgWatchCount ' ' Function that returns how many valid code watches are currently in place ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall int GetMsgWatchCount () '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_GetMsgWatchCount Lib "SUBCLS.DLL" Alias "_GetMsgWatchCount@0" () As Long '=========================================================================================================== '=========================================================================================================== ' GetMsgWatchIndex ' ' Function that searches all of the currently defined code watches and if it ' finds a match to the specified code, it returns the index to that code ' ' Returns the code index (0 to 100) if a match is found ' Returns -1 if a match is not found ' ' Param Use ' ------------------------------------ ' uMsg Message watch to get the index from ' '=========================================================================================================== ' __declspec(dllexport) __stdcall int GetMsgWatchIndex (UINT uMsg) '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_GetMsgWatchIndex Lib "SUBCLS.DLL" Alias "_GetMsgWatchIndex@4" (ByVal uMsg As Long) As Long '=========================================================================================================== '=========================================================================================================== ' GetMsgWatchValue ' ' Function that returns the value of the message watch specified by the index passed ' ' Returns the code value if found ' Returns zero (0) if the code is not found ' ' Param Use ' ------------------------------------ ' iIndex Specifies the index of the message watch ' '=========================================================================================================== ' __declspec(dllexport) __stdcall UINT GetMsgWatchValue (int iIndex) '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_GetMsgWatchValue Lib "SUBCLS.DLL" Alias "_GetMsgWatchValue@4" (ByVal iIndex As Long) As Long '=========================================================================================================== '=========================================================================================================== ' GetPreviousHWND ' ' Returns the handle to the previous message handling procedure if subclassing is currently being used. ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall WNDPROC GetPreviousHWND () '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_GetPreviousHWND Lib "SUBCLS.DLL" Alias "_GetPreviousHWND@0" () As Long '=========================================================================================================== '=========================================================================================================== ' GetUnSubClsOnQuitMsg ' ' This returns whether the user specified to stop any subclassing if a WM_DESTROY or WM_QUIT ' message is recieved. ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall BOOL GetUnSubClsOnQuitMsg () '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_GetUnSubClsOnQuitMsg Lib "SUBCLS.DLL" Alias "_GetUnSubClsOnQuitMsg@0" () As Long '=========================================================================================================== '=========================================================================================================== ' MsgWatchExists ' ' Function that searches for the specified code watch and if it exists, ' ' Returns TRUE (1) if code watch exists ' Returns FALSE (0) if code watch doesn't exist ' ' Param Use ' ------------------------------------ ' uMsg Specifies the message watch to check ' '=========================================================================================================== ' __declspec(dllexport) __stdcall BOOL MsgWatchExists (UINT uMsg) '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_MsgWatchExists Lib "SUBCLS.DLL" Alias "_MsgWatchExists@4" (ByVal uMsg As Long) As Long ' Returns BOOL '=========================================================================================================== '=========================================================================================================== ' QuitMsgPosted ' ' Returns TRUE (1) if the WM_DESTROY or WM_QUIT message are recieved. This can be used to determine if ' the window you are trying to subclass has been closed by the user, or forced down by Windows®. ' ' Param Use ' ------------------------------------ ' None ' '=========================================================================================================== ' __declspec(dllexport) __stdcall BOOL QuitMsgPosted () '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_QuitMsgPosted Lib "SUBCLS.DLL" Alias "_QuitMsgPosted@0" () As Long ' Returns BOOL '=========================================================================================================== '=========================================================================================================== ' RemoveMsgWatch ' ' Function that removes the specified code watch. Code watch can be specified by ' the code, or by the index of the code watch. The specified uMsg is searched first ' and removed. If the uMsg isn't specified, the iIndex is used to remove the specified ' code watch. ' ' Returns TRUE (1) if successfully removes the specified watch ' Returns FALSE (0) if failed to remove the specified watch ' Call GetLastErr to get more information on the error that occured ' ' Param Use ' ------------------------------------ ' uMsg Optional. Specifies the message watch to remove. If this is ' not specified, you must specify the index in the iIndex parameter ' iIndex Optional. Specifies the index of the message watch to remove. ' If this is not specified, you must specify the message in the ' uMsg parameter. ' '=========================================================================================================== ' __declspec(dllexport) __stdcall BOOL RemoveMsgWatch (UINT uMsg, int iIndex) '----------------------------------------------------------------------------------------------------------- ' Public Declare Function SC_RemoveMsgWatch Lib "SUBCLS.DLL" Alias "_RemoveMsgWatch@8" (ByVal uMsg As Long, ByVal iIndex As Long) As Long ' Returns BOOL '=========================================================================================================== '=========================================================================================================== ' WindowProc ' ' The WindowProc function is an application-defined function that processes messages sent to a ' window. The WNDPROC type defines a pointer to this callback function. WindowProc is a ' placeholder for the application-defined function name. ' ' Param Use ' ------------------------------------ ' hWnd Handle to window ' uMsg Message identifier ' wParam First message parameter ' lParam Second message parameter ' '=========================================================================================================== ' __declspec(dllexport) __stdcall LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) '----------------------------------------------------------------------------------------------------------- ' Public Function WindowProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam) As Long ' ' < Your code goes here > ' End Function '===========================================================================================================